Opened 4 years ago

Last modified 4 years ago

#11406 new bug

RTS gets stuck in scheduleDetectDeadlock()

Reported by: osa1 Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 8.1
Keywords: Cc: simonmar
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Steps to reproduce:

  • Compile HEAD.
  • Add this line to MkId.mkDataConRep:
pprTrace "mkDataConRep" (text "wrap_body:" <+> ppr wrap_body) (return ())
  • Recompile only stage1. (stage2 will fail, see next step)
  • Compile any file using newly generated stage1.

GHC gets stuck, not using any CPU or RAM. The stack trace:

#0  0x00007fd56d570650 in __pause_nocancel () at ../sysdeps/unix/syscall-template.S:81
#1  0x0000000002174e11 in awaitUserSignals () at rts/posix/Signals.c:343
#2  0x0000000002168a6a in scheduleDetectDeadlock (pcap=<synthetic pointer>, task=<optimized out>) at rts/Schedule.c:931
#3  schedule (task=0x42fa8e0, initialCapability=<optimized out>) at rts/Schedule.c:282
#4  scheduleWaitThread (tso=<optimized out>, ret=ret@entry=0x0, pcap=pcap@entry=0x7fffb90b7778) at rts/Schedule.c:2380
#5  0x0000000002187724 in rts_evalLazyIO (cap=cap@entry=0x7fffb90b7778, p=<optimized out>, ret=ret@entry=0x0) at rts/RtsAPI.c:500
#6  0x0000000002166637 in real_main () at rts/RtsMain.c:63
#7  hs_main (argc=<optimized out>, argv=<optimized out>, main_closure=<optimized out>, rts_config=...) at rts/RtsMain.c:114
#8  0x0000000000421fe4 in main ()

It's basically stuck in pause() syscall.

Change History (1)

comment:1 Changed 4 years ago by simonmar

This is probably an infinite loop, i.e. a blackhole. The trace you added forces something too early and causes a deadlock.

For some reason we don't detect and report blackhole loops as <<loop>> in GHC, that is probably worth investigating.

Note: See TracTickets for help on using tickets.