Project

General

Profile

Bug #18444 ยป 18444.log

wanabe (_ wanabe), 08/13/2026 05:05 AM

 
$ gdb --args ./miniruby -ve 'Signal.trap(:TERM) { print "2\r"; sleep 0.01; exit(0) }; spawn("sleep 0.1; kill -TERM #{$$}"); loop {print "1\r"}'
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
Copyright (C) 2024 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:
<https://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 ./miniruby...
(gdb) r
Starting program: /home/wanabe/work/prog/ruby/ruby/tmp/master/miniruby -ve Signal.trap\(:TERM\)\ \{\ print\ \"2\\r\"\;\ sleep\ 0.01\;\ exit\(0\)\ \}\;\ spawn\(\"sleep\ 0.1\;\ kill\ -TERM\ \#\{\$\$\}\"\)\;\ loop\ \{print\ \"1\\r\"\}

This GDB supports auto-downloading debuginfo from the following URLs:
<https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n])
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffde5ff6c0 (LWP 71356)]
ruby 4.1.0dev (2026-08-12T02:39:28Z origin/master c6e9858440) +PRISM [x86_64-linux]
[Detaching after vfork from child process 71357]
1
Thread 1 "miniruby" received signal SIGTERM, Terminated.
0x00007ffff7b1c6dd in __GI___libc_write (nbytes=2, buf=0x55555606e810, fd=1) at ../sysdeps/unix/sysv/linux/write.c:26
warning: 26 ../sysdeps/unix/sysv/linux/write.c: No such file or directory
(gdb) b rb_raise
Breakpoint 1 at 0x5555556aad64: file ../../error.c, line 3930.
(gdb) c
Continuing.

