Fix BLACKHOLE inspection in RtClosureInspect
ClosedPublic

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

Details

Summary

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

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
osa1 created this revision.Tue, Sep 25, 5:25 AM
bgamari accepted this revision.Mon, Oct 15, 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.Mon, Oct 15, 12:22 PM
This revision was automatically updated to reflect the committed changes.