guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile 2.0.9 build on mingw


From: Eli Zaretskii
Subject: Re: guile 2.0.9 build on mingw
Date: Mon, 10 Jun 2013 19:18:05 +0300

> From: address@hidden (Ludovic Courtès)
> Cc: Eli Zaretskii <address@hidden>,  address@hidden
> Date: Sun, 09 Jun 2013 23:35:54 +0200
> 
> Andy Wingo <address@hidden> skribis:
> 
> > On Sun 09 Jun 2013 22:33, address@hidden (Ludovic Courtès) writes:
> >
> >> However, that warning doesn’t take into account the signal thread, nor
> >> the GC thread (if any).  So, although that seems unlikely, there could
> >> still be issues, for instance if the ‘scm_fork’ call happens while
> >> ‘signal_delivery_thread_mutex’ is locked.
> >
> > In theory the signal thread is counted among the threads -- iirc anyway.
> 
> Apparently no, because ‘scm_fork’ uses ‘scm_all_threads’, which
> explicitly “hides” the signal thread.
> 
> > The signal-handling thread is kicked off at the first call to sigaction,
> > which shouldn't happen there, right?
> 
> Hmm, right, though it can also be spawned from ‘on_thread_exit’.
> 
> A better test would be:
> 
>   (use-modules (ice-9 match))
>   (sigaction SIGINT)
>   (match (primitive-fork)
>     (0 (gc) (primitive-exit 0))
>     (child
>       (waitpid child)
>       (exit 0)))

Are you sure the above is relevant to Windows?  You are aware that
there's no 'fork' system call on Windows, and no real signals (except
SIGINT and SIGSEGV)?  Or does Guile emulate 'fork' somehow?

Anyway, I tried what you asked.  I've put the above into a test.scm
script and invoked Guile thusly, from the libguile directory of the
source tree:

  $ GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0 ../meta/uninstalled-env guild 
test1

Is this the right way of running the above script?

Anyway, Guile gets stuck.  Attaching GDB shows the info below, I hope
it will help you see what is going on.  (Thread #3 is the thread
started by Windows for attaching the debugger, so disregard it.)

If nothing rings the bell, I guess I will try building Guile without
threads, maybe I will have better luck that way.

     (gdb) info threads
       Id   Target Id         Frame
     * 3    Thread 15068.0x32f4 0x77c4000d in ntdll!DbgBreakPoint ()
        from C:\Windows\SysWOW64\ntdll.dll
       2    Thread 15068.0x32e0 0x77c4f8b1 in ntdll!ZwWaitForSingleObject ()
        from C:\Windows\SysWOW64\ntdll.dll
       1    Thread 15068.0x3e90 0x77c5013d in ntdll!ZwWaitForMultipleObjects ()
        from C:\Windows\SysWOW64\ntdll.dll
     (gdb) thread apply all bt

     Thread 3 (Thread 15068.0x32f4):
     #0  0x77c4000d in ntdll!DbgBreakPoint () from C:\Windows\SysWOW64\ntdll.dll
     #1  0x77ccf896 in ntdll!DbgUiRemoteBreakin ()
        from C:\Windows\SysWOW64\ntdll.dll
     #2  0x3a26c959 in ?? ()
     #3  0x00000000 in ?? ()

     Thread 2 (Thread 15068.0x32e0):
     #0  0x77c4f8b1 in ntdll!ZwWaitForSingleObject ()
        from C:\Windows\SysWOW64\ntdll.dll
     #1  0x77c4f8b1 in ntdll!ZwWaitForSingleObject ()
        from C:\Windows\SysWOW64\ntdll.dll
     #2  0x7744149d in WaitForSingleObjectEx ()
        from C:\Windows\syswow64\KernelBase.dll
     #3  0x0000016c in ?? ()
     #4  0x00000000 in ?? ()

     Thread 1 (Thread 15068.0x3e90):
     #0  0x77c5013d in ntdll!ZwWaitForMultipleObjects ()
        from C:\Windows\SysWOW64\ntdll.dll
     #1  0x77c5013d in ntdll!ZwWaitForMultipleObjects ()
        from C:\Windows\SysWOW64\ntdll.dll
     #2  0x774415e9 in WaitForMultipleObjectsEx ()
        from C:\Windows\syswow64\KernelBase.dll
     #3  0x00000002 in ?? ()
     #4  0x0028ef38 in ?? ()
     #5  0x75e91a2c in WaitForMultipleObjectsEx ()
        from C:\Windows\syswow64\kernel32.dll
     #6  0x75e94220 in WaitForMultipleObjects ()
        from C:\Windows\syswow64\kernel32.dll
     #7  0x6248b9ec in pthreadCancelableTimedWait () from 
