|
$ ./ruby -v
|
|
ruby 2.6.0dev (2018-06-15 trunk 63671) [x86_64-linux]
|
|
|
|
$ gdb -q --args ./ruby readpartial_and_eof_test.rb
|
|
Reading symbols from ./ruby...done.
|
|
(gdb) break rb_eof_error
|
|
Breakpoint 1 at 0x4f5fa: file io.c, line 625.
|
|
(gdb) run
|
|
Starting program: /home/hirura/ruby_debaggable/ruby/ruby readpartial_and_eof_test.rb
|
|
[Thread debugging using libthread_db enabled]
|
|
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
|
|
[New Thread 0x7ffff7ff6700 (LWP 17668)]
|
|
[New Thread 0x7ffff65c4700 (LWP 17669)]
|
|
[New Thread 0x7ffff64c3700 (LWP 17670)]
|
|
[New Thread 0x7ffff62c1700 (LWP 17671)]
|
|
[Switching to Thread 0x7ffff64c3700 (LWP 17670)]
|
|
|
|
Thread 4 "readpartial_an*" hit Breakpoint 1, rb_eof_error () at io.c:625
|
|
625 rb_raise(rb_eEOFError, "end of file reached");
|
|
(gdb) info threads
|
|
Id Target Id Frame
|
|
1 Thread 0x7ffff7fdd700 (LWP 17664) "ruby" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
|
|
2 Thread 0x7ffff7ff6700 (LWP 17668) "ruby-timer-thr" 0x00007ffff71a674d in poll () at ../sysdeps/unix/syscall-template.S:84
|
|
3 Thread 0x7ffff65c4700 (LWP 17669) "readpartial_an*" pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
|
|
* 4 Thread 0x7ffff64c3700 (LWP 17670) "readpartial_an*" rb_eof_error () at io.c:625
|
|
5 Thread 0x7ffff62c1700 (LWP 17671) "readpartial_an*" pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
|
|
(gdb) t 1
|
|
[Switching to thread 1 (Thread 0x7ffff7fdd700 (LWP 17664))]
|
|
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
|
|
185 ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: No such file or directory.
|
|
(gdb) bt
|
|
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
|
|
#1 0x00005555556c1d59 in rb_native_cond_wait (cond=0x555555ac9490, mutex=0x555555ac94f0) at thread_pthread.c:318
|
|
#2 0x00005555556c2907 in native_sleep (th=0x555555ac9420, timeout_rel=0x0) at thread_pthread.c:1071
|
|
#3 0x00005555556c6f9a in thread_join_sleep (arg=140737488343744) at thread.c:932
|
|
#4 0x000055555557c126 in rb_ensure (b_proc=0x5555556c6ee6 <thread_join_sleep>, data1=140737488343744, e_proc=0x5555556c6e61 <remove_from_join_list>, data2=140737488343744) at eval.c:1052
|
|
#5 0x00005555556c70ff in thread_join (target_th=0x555555e3abd0, ts=0x0) at thread.c:977
|
|
#6 0x00005555556c72a5 in thread_join_m (argc=0, argv=0x7ffff7edb078, self=93824999363840) at thread.c:1079
|
|
#7 0x00005555556fbad2 in call_cfunc_m1 (func=0x5555556c71e3 <thread_join_m>, recv=93824999363840, argc=0, argv=0x7ffff7edb078) at vm_insnhelper.c:1734
|
|
#8 0x00005555556fc5da in vm_call_cfunc_with_frame (ec=0x555555ac98c8, reg_cfp=0x7ffff7fdafa0, calling=0x7fffffffdf80, ci=0x555555e39390, cc=0x555555e6a790) at vm_insnhelper.c:1929
|
|
#9 0x00005555556fc724 in vm_call_cfunc (ec=0x555555ac98c8, reg_cfp=0x7ffff7fdafa0, calling=0x7fffffffdf80, ci=0x555555e39390, cc=0x555555e6a790) at vm_insnhelper.c:1945
|
|
#10 0x00005555556fd9f0 in vm_call_method_each_type (ec=0x555555ac98c8, cfp=0x7ffff7fdafa0, calling=0x7fffffffdf80, ci=0x555555e39390, cc=0x555555e6a790) at vm_insnhelper.c:2267
|
|
#11 0x00005555556fe0b3 in vm_call_method (ec=0x555555ac98c8, cfp=0x7ffff7fdafa0, calling=0x7fffffffdf80, ci=0x555555e39390, cc=0x555555e6a790) at vm_insnhelper.c:2393
|
|
#12 0x00005555556fe289 in vm_call_general (ec=0x555555ac98c8, reg_cfp=0x7ffff7fdafa0, calling=0x7fffffffdf80, ci=0x555555e39390, cc=0x555555e6a790) at vm_insnhelper.c:2436
|
|
#13 0x0000555555704c5a in vm_exec_core (ec=0x555555ac98c8, initial=0) at /home/hirura/ruby_debaggable/ruby/insns.def:790
|
|
#14 0x000055555571449b in vm_exec (ec=0x555555ac98c8, mjit_enable_p=1) at vm.c:1807
|
|
#15 0x0000555555715052 in rb_iseq_eval_main (iseq=0x555555defb20) at vm.c:2066
|
|
#16 0x000055555557a813 in ruby_exec_internal (n=0x555555defb20) at eval.c:261
|
|
#17 0x000055555557a939 in ruby_exec_node (n=0x555555defb20) at eval.c:325
|
|
#18 0x000055555557a90c in ruby_run_node (n=0x555555defb20) at eval.c:317
|
|
#19 0x0000555555577871 in main (argc=2, argv=0x7fffffffe468) at ./main.c:42
|
|
(gdb) t 2
|
|
[Switching to thread 2 (Thread 0x7ffff7ff6700 (LWP 17668))]
|
|
#0 0x00007ffff71a674d in poll () at ../sysdeps/unix/syscall-template.S:84
|
|
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
|
|
(gdb) bt
|
|
#0 0x00007ffff71a674d in poll () at ../sysdeps/unix/syscall-template.S:84
|
|
#1 0x00005555556c2f9e in timer_thread_sleep (gvl=0x555555ac8f28) at thread_pthread.c:1385
|
|
#2 0x00005555556c328a in thread_timer (p=0x555555ac8f28) at thread_pthread.c:1508
|
|
#3 0x00007ffff7bc16ba in start_thread (arg=0x7ffff7ff6700) at pthread_create.c:333
|
|
#4 0x00007ffff71b241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
|
|
(gdb) t 3
|
|
[Switching to thread 3 (Thread 0x7ffff65c4700 (LWP 17669))]
|
|
#0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
|
|
225 ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: No such file or directory.
|
|
(gdb) bt
|
|
#0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
|
|
#1 0x00005555556c1da1 in native_cond_timedwait (cond=0x555555e67ec0, mutex=0x555555e67f20, ts=0x7ffff65c19f0) at thread_pthread.c:336
|
|
#2 0x00005555556c2920 in native_sleep (th=0x555555e67e50, timeout_rel=0x7ffff65c1a10) at thread_pthread.c:1073
|
|
#3 0x00005555556c7787 in sleep_timespec (th=0x555555e67e50, ts=..., fl=2) at thread.c:1257
|
|
#4 0x00005555556c7870 in rb_thread_wait_for (time=...) at thread.c:1295
|
|
#5 0x000055555563ddbb in rb_f_sleep (argc=1, argv=0x7ffff65c5080) at process.c:4457
|
|
#6 0x00005555556fbad2 in call_cfunc_m1 (func=0x55555563dd59 <rb_f_sleep>, recv=93824998335080, argc=1, argv=0x7ffff65c5080) at vm_insnhelper.c:1734
|
|
#7 0x00005555556fc5da in vm_call_cfunc_with_frame (ec=0x555555eb2f48, reg_cfp=0x7ffff66c4f30, calling=0x7ffff65c2720, ci=0x555555d4a130, cc=0x555555ba9840) at vm_insnhelper.c:1929
|
|
#8 0x00005555556fc724 in vm_call_cfunc (ec=0x555555eb2f48, reg_cfp=0x7ffff66c4f30, calling=0x7ffff65c2720, ci=0x555555d4a130, cc=0x555555ba9840) at vm_insnhelper.c:1945
|
|
#9 0x00005555556fd9f0 in vm_call_method_each_type (ec=0x555555eb2f48, cfp=0x7ffff66c4f30, calling=0x7ffff65c2720, ci=0x555555d4a130, cc=0x555555ba9840) at vm_insnhelper.c:2267
|
|
#10 0x00005555556fe13b in vm_call_method (ec=0x555555eb2f48, cfp=0x7ffff66c4f30, calling=0x7ffff65c2720, ci=0x555555d4a130, cc=0x555555ba9840) at vm_insnhelper.c:2404
|
|
#11 0x00005555556fe289 in vm_call_general (ec=0x555555eb2f48, reg_cfp=0x7ffff66c4f30, calling=0x7ffff65c2720, ci=0x555555d4a130, cc=0x555555ba9840) at vm_insnhelper.c:2436
|
|
#12 0x0000555555704c5a in vm_exec_core (ec=0x555555eb2f48, initial=0) at /home/hirura/ruby_debaggable/ruby/insns.def:790
|
|
#13 0x000055555571449b in vm_exec (ec=0x555555eb2f48, mjit_enable_p=1) at vm.c:1807
|
|
#14 0x00005555557121e1 in invoke_block (ec=0x555555eb2f48, iseq=0x555555def800, self=93824998335080, captured=0x7ffff66c4fb8, cref=0x0, type=572653569, opt_pc=0) at vm.c:1004
|
|
#15 0x000055555571254d in invoke_iseq_block_from_c (ec=0x555555eb2f48, captured=0x7ffff66c4fb8, self=93824998335080, argc=0, argv=0x0, passed_block_handler=0, cref=0x0, is_lambda=0) at vm.c:1056
|
|
#16 0x000055555571260b in invoke_block_from_c_bh (ec=0x555555eb2f48, block_handler=140737327681465, argc=0, argv=0x0, passed_block_handler=0, cref=0x0, is_lambda=0, force_blockarg=0) at vm.c:1074
|
|
#17 0x00005555557127b7 in vm_yield (ec=0x555555eb2f48, argc=0, argv=0x0) at vm.c:1119
|
|
#18 0x000055555570e527 in rb_yield_0 (argc=0, argv=0x0) at vm_eval.c:972
|
|
#19 0x000055555570e85b in loop_i () at vm_eval.c:1051
|
|
#20 0x000055555557bb78 in rb_rescue2 (b_proc=0x55555570e848 <loop_i>, data1=0, r_proc=0x55555570e85d <loop_stop>, data2=0) at eval.c:911
|
|
#21 0x000055555570e929 in rb_f_loop (self=93824998335080) at vm_eval.c:1102
|
|
#22 0x00005555556fbafd in call_cfunc_0 (func=0x55555570e8b3 <rb_f_loop>, recv=93824998335080, argc=0, argv=0x7ffff65c5048) at vm_insnhelper.c:1740
|
|
#23 0x00005555556fc5da in vm_call_cfunc_with_frame (ec=0x555555eb2f48, reg_cfp=0x7ffff66c4fa0, calling=0x7ffff65c3970, ci=0x555555e515a0, cc=0x555555c40750) at vm_insnhelper.c:1929
|
|
#24 0x00005555556fc724 in vm_call_cfunc (ec=0x555555eb2f48, reg_cfp=0x7ffff66c4fa0, calling=0x7ffff65c3970, ci=0x555555e515a0, cc=0x555555c40750) at vm_insnhelper.c:1945
|
|
#25 0x00005555556fd9f0 in vm_call_method_each_type (ec=0x555555eb2f48, cfp=0x7ffff66c4fa0, calling=0x7ffff65c3970, ci=0x555555e515a0, cc=0x555555c40750) at vm_insnhelper.c:2267
|
|
#26 0x00005555556fe13b in vm_call_method (ec=0x555555eb2f48, cfp=0x7ffff66c4fa0, calling=0x7ffff65c3970, ci=0x555555e515a0, cc=0x555555c40750) at vm_insnhelper.c:2404
|
|
#27 0x00005555556fe289 in vm_call_general (ec=0x555555eb2f48, reg_cfp=0x7ffff66c4fa0, calling=0x7ffff65c3970, ci=0x555555e515a0, cc=0x555555c40750) at vm_insnhelper.c:2436
|
|
#28 0x0000555555704779 in vm_exec_core (ec=0x555555eb2f48, initial=0) at /home/hirura/ruby_debaggable/ruby/insns.def:727
|
|
#29 0x000055555571449b in vm_exec (ec=0x555555eb2f48, mjit_enable_p=1) at vm.c:1807
|
|
#30 0x00005555557121e1 in invoke_block (ec=0x555555eb2f48, iseq=0x555555def918, self=93824998335080, captured=0x555555b2d260, cref=0x0, type=572653569, opt_pc=0) at vm.c:1004
|
|
#31 0x000055555571254d in invoke_iseq_block_from_c (ec=0x555555eb2f48, captured=0x555555b2d260, self=93824998335080, argc=0, argv=0x555555c217b8, passed_block_handler=0, cref=0x0, is_lambda=0) at vm.c:1056
|
|
#32 0x00005555557128c9 in invoke_block_from_c_proc (ec=0x555555eb2f48, proc=0x555555b2d260, self=93824998335080, argc=0, argv=0x555555c217b8, passed_block_handler=0, is_lambda=0) at vm.c:1149
|
|
#33 0x0000555555712998 in vm_invoke_proc (ec=0x555555eb2f48, proc=0x555555b2d260, self=93824998335080, argc=0, argv=0x555555c217b8, passed_block_handler=0) at vm.c:1167
|
|
#34 0x0000555555712a80 in rb_vm_invoke_proc (ec=0x555555eb2f48, proc=0x555555b2d260, argc=0, argv=0x555555c217b8, passed_block_handler=0) at vm.c:1188
|
|
#35 0x00005555556c6453 in thread_do_start (th=0x555555e67e50, args=93824999364520) at thread.c:645
|
|
#36 0x00005555556c66db in thread_start_func_2 (th=0x555555e67e50, stack_start=0x7ffff65c3f00) at thread.c:684
|
|
#37 0x00005555556c2416 in thread_start_func_1 (th_ptr=0x555555e67e50) at thread_pthread.c:839
|
|
#38 0x00007ffff7bc16ba in start_thread (arg=0x7ffff65c4700) at pthread_create.c:333
|
|
#39 0x00007ffff71b241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
|
|
(gdb) t 4
|
|
[Switching to thread 4 (Thread 0x7ffff64c3700 (LWP 17670))]
|
|
#0 rb_eof_error () at io.c:625
|
|
625 rb_raise(rb_eEOFError, "end of file reached");
|
|
(gdb) bt
|
|
#0 rb_eof_error () at io.c:625
|
|
#1 0x00005555555a77c5 in io_readpartial (argc=1, argv=0x7fffee3c3090, io=93824999365160) at io.c:2869
|
|
#2 0x00005555556fbad2 in call_cfunc_m1 (func=0x5555555a7785 <io_readpartial>, recv=93824999365160, argc=1, argv=0x7fffee3c3090) at vm_insnhelper.c:1734
|
|
#3 0x00005555556fc5da in vm_call_cfunc_with_frame (ec=0x555555eab028, reg_cfp=0x7fffee4c2f30, calling=0x7ffff64c1720, ci=0x555555e42030, cc=0x555555e1a458) at vm_insnhelper.c:1929
|
|
#4 0x00005555556fc724 in vm_call_cfunc (ec=0x555555eab028, reg_cfp=0x7fffee4c2f30, calling=0x7ffff64c1720, ci=0x555555e42030, cc=0x555555e1a458) at vm_insnhelper.c:1945
|
|
#5 0x0000555555704c5a in vm_exec_core (ec=0x555555eab028, initial=0) at /home/hirura/ruby_debaggable/ruby/insns.def:790
|
|
#6 0x000055555571449b in vm_exec (ec=0x555555eab028, mjit_enable_p=1) at vm.c:1807
|
|
#7 0x00005555557121e1 in invoke_block (ec=0x555555eab028, iseq=0x555555def440, self=93824998335080, captured=0x7fffee4c2fb8, cref=0x0, type=572653569, opt_pc=0) at vm.c:1004
|
|
#8 0x000055555571254d in invoke_iseq_block_from_c (ec=0x555555eab028, captured=0x7fffee4c2fb8, self=93824998335080, argc=0, argv=0x0, passed_block_handler=0, cref=0x0, is_lambda=0) at vm.c:1056
|
|
#9 0x000055555571260b in invoke_block_from_c_bh (ec=0x555555eab028, block_handler=140737191358393, argc=0, argv=0x0, passed_block_handler=0, cref=0x0, is_lambda=0, force_blockarg=0) at vm.c:1074
|
|
#10 0x00005555557127b7 in vm_yield (ec=0x555555eab028, argc=0, argv=0x0) at vm.c:1119
|
|
#11 0x000055555570e527 in rb_yield_0 (argc=0, argv=0x0) at vm_eval.c:972
|
|
#12 0x000055555570e85b in loop_i () at vm_eval.c:1051
|
|
#13 0x000055555557bb78 in rb_rescue2 (b_proc=0x55555570e848 <loop_i>, data1=0, r_proc=0x55555570e85d <loop_stop>, data2=0) at eval.c:911
|
|
#14 0x000055555570e929 in rb_f_loop (self=93824998335080) at vm_eval.c:1102
|
|
#15 0x00005555556fbafd in call_cfunc_0 (func=0x55555570e8b3 <rb_f_loop>, recv=93824998335080, argc=0, argv=0x7fffee3c3048) at vm_insnhelper.c:1740
|
|
#16 0x00005555556fc5da in vm_call_cfunc_with_frame (ec=0x555555eab028, reg_cfp=0x7fffee4c2fa0, calling=0x7ffff64c2970, ci=0x555555cdab60, cc=0x555555e630f0) at vm_insnhelper.c:1929
|
|
#17 0x00005555556fc724 in vm_call_cfunc (ec=0x555555eab028, reg_cfp=0x7fffee4c2fa0, calling=0x7ffff64c2970, ci=0x555555cdab60, cc=0x555555e630f0) at vm_insnhelper.c:1945
|
|
#18 0x00005555556fd9f0 in vm_call_method_each_type (ec=0x555555eab028, cfp=0x7fffee4c2fa0, calling=0x7ffff64c2970, ci=0x555555cdab60, cc=0x555555e630f0) at vm_insnhelper.c:2267
|
|
#19 0x00005555556fe13b in vm_call_method (ec=0x555555eab028, cfp=0x7fffee4c2fa0, calling=0x7ffff64c2970, ci=0x555555cdab60, cc=0x555555e630f0) at vm_insnhelper.c:2404
|
|
#20 0x00005555556fe289 in vm_call_general (ec=0x555555eab028, reg_cfp=0x7fffee4c2fa0, calling=0x7ffff64c2970, ci=0x555555cdab60, cc=0x555555e630f0) at vm_insnhelper.c:2436
|
|
#21 0x0000555555704779 in vm_exec_core (ec=0x555555eab028, initial=0) at /home/hirura/ruby_debaggable/ruby/insns.def:727
|
|
#22 0x000055555571449b in vm_exec (ec=0x555555eab028, mjit_enable_p=1) at vm.c:1807
|
|
#23 0x00005555557121e1 in invoke_block (ec=0x555555eab028, iseq=0x555555def558, self=93824998335080, captured=0x555555e6aa50, cref=0x0, type=572653569, opt_pc=0) at vm.c:1004
|
|
#24 0x000055555571254d in invoke_iseq_block_from_c (ec=0x555555eab028, captured=0x555555e6aa50, self=93824998335080, argc=0, argv=0x555555c21380, passed_block_handler=0, cref=0x0, is_lambda=0) at vm.c:1056
|
|
#25 0x00005555557128c9 in invoke_block_from_c_proc (ec=0x555555eab028, proc=0x555555e6aa50, self=93824998335080, argc=0, argv=0x555555c21380, passed_block_handler=0, is_lambda=0) at vm.c:1149
|
|
#26 0x0000555555712998 in vm_invoke_proc (ec=0x555555eab028, proc=0x555555e6aa50, self=93824998335080, argc=0, argv=0x555555c21380, passed_block_handler=0) at vm.c:1167
|
|
#27 0x0000555555712a80 in rb_vm_invoke_proc (ec=0x555555eab028, proc=0x555555e6aa50, argc=0, argv=0x555555c21380, passed_block_handler=0) at vm.c:1188
|
|
#28 0x00005555556c6453 in thread_do_start (th=0x555555e3abd0, args=93824999363440) at thread.c:645
|
|
#29 0x00005555556c66db in thread_start_func_2 (th=0x555555e3abd0, stack_start=0x7ffff64c2f00) at thread.c:684
|
|
#30 0x00005555556c2416 in thread_start_func_1 (th_ptr=0x555555e3abd0) at thread_pthread.c:839
|
|
#31 0x00007ffff7bc16ba in start_thread (arg=0x7ffff64c3700) at pthread_create.c:333
|
|
#32 0x00007ffff71b241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
|
|
(gdb) t 5
|
|
[Switching to thread 5 (Thread 0x7ffff62c1700 (LWP 17671))]
|
|
#0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
|
|
225 ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: No such file or directory.
|
|
(gdb) bt
|
|
#0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
|
|
#1 0x00005555556c1da1 in native_cond_timedwait (cond=0x7ffff62c0ec0, mutex=0x555555ab6b60 <thread_cache_lock>, ts=0x7ffff62c0eb0) at thread_pthread.c:336
|
|
#2 0x00005555556c24fe in register_cached_thread_and_wait () at thread_pthread.c:900
|
|
#3 0x00005555556c241b in thread_start_func_1 (th_ptr=0x555555e4be20) at thread_pthread.c:847
|
|
#4 0x00007ffff7bc16ba in start_thread (arg=0x7ffff62c1700) at pthread_create.c:333
|
|
#5 0x00007ffff71b241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
|
|
(gdb)
|