-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Dear @dmjio,
Me and @mpickering have been implementing a debugger for GHC and we started using the dap
library for the DAP part of the debugger.
However, we ran into a nasty deadlock while doing something seemingly standard in the debugger threads that are launched by registerNewDebugSession
.
We had something that looked like
(readDebuggerOutput, writeDebuggerOutput) <- liftIO P.createPipe
registerNewDebugSession (maybe "debug-session" T.pack __sessionId) DAS{..}
[ debuggerThread ... writeDebuggerOutput
, outputEventsThread readDebuggerOutput
]
And this resulted in a deadlock within dap
outlined as:
- Initialisation starts, starts writing to a pipe
- Worker thread tries to output things from the pipe, but can't because that requires taking a lock on the MVar
- Step 1 blocks because the pipe gets full
- Step 2 blocks, since it is waiting for step 1 to finish
Metadata
Metadata
Assignees
Labels
No labels