d:\usr\bin\pthreadGC2.dll
     #8  0x6248c6b6 in sem_timedwait () from d:\usr\bin\pthreadGC2.dll
     #9  0x6248cf8b in pthread_cond_wait () from d:\usr\bin\pthreadGC2.dll
     #10 0x00432ecb in scm_pthread_cond_wait (address@hidden,
         address@hidden) at threads.c:1990
     #11 0x00432f7c in scm_spawn_thread (
         address@hidden <signal_delivery_thread>,
         address@hidden, handler=0x431794 <scm_handle_by_message>,
         address@hidden <scm_i_open_file__name_string_stringbuf+20>) at 
threads.c:1143
     #12 0x00436318 in start_signal_delivery_thread () at scmsigs.c:200
     #13 0x6248b751 in pthread_once () from d:\usr\bin\pthreadGC2.dll
     #14 0x0043641c in scm_i_ensure_signal_delivery_thread () at scmsigs.c:212
     #15 0x0043648f in scm_sigaction_for_thread (signum=0xa, handler=0x904,
         flags=0x904, thread=0x23396d8) at scmsigs.c:330
     #16 0x00454b5a in vm_regular_engine (vm=0x2395c80, program=0x0,
         argv=0x2400308, nargs=5121981) at vm-i-system.c:861
     #17 0x00414adc in scm_primitive_eval (exp=0x2d28188) at eval.c:685
     #18 0x00437b6f in scm_primitive_load (address@hidden)
         at load.c:132
     #19 0x004386f8 in scm_primitive_load_path (args=0x2d07b10) at load.c:1050
     #20 0x00454b99 in vm_regular_engine (vm=0x2395c80, program=0x0,
         argv=0x24002d8, nargs=5120951) at vm-i-system.c:852
     #21 0x00414adc in scm_primitive_eval (address@hidden) at eval.c:685
     #22 0x00414b2f in scm_eval (exp=0x2e056c0,
         address@hidden) at eval.c:719
     #23 0x004129fd in scm_shell (address@hidden, address@hidden)
         at script.c:441
     #24 0x0040146f in inner_main (closure=0x0, argc=6, argv=0xa30f78)
         at guile.c:62
     #25 0x00412aec in invoke_main_func (body_data=0x28fee0) at init.c:337
     #26 0x0045f8ac in c_body (d=0x28fe14) at continuations.c:511
     #27 0x00454b8b in vm_regular_engine (vm=0x2395c80, program=0x0,
         argv=0x240007c, nargs=5121210) at vm-i-system.c:855
     #28 0x004145f8 in scm_call_4 (proc=0x22f6b28, address@hidden,
         address@hidden, address@hidden,
         address@hidden) at eval.c:507
     #29 0x004312a2 in scm_catch_with_pre_unwind_handler (key=0x404,
         thunk=0x2c11d50, handler=0x2c11d20, pre_unwind_handler=0x2c11ce0)
         at throw.c:86
     #30 0x0043143e in scm_c_catch (address@hidden, body=0x2c11d50,
         address@hidden <c_body>, body_data=0x2c11d20,
         address@hidden, handler=0x2c11ce0,
         address@hidden <c_handler>,
         address@hidden,
         address@hidden <pre_unwind_handler>, address@hidden)
         at throw.c:213
     #31 0x0045ff3b in scm_i_with_continuation_barrier (
         address@hidden <c_body>, address@hidden,
         address@hidden <c_handler>,
         address@hidden,
         address@hidden <pre_unwind_handler>, 
pre_unwind_handler_data=0x2395c40) at continuations.c:449
     #32 0x0045ffcc in scm_c_with_continuation_barrier (
         func=0x412abc <invoke_main_func>, data=0x28fee0) at continuations.c:545
     #33 0x004326a5 in with_guile_and_parent (base=0x28fe8c, data=0x28feb4)
         at threads.c:908
     #34 0x709cae6f in ?? () from d:\usr\bin\libgc-1.dll
     #35 0x004328e0 in scm_i_with_guile_and_parent (parent=<optimized out>,
         data=0x28fee0, address@hidden,
         address@hidden <invoke_main_func>) at threads.c:951
     #36 scm_with_guile (address@hidden <invoke_main_func>,
         address@hidden) at threads.c:957
     #37 0x00412bf7 in scm_boot_guile (address@hidden,
         address@hidden,
         address@hidden <inner_main>,
         address@hidden) at init.c:320
     #38 0x004c631f in main (argc=6, argv=0xa30f78) at guile.c:108
     (gdb)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]