Subject: Re: bug#14171: Aw: Re: bug#14171: REPL doesn't work on windows min-gw

From: Mark H Weaver <[email-masked]>
Date: Sun, 14 Apr 2013 13:26:25 -0400

"Jan Schukat" <[email-masked]> writes:
> Ok, did use this package: guile-2.0.9.2-f480a-dirty.tar.gz and can
> build and run guile-2.0 on mingw when I --disable-posix, which makes
> sense, since Windows is not posix :) Can even use threads.
> I guess I try to get the test-suite to run now.
> I'm pretty happy now that my issues on windows could be resolved in
> the last few weeks.

Excellent! :)

FYI, LRN on #gnunet reported the same issue (Guile REPL hangs on mingw),
and --disable-posix fixed the problem for him as well.  He provided a
backtrace (generated by ProcessHacker; gdb didn't generate a useful
backtrace), and I've attached it below.

He also reported that, when built with --enable-posix, control reached
the start of 'top-repl', but never reached 'start-repl'.  The backtrace
seems to suggest that the lockup might be happening within 'sigaction',
which is called from 'call-with-sigint' in (ice-9 top-repl).

    Regards,
      Mark

0, ntoskrnl.exe!_misaligned_access+0x17e7
1, ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x93d
2, ntoskrnl.exe!KeWaitForSingleObject+0x19f
3, ntoskrnl.exe!_misaligned_access+0xba4
4, ntoskrnl.exe!_misaligned_access+0x1821
5, ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x93d
6, ntoskrnl.exe!KeWaitForMultipleObjects+0x26a
7, ntoskrnl.exe!NtWaitForSingleObject+0x40f
8, ntoskrnl.exe!IoReportTargetDeviceChange+0xe6d
9, ntoskrnl.exe!KeSynchronizeExecution+0x3a23
10, wow64cpu.dll!TurboDispatchJumpAddressEnd+0x6c0
11, wow64cpu.dll!TurboDispatchJumpAddressEnd+0xf5
12, wow64.dll!Wow64SystemServiceEx+0x1ce
13, wow64.dll!Wow64LdrpInitialize+0x429
14, ntdll.dll!RtlUniform+0x6e6
15, ntdll.dll!RtlCreateTagHeap+0xa7
16, ntdll.dll!LdrInitializeThunk+0xe
17, ntdll.dll!ZwWaitForMultipleObjects+0x15
18, kernel32.dll!WaitForMultipleObjectsEx+0x8e
19, kernel32.dll!WaitForMultipleObjects+0x18
20, libwinpthread-1.dll!pthread_cond_init+0x1f8
21, libwinpthread-1.dll!pthread_tls_init+0x503
22, libwinpthread-1.dll!pthread_cond_init+0x510
23, libwinpthread-1.dll!pthread_cond_wait+0x138
24, libgcc_s_sjlj-1.dll!_emutls_get_address+0x52
25, libguile-2.0-22.dll!scm_spawn_thread+0xc6
26, libguile-2.0-22.dll!scm_init_rw+0x8c
27, libwinpthread-1.dll!pthread_once+0xae
28, libguile-2.0-22.dll!scm_sigaction_for_thread+0x7f
29, libguile-2.0-22.dll!scm_primitive_eval+0x34
30, libguile-2.0-22.dll!scm_call_4+0x48
31, libguile-2.0-22.dll!scm_catch_with_pre_unwind_handler+0x4e
32, libguile-2.0-22.dll!scm_i_with_continuation_barrier+0x6f
33, libguile-2.0-22.dll!scm_current_error_port+0x20
34, guile.exe+0x86d90

0, ntoskrnl.exe!_misaligned_access+0x17e7
1, ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x93d
2, ntoskrnl.exe!KeWaitForSingleObject+0x19f
3, ntoskrnl.exe!_misaligned_access+0xba4
4, ntoskrnl.exe!_misaligned_access+0x1821
5, ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x93d
6, ntoskrnl.exe!KeWaitForSingleObject+0x19f
7, ntoskrnl.exe!NtWaitForSingleObject+0xde
8, ntoskrnl.exe!KeSynchronizeExecution+0x3a23
9, wow64cpu.dll!TurboDispatchJumpAddressEnd+0x6c0
10, wow64cpu.dll!TurboDispatchJumpAddressEnd+0x4a8
11, wow64.dll!Wow64SystemServiceEx+0x1ce
12, wow64.dll!Wow64LdrpInitialize+0x429
13, ntdll.dll!RtlIsDosDeviceName_U+0x24c87
14, ntdll.dll!LdrInitializeThunk+0xe
15, ntdll.dll!ZwWaitForSingleObject+0x15
16, kernel32.dll!WaitForSingleObjectEx+0x43
17, kernel32.dll!WaitForSingleObject+0x12
18, libwinpthread-1.dll!pthread_cond_init+0x26f
19, kernel32.dll!WaitForSingleObject+0x12
20, libwinpthread-1.dll!pthread_rel_time_in_ms+0x24a
21, libwinpthread-1.dll!pthread_mutex_init+0x29b
22, libwinpthread-1.dll!pthread_rel_time_in_ms+0x24a
23, libgc-1.dll!GC_call_with_gc_active+0x216
24, libwinpthread-1.dll!pthread_mutex_trylock+0x1f
25, libgc-1.dll!GC_pthread_detach+0x28
26, libwinpthread-1.dll!pthread_self+0x8
27, libguile-2.0-22.dll!scm_all_threads+0x126
28, libwinpthread-1.dll!pthread_getclean+0x8
29, libgc-1.dll!GC_use_threads_discovery+0x26e
30, libgc-1.dll!GC_call_with_stack_base+0x1c
31, msvcrt.dll!itow_s+0x4c
32, msvcrt.dll!endthreadex+0x6c
33, kernel32.dll!BaseThreadInitThunk+0x12
34, ntdll.dll!RtlInitializeExceptionChain+0x63
35, ntdll.dll!RtlInitializeExceptionChain+0x36

<LRN> if i insert  (display "Hello\n") into top-repl, it prints there (at
      least at the beginning of the function). Nothing is printed in
      start-repl  [12:47]