Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,322
    • Issues 4,322
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 362
    • Merge Requests 362
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #12037

Closed
Open
Opened May 10, 2016 by Simon Marlow@simonmarDeveloper

Shutdown interacts badly with requestSync()

I've been investigating #10860 (closed), and the problem goes pretty deep, so I'm going to record what I know here and come back to fix it properly later.

We have this mechanism requestSync() for operations that need to seize control of the whole runtime to do something. It is used by

  • scheduleDoGC()
  • setNumCapabilities()
  • forkProcess()

requestSync() ensures that only one of these operations wins, the others will yieldCapability() to the winner, before continuing with their own sync.

The problem is that this interacts badly with shutdown. Shutdown might start at any time (initiated by exitScheduler()). If it starts during a sync, then a deadlock is likely: some capabilities will be already shut down, and cannot be acquired by acquireAllCapabilities(). This happens in #10860 (closed).

Really, shutdown should play the requestSync() game too, but that requires a lot of thought.

Trac metadata
Trac field Value
Version 7.10.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking #10860 (closed)
CC simonmar
Operating system
Architecture
Assignee
Assign to
8.2.1
Milestone
8.2.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#12037