Fix BLACKHOLE inspection in RtClosureInspect

Authored by osa1 on Sep 25 2018, 5:25 AM.



When inspecing a BLACKHOLE if the BLACKHOLE points to a TSO or a
BLOCKING_QUEUE we should return a suspension to the BLACKHOLE itself
(instead of returning a suspension to the indirectee). The reason is
because in the debugger when we want to evaluate this term we need to
enter the BLACKHOLE and not to the TSO or BLOCKING_QUEUE. See the
runtime panic caused by this in Trac #8316.

Note that while with this patch we do the right thing to evaluate
thunks in GHCi, evaluating thunks that are owned by the evaluator thread
in a breakpoint will cause a deadlock as we don't release the breakMVar,
which is what blocks the evaluator thread from continuing with
evaluation. So the GHCi thread will enter the BLACKHOLE, but owner of
the BLACKHOLE is also blocked.

Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
osa1 created this revision.Sep 25 2018, 5:25 AM
bgamari accepted this revision.Oct 15 2018, 12:22 PM

This looks reasonable to @simonmar and me.

However, there are still a few more things that need to be done after merging this, describing in Trac #8316 comment:19. Could you handle this @osa1?

This revision is now accepted and ready to land.Oct 15 2018, 12:22 PM
This revision was automatically updated to reflect the committed changes.