Thread 1 "miniruby" hit Breakpoint 1, rb_raise (exc_class=93824993755556, fmt=0x7fffffff9710 "@\227\377\377\377\177") at ../../error.c:3930
3930 {
(gdb) bt
#0 rb_raise (exc_class=93824993755556, fmt=0x7fffffff9710 "@\227\377\377\377\177") at ../../error.c:3930
#1 0x0000555555895bf4 in do_mutex_lock (args=0x7fffffff9870, interruptible_p=1) at ../../thread_sync.c:296
#2 0x000055555589674a in rb_mutex_synchronize (self=140737345534480, func=0x555555700320 <io_binwrite_string>, arg=140737488328896) at ../../thread_sync.c:628
#3 0x00005555557005d5 in io_binwrite (ptr=0x55555606e8c0 "2\r", len=2, fptr=0x555555f26c40, nosync=0) at ../../io.c:1939
#4 0x0000555555700962 in io_fwrite (str=140737346561120, fptr=0x555555f26c40, nosync=0) at ../../io.c:2044
#5 0x0000555555700ad4 in io_write (io=140737344833152, str=140737346561120, nosync=0) at ../../io.c:2082
#6 0x000055555570145c in io_write_m (argc=1, argv=0x7fffffff9dd0, io=140737344833152) at ../../io.c:2333
#7 0x00005555558eb932 in ractor_safe_call_cfunc_m1 (recv=140737344833152, argc=1, argv=0x7fffffff9dd0, func=0x555555701405 <io_write_m>) at ../../vm_insnhelper.c:3667
#8 0x000055555590acd7 in vm_call0_cfunc_with_frame (ec=0x555555ebff58, calling=0x7fffffff9cb0, argv=0x7fffffff9dd0) at ../../vm_eval.c:164
#9 0x000055555590ae05 in vm_call0_cfunc (ec=0x555555ebff58, calling=0x7fffffff9cb0, argv=0x7fffffff9dd0) at ../../vm_eval.c:178
#10 0x000055555590b0cc in vm_call0_body (ec=0x555555ebff58, calling=0x7fffffff9cb0, argv=0x7fffffff9dd0) at ../../vm_eval.c:229
#11 0x000055555590a8bf in vm_call0_cc (ec=0x555555ebff58, recv=140737344833152, id=9361, argc=1, argv=0x7fffffff9dd0, cc=0x7ffff77cb9c0, kw_splat=0) at ../../vm_eval.c:101
#12 0x000055555590d89a in rb_funcallv_scope (recv=140737344833152, mid=9361, argc=1, argv=0x7fffffff9dd0, scope=CALL_FCALL) at ../../vm_eval.c:1070
#13 0x000055555590d91e in rb_funcallv (recv=140737344833152, mid=9361, argc=1, argv=0x7fffffff9dd0) at ../../vm_eval.c:1086
#14 0x0000555555701491 in rb_io_write (io=140737344833152, str=140737346561120) at ../../io.c:2340
#15 0x000055555570d5f6 in rb_io_print (argc=1, argv=0x7ffff78ff0e0, out=140737344833152) at ../../io.c:8793
#16 0x000055555570d67f in rb_f_print (argc=1, argv=0x7ffff78ff0e0, _=140737344831648) at ../../io.c:8854
#17 0x00005555558eb932 in ractor_safe_call_cfunc_m1 (recv=140737344831648, argc=1, argv=0x7ffff78ff0e0, func=0x55555570d64f <rb_f_print>) at ../../vm_insnhelper.c:3667
#18 0x00005555558ec572 in vm_call_cfunc_with_frame_ (ec=0x555555ebff58, reg_cfp=0x7ffff79fee88, calling=0x7fffffffb070, argc=1, argv=0x7ffff78ff0e0,
stack_bottom=0x7ffff78ff0d8) at ../../vm_insnhelper.c:3858
#19 0x00005555558ec7ec in vm_call_cfunc_with_frame (ec=0x555555ebff58, reg_cfp=0x7ffff79fee88, calling=0x7fffffffb070) at ../../vm_insnhelper.c:3904
--Type <RET> for more, q to quit, c to continue without paging--
#20 0x00005555558fcc43 in vm_sendish (method_explorer=mexp_search_method, block_handler=0, cd=0x555555fa1100, reg_cfp=0x7ffff79fee88, ec=0x555555ebff58)
at ../../vm_insnhelper.c:6172
#21 vm_exec_core (ec=0x555555ebff58) at ../../insns.def:909
#22 0x00005555559182a0 in rb_vm_exec (ec=0x555555ebff58) at ../../vm.c:2858
#23 0x0000555555915469 in invoke_iseq_block_from_c (me=0x0, is_lambda=0, cref=0x0, passed_block_handler=0, kw_splat=0, argv=0x7fffffffb778, argc=1, self=140737344831648,
captured=0x555555fa10d0, ec=0x555555ebff58) at ../../vm.c:1866
#24 invoke_block_from_c_proc (me=0x0, cref=0x0, is_lambda=0, passed_block_handler=0, kw_splat=0, argv=0x7fffffffb778, argc=1, self=140737344831648, proc=0x555555fa10d0,
ec=0x555555ebff58) at ../../vm.c:1968
#25 vm_invoke_proc (ec=0x555555ebff58, proc=0x555555fa10d0, self=140737344831648, argc=1, argv=0x7fffffffb778, kw_splat=0, passed_block_handler=0, cref=0x0)
at ../../vm.c:1999
#26 0x0000555555915bec in rb_vm_invoke_proc (ec=0x555555ebff58, proc=0x555555fa10d0, argc=1, argv=0x7fffffffb778, kw_splat=0, passed_block_handler=0, cref=0x0)
at ../../vm.c:2022
#27 0x000055555590b841 in vm_call0_body (ec=0x555555ebff58, calling=0x7fffffffb4f0, argv=0x7fffffffb778) at ../../vm_eval.c:293
#28 0x000055555590a8bf in vm_call0_cc (ec=0x555555ebff58, recv=140737345533960, id=3489, argc=1, argv=0x7fffffffb778, cc=0x7ffff78c6438, kw_splat=0) at ../../vm_eval.c:101
#29 0x000055555590c543 in rb_call0 (ec=0x555555ebff58, recv=140737345533960, mid=3489, argc=1, argv=0x7fffffffb778, call_scope=CALL_FCALL, self=140737344833152)
at ../../vm_eval.c:577
#30 0x000055555590d24f in rb_call (recv=140737345533960, mid=3489, argc=1, argv=0x7fffffffb778, scope=CALL_FCALL) at ../../vm_eval.c:896
#31 0x000055555590d96b in rb_funcallv_kw (recv=140737345533960, mid=3489, argc=1, argv=0x7fffffffb778, kw_splat=0) at ../../vm_eval.c:1094
#32 0x00005555559106d9 in rb_eval_cmd_call_kw (cmd=140737345533960, argc=1, argv=0x7fffffffb778, kw_splat=0) at ../../vm_eval.c:2196
#33 0x00005555558466ef in signal_exec (cmd=140737345533960, sig=15) at ../../signal.c:1081
#34 0x000055555584688a in rb_signal_exec (th=0x555555ea0780 <_main_thread>, sig=15) at ../../signal.c:1143
--Type <RET> for more, q to quit, c to continue without paging--
#35 0x000055555589d86e in rb_threadptr_execute_interrupts (th=0x555555ea0780 <_main_thread>, blocking_timing=1) at ../../thread.c:2820
#36 0x000055555588e5c7 in vm_check_ints_blocking (ec=0x555555ebff58) at ../../thread.c:228
#37 0x000055555589c8bf in rb_thread_io_blocking_call (io=0x555555f26c40, func=0x5555556ff0db <internal_write_func>, data1=0x7fffffffbac0, events=4) at ../../thread.c:2163
#38 0x00005555556fdf28 in rb_io_blocking_region_wait (io=0x555555f26c40, function=0x5555556ff0db <internal_write_func>, argument=0x7fffffffbac0, events=RUBY_IO_WRITABLE)
at ../../io.c:230
#39 0x00005555556ff54c in rb_io_write_memory (fptr=0x555555f26c40, buf=0x55555606e810, count=2) at ../../io.c:1360
#40 0x000055555570030a in io_binwrite_string_internal (fptr=0x555555f26c40, ptr=0x55555606e810 "1\r", length=2) at ../../io.c:1817
#41 0x0000555555700370 in io_binwrite_string (arg=140737488338256) at ../../io.c:1866
#42 0x00005555556b408c in rb_ec_ensure (ec_arg=0x555555ebff58, b_proc=0x555555700320 <io_binwrite_string>, data1=140737488338256,
e_proc_arg=0x555555896318 <do_mutex_unlock_safe>, data2_arg=140737488338176) at ../../eval.c:1171
#43 0x000055555589676c in rb_mutex_synchronize (self=140737345534480, func=0x555555700320 <io_binwrite_string>, arg=140737488338256) at ../../thread_sync.c:629
#44 0x00005555557005d5 in io_binwrite (ptr=0x55555606e810 "1\r", len=2, fptr=0x555555f26c40, nosync=0) at ../../io.c:1939
#45 0x0000555555700962 in io_fwrite (str=140737346561000, fptr=0x555555f26c40, nosync=0) at ../../io.c:2044
#46 0x0000555555700ad4 in io_write (io=140737344833152, str=140737346561000, nosync=0) at ../../io.c:2082
#47 0x000055555570145c in io_write_m (argc=1, argv=0x7fffffffc260, io=140737344833152) at ../../io.c:2333
#48 0x00005555558eb932 in ractor_safe_call_cfunc_m1 (recv=140737344833152, argc=1, argv=0x7fffffffc260, func=0x555555701405 <io_write_m>) at ../../vm_insnhelper.c:3667
#49 0x000055555590acd7 in vm_call0_cfunc_with_frame (ec=0x555555ebff58, calling=0x7fffffffc140, argv=0x7fffffffc260) at ../../vm_eval.c:164
#50 0x000055555590ae05 in vm_call0_cfunc (ec=0x555555ebff58, calling=0x7fffffffc140, argv=0x7fffffffc260) at ../../vm_eval.c:178
#51 0x000055555590b0cc in vm_call0_body (ec=0x555555ebff58, calling=0x7fffffffc140, argv=0x7fffffffc260) at ../../vm_eval.c:229
#52 0x000055555590a8bf in vm_call0_cc (ec=0x555555ebff58, recv=140737344833152, id=9361, argc=1, argv=0x7fffffffc260, cc=0x7ffff77cb9c0, kw_splat=0) at ../../vm_eval.c:101
#53 0x000055555590d89a in rb_funcallv_scope (recv=140737344833152, mid=9361, argc=1, argv=0x7fffffffc260, scope=CALL_FCALL) at ../../vm_eval.c:1070
--Type <RET> for more, q to quit, c to continue without paging--
#54 0x000055555590d91e in rb_funcallv (recv=140737344833152, mid=9361, argc=1, argv=0x7fffffffc260) at ../../vm_eval.c:1086
#55 0x0000555555701491 in rb_io_write (io=140737344833152, str=140737346561000) at ../../io.c:2340
#56 0x000055555570d5f6 in rb_io_print (argc=1, argv=0x7ffff78ff088, out=140737344833152) at ../../io.c:8793
#57 0x000055555570d67f in rb_f_print (argc=1, argv=0x7ffff78ff088, _=140737344831648) at ../../io.c:8854
#58 0x00005555558eb932 in ractor_safe_call_cfunc_m1 (recv=140737344831648, argc=1, argv=0x7ffff78ff088, func=0x55555570d64f <rb_f_print>) at ../../vm_insnhelper.c:3667
#59 0x00005555558ec572 in vm_call_cfunc_with_frame_ (ec=0x555555ebff58, reg_cfp=0x7ffff79fef30, calling=0x7fffffffd500, argc=1, argv=0x7ffff78ff088,
stack_bottom=0x7ffff78ff080) at ../../vm_insnhelper.c:3858
#60 0x00005555558ec7ec in vm_call_cfunc_with_frame (ec=0x555555ebff58, reg_cfp=0x7ffff79fef30, calling=0x7fffffffd500) at ../../vm_insnhelper.c:3904
#61 0x00005555558fcc43 in vm_sendish (method_explorer=mexp_search_method, block_handler=0, cd=0x555555f83a30, reg_cfp=0x7ffff79fef30, ec=0x555555ebff58)
at ../../vm_insnhelper.c:6172
#62 vm_exec_core (ec=0x555555ebff58) at ../../insns.def:909
#63 0x00005555559182a0 in rb_vm_exec (ec=0x555555ebff58) at ../../vm.c:2858
#64 0x00005555559193d7 in rb_iseq_eval_main (iseq=0x7ffff77cb538) at ../../vm.c:3205
#65 0x00005555556b2004 in rb_ec_exec_node (ec=0x555555ebff58, n=0x7ffff77cb538) at ../../eval.c:295
#66 0x00005555556b217b in ruby_run_node (n=0x7ffff77cb538) at ../../eval.c:333
#67 0x00005555555c37be in rb_main (argc=3, argv=0x7fffffffd8e8) at ../../main.c:42
#68 0x00005555555c381f in main (argc=3, argv=0x7fffffffd8e8) at ../../main.c:62
(gdb) c
Continuing.
-e:1:in 'IO#write': deadlock; recursive locking (ThreadError)
from -e:1:in 'Kernel#print'
from -e:1:in 'block in <main>'
from -e:1:in 'IO#write'
from -e:1:in 'Kernel#print'
from -e:1:in 'block in <main>'
from -e:1:in 'Kernel#loop'
from -e:1:in '<main>'
[Thread 0x7fffde5ff6c0 (LWP 71356) exited]
[Inferior 1 (process 71325) exited with code 01]
(gdb)
    (1-1/1)