Some tests fail to terminate on Windows in release flavour
Strange, a small selection of tests are failing to terminate on Windows when GHC is built in the release+no_split_sections
flavour (+no_split_sections
due to #22834 (closed) ). These include ipeMap
and linker_error1
. For instance,
$ _build/stage1/bin/ghc testsuite/tests/rts/ipe/ipeEventLog.c -no-hs-main -o ipeEventlog.exe testsuite/tests/rts/ipe/ipe_lib.c -threaded -debug
$ gdb --args ./ipeEventlog.exe
...
Thread 8 received signal SIGINT, Interrupt.
[Switching to Thread 17404.0x4064]
0x00007ffda1021a2d in TlsGetValue () from /c/WINDOWS/System32/KERNELBASE.dll
(gdb) thread apply all bt
Thread 8 (Thread 17404.0x4064):
#0 0x00007ffda1021a2d in TlsGetValue () from /c/WINDOWS/System32/KERNELBASE.dll
#1 0x00007ffda2907034 in KERNEL32!BaseThreadInitThunk () from /c/WINDOWS/System32/KERNEL32.DLL
#2 0x00007ffda3362651 in ntdll!RtlUserThreadStart () from /c/WINDOWS/SYSTEM32/ntdll.dll
#3 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Thread 6 (Thread 17404.0x2364):
#0 0x00007ffda33acdc4 in ntdll!ZwWaitForSingleObject () from /c/WINDOWS/SYSTEM32/ntdll.dll
#1 0x00007ffda0f81ace in WaitForSingleObjectEx () from /c/WINDOWS/System32/KERNELBASE.dll
#2 0x00007ff62eb27df4 in base_GHCziConcziPOSIX_zdwservicezuloop_info ()
#3 0x000001895a375870 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Thread 5 (Thread 17404.0x5268):
#0 0x00007ffda33b0794 in ntdll!ZwWaitForWorkViaWorkerFactory () from /c/WINDOWS/SYSTEM32/ntdll.dll
#1 0x00007ffda3362dc7 in ntdll!TpReleaseCleanupGroupMembers () from /c/WINDOWS/SYSTEM32/ntdll.dll
#2 0x00007ffda2907034 in KERNEL32!BaseThreadInitThunk () from /c/WINDOWS/System32/KERNEL32.DLL
#3 0x00007ffda3362651 in ntdll!RtlUserThreadStart () from /c/WINDOWS/SYSTEM32/ntdll.dll
#4 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Thread 4 (Thread 17404.0x56ec):
#0 0x00007ffda33b0794 in ntdll!ZwWaitForWorkViaWorkerFactory () from /c/WINDOWS/SYSTEM32/ntdll.dll
#1 0x00007ffda3362dc7 in ntdll!TpReleaseCleanupGroupMembers () from /c/WINDOWS/SYSTEM32/ntdll.dll
#2 0x00007ffda2907034 in KERNEL32!BaseThreadInitThunk () from /c/WINDOWS/System32/KERNEL32.DLL
#3 0x00007ffda3362651 in ntdll!RtlUserThreadStart () from /c/WINDOWS/SYSTEM32/ntdll.dll
#4 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Thread 3 (Thread 17404.0x5578):
#0 0x00007ffda33b0794 in ntdll!ZwWaitForWorkViaWorkerFactory () from /c/WINDOWS/SYSTEM32/ntdll.dll
#1 0x00007ffda3362dc7 in ntdll!TpReleaseCleanupGroupMembers () from /c/WINDOWS/SYSTEM32/ntdll.dll
#2 0x00007ffda2907034 in KERNEL32!BaseThreadInitThunk () from /c/WINDOWS/System32/KERNEL32.DLL
#3 0x00007ffda3362651 in ntdll!RtlUserThreadStart () from /c/WINDOWS/SYSTEM32/ntdll.dll
#4 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Thread 2 (Thread 17404.0x5288):
#0 0x00007ffda33b0794 in ntdll!ZwWaitForWorkViaWorkerFactory () from /c/WINDOWS/SYSTEM32/ntdll.dll
#1 0x00007ffda3362dc7 in ntdll!TpReleaseCleanupGroupMembers () from /c/WINDOWS/SYSTEM32/ntdll.dll
#2 0x00007ffda2907034 in KERNEL32!BaseThreadInitThunk () from /c/WINDOWS/System32/KERNEL32.DLL
#3 0x00007ffda3362651 in ntdll!RtlUserThreadStart () from /c/WINDOWS/SYSTEM32/ntdll.dll
#4 0x0000000000000000 in ?? ()
--Type <RET> for more, q to quit, c to continue without paging--
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Thread 1 (Thread 17404.0x38ac):
#0 0x00007ffda336cdca in ntdll!RtlQueryFeatureConfiguration () from /c/WINDOWS/SYSTEM32/ntdll.dll
#1 0x00007ffda3339169 in ntdll!RtlAcquireSRWLockExclusive () from /c/WINDOWS/SYSTEM32/ntdll.dll
#2 0x00007ff62e6f06f7 in shutdownCapability (cap=0x7ff62ee7b180, task=0x1895a375d50, safe=true) at rts/Capability.c:1157
#3 0x00007ff62e6f05ff in shutdownCapabilities (task=0x1895a375d50, safe=true) at rts/Capability.c:1250
#4 0x00007ff62e709014 in exitScheduler (wait_foreign=true) at rts/Schedule.c:2794
#5 0x00007ff62e6e58b8 in hs_exit_ (wait_foreign=true) at rts/RtsStartup.c:485
#6 0x00007ff62e6e5834 in hs_exit () at rts/RtsStartup.c:649
#7 0x00007ff62e6e1509 in main ()
(gdb)
My investigation thusfar suggests that the RTS is unable to shutdown due to an IO manager thread which is stuck in a foreign call. My suspicion is that this is due to the refactoring performed in !4745 (closed).
Edited by Ben Gamari