Here is some information. It is garbage collection + threads bug (possibly + dynamic loading).
When I reproduce the failure (by make check) on my machine, it keeps running at gauche-c-wrapper/testsuite/cwrappertest.scm. gauche-c-wrapper/testsuite/test.log having: ------------------------------------------- [...] Testing c-wrapper (ffi) ======================================================= testing bindings in #<module c-wrapper> ... ok test dlopen, expects #f ==> ok test dlsym, expects #f ==> ok test ffi_prep_cif, expects 0 ==> ok test ffi_call, expects 3 ==> ok test ffi_closure, expects #t ==> ok test call callback, expects 5 ==> ------------------------------------------- In this situation, here is the GDB trace: ------------------------------------------- Current directory is ~/debian/gauche/src/ GNU gdb (Debian 8.2.1-2) 8.2.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from gosh...done. (gdb) attach 8096 Attaching to program: /home/gniibe/debian/gauche/src/gosh, process 8096 [New LWP 8097] [New LWP 8098] [New LWP 8099] warning: Could not load shared library symbols for 4 libraries, e.g. ../src/c-ffi.so. Use the "info sharedlibrary" command to see the complete listing. Do you need "set solib-search-path" or "set sysroot"?[Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 0x00007fc407a35c13 in ?? () (gdb) info threads Id Target Id Frame * 1 Thread 0x7fc409a14740 (LWP 8096) "gosh" 0x00007fc407a35c13 in ?? () 2 Thread 0x7fc409a13700 (LWP 8097) "gosh" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fc40a27db68 <mark_cv+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 3 Thread 0x7fc409082700 (LWP 8098) "gosh" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fc40a27db68 <mark_cv+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 4 Thread 0x7fc4086f1700 (LWP 8099) "gosh" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fc40a27db68 <mark_cv+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 (gdb) bt #0 0x00007fc407a35c13 in ?? () #1 0x00007fc407a308b5 in ?? () #2 0x00005613a63c4f90 in ?? () #3 0x00007fc40a06e29f in GC_invoke_finalizers () at finalize.c:1236 #4 0x00007fc409f358c9 in Scm_VMFinalizerRun (vm=vm@entry=0x5613a55a3c00) at core.c:305 #5 0x00007fc409f38313 in process_queued_requests (vm=0x5613a55a3c00) at vm.c:2691 #6 0x00007fc409f45d35 in run_loop () at vm.c:909 #7 0x00007fc409f4d1dc in user_eval_inner (program=<optimized out>, codevec=codevec@entry=0x7ffe3b75b510) at vm.c:1489 #8 0x00007fc409f4ee4f in apply_rec (vm=<optimized out>, vm=<optimized out>, nargs=2, proc=0x5613a56c6580) at vm.c:1582 #9 Scm_ApplyRec2 (proc=0x5613a56c6580, arg0=arg0@entry=0x5613a63d5cb0, arg1=arg1@entry=0x5613a6323f50) at vm.c:1622 #10 0x00007fc409f4f412 in Scm_Compile (program=program@entry=0x5613a63d5cb0, env=env@entry=0x5613a6323f50) at compaux.c:65 #11 0x00007fc409f389f3 in Scm_VMEval (expr=0x5613a63d5cb0, e=0x5613a6323f50) at vm.c:1388 #12 0x00007fc409ff9010 in libevaleval (SCM_FP=<optimized out>, SCM_ARGCNT=<optimized out>, data_=<optimized out>) at libeval.scm:5149 #13 0x00007fc409f421cc in run_loop () at ./vmcall.c:193 #14 0x00007fc409f4d1dc in user_eval_inner (program=<optimized out>, codevec=codevec@entry=0x7ffe3b75b890) at vm.c:1489 #15 0x00007fc409f4edc3 in apply_rec (vm=<optimized out>, vm=<optimized out>, nargs=1, proc=0x5613a5ca7100) at vm.c:1582 #16 Scm_ApplyRec1 (proc=0x5613a5ca7100, arg0=0x5613a5c7e300) at vm.c:1614 #17 0x00007fc407a338f1 in ?? () #18 0x0000000000000001 in ?? () #19 0x00005613a55a3c00 in ?? () #20 0x00007fc40a12bd08 in ccEnvMark () from /lib/libgauche-0.9.so.0 #21 0x00007fc409f421cc in run_loop () at ./vmcall.c:193 #22 0x00007fc409f4d1dc in user_eval_inner (program=<optimized out>, codevec=codevec@entry=0x7ffe3b75bbf0) at vm.c:1489 #23 0x00007fc409f4e0e2 in apply_rec (vm=0x5613a55a3c00, vm=0x5613a55a3c00, nargs=<optimized out>, proc=0x5613a5626140) at vm.c:1582 #24 Scm_ApplyRec (proc=0x5613a5626140, args=0x20b) at vm.c:1602 #25 0x00007fc409fa0794 in Scm_Load (cpath=<optimized out>, flags=<optimized out>, packet=0x7ffe3b75bd30) at load.c:223 #26 0x00005613a36c46ce in execute_script (scriptfile=<optimized out>, args=0x5613a5743490) at main.c:550 #27 0x00005613a36c36f4 in main (ac=<optimized out>, av=<optimized out>) at main.c:751 (gdb) thread 2 [Switching to thread 2 (Thread 0x7fc409a13700 (LWP 8097))] #0 futex_wait_cancelable (private=0, expected=0, futex_word=0x7fc40a27db68 <mark_cv+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 88 ../sysdeps/unix/sysv/linux/futex-internal.h: No such file or directory. (gdb) bt #0 futex_wait_cancelable (private=0, expected=0, futex_word=0x7fc40a27db68 <mark_cv+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 #1 __pthread_cond_wait_common (abstime=0x0, mutex=0x7fc40a27d820 <mark_mutex>, cond=0x7fc40a27db40 <mark_cv>) at pthread_cond_wait.c:502 #2 __pthread_cond_wait (cond=0x7fc40a27db40 <mark_cv>, mutex=0x7fc40a27d820 <mark_mutex>) at pthread_cond_wait.c:655 #3 0x00007fc40a079f37 in GC_wait_marker () at pthread_support.c:2210 #4 0x00007fc40a071b52 in GC_help_marker (my_mark_no=my_mark_no@entry=8) at mark.c:1231 #5 0x00007fc40a079eec in GC_mark_thread (id=<optimized out>) at pthread_support.c:379 #6 0x00007fc409a1efa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 #7 0x00007fc409cff82f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 (gdb) thread 3 [Switching to thread 3 (Thread 0x7fc409082700 (LWP 8098))] #0 futex_wait_cancelable (private=0, expected=0, futex_word=0x7fc40a27db68 <mark_cv+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 88 in ../sysdeps/unix/sysv/linux/futex-internal.h (gdb) bt #0 futex_wait_cancelable (private=0, expected=0, futex_word=0x7fc40a27db68 <mark_cv+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 #1 __pthread_cond_wait_common (abstime=0x0, mutex=0x7fc40a27d820 <mark_mutex>, cond=0x7fc40a27db40 <mark_cv>) at pthread_cond_wait.c:502 #2 __pthread_cond_wait (cond=0x7fc40a27db40 <mark_cv>, mutex=0x7fc40a27d820 <mark_mutex>) at pthread_cond_wait.c:655 #3 0x00007fc40a079f37 in GC_wait_marker () at pthread_support.c:2210 #4 0x00007fc40a071b52 in GC_help_marker (my_mark_no=my_mark_no@entry=8) at mark.c:1231 #5 0x00007fc40a079eec in GC_mark_thread (id=<optimized out>) at pthread_support.c:379 #6 0x00007fc409a1efa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 #7 0x00007fc409cff82f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 (gdb) thread 4 [Switching to thread 4 (Thread 0x7fc4086f1700 (LWP 8099))] #0 futex_wait_cancelable (private=0, expected=0, futex_word=0x7fc40a27db68 <mark_cv+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 88 in ../sysdeps/unix/sysv/linux/futex-internal.h (gdb) bt #0 futex_wait_cancelable (private=0, expected=0, futex_word=0x7fc40a27db68 <mark_cv+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 #1 __pthread_cond_wait_common (abstime=0x0, mutex=0x7fc40a27d820 <mark_mutex>, cond=0x7fc40a27db40 <mark_cv>) at pthread_cond_wait.c:502 #2 __pthread_cond_wait (cond=0x7fc40a27db40 <mark_cv>, mutex=0x7fc40a27d820 <mark_mutex>) at pthread_cond_wait.c:655 #3 0x00007fc40a079f37 in GC_wait_marker () at pthread_support.c:2210 #4 0x00007fc40a071b52 in GC_help_marker (my_mark_no=my_mark_no@entry=8) at mark.c:1231 #5 0x00007fc40a079eec in GC_mark_thread (id=<optimized out>) at pthread_support.c:379 #6 0x00007fc409a1efa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 #7 0x00007fc409cff82f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 --