mrkn / pycall.rb

Calling Python functions from the Ruby language
MIT License
1.05k stars 72 forks source link

SEGV occurs in the finalizer #177

Closed mrkn closed 3 months ago

mrkn commented 3 months ago
2024-05-20T13:55:29.2407636Z ===============================================================================
2024-05-20T13:55:29.2408817Z Finished in 61.439859728 seconds.
2024-05-20T13:55:29.3245093Z test/run.rb: [BUG] Segmentation fault at 0x0000555b5796f670
2024-05-20T13:55:29.3246634Z ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux]
2024-05-20T13:55:29.3248548Z 
2024-05-20T13:55:29.3249260Z -- Control frame information -----------------------------------------------
2024-05-20T13:55:29.3252044Z c:0001 p:0000 s:0003 E:000940 DUMMY  [FINISH]
2024-05-20T13:55:29.3257472Z 
2024-05-20T13:55:29.3257742Z 
2024-05-20T13:55:29.3259426Z -- Threading information ---------------------------------------------------
2024-05-20T13:55:29.3260511Z Total ractor count: 1
2024-05-20T13:55:29.3261162Z Ruby thread count for this ractor: 1
2024-05-20T13:55:29.3263940Z 
2024-05-20T13:55:29.3264957Z -- Machine register context ------------------------------------------------
2024-05-20T13:55:29.3266178Z  RIP: 0x00007f4e9da7aa5c RBP: 0x0000555a420d2e90 RSP: 0x00007ffe355eb370
2024-05-20T13:55:29.3267428Z  RAX: 0x0000000000000000 RBX: 0x0003f59622c17d7c RCX: 0x000000000000001f
2024-05-20T13:55:29.3268497Z  RDX: 0x00000000000000a9 RDI: 0x00007f4e69e615f0 RSI: 0x0000555a418b0a90
2024-05-20T13:55:29.3269527Z   R8: 0x00007f4e69e615f0  R9: 0x0000000000000000 R10: 0x000000000000000c
2024-05-20T13:55:29.3270643Z  R11: 0x00000000000000e1 R12: 0x0000000022c17d7c R13: 0x0003f59622c17d7c
2024-05-20T13:55:29.3271692Z  R14: 0xffffffffffffffff R15: 0x0000555a44e36520 EFL: 0x0000000000010202
2024-05-20T13:55:29.3272361Z 
2024-05-20T13:55:29.3272937Z -- C level backtrace information -------------------------------------------
2024-05-20T13:55:30.2671676Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(rb_print_backtrace+0x14) [0x7f4e9db25971] /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/vm_dump.c:820
2024-05-20T13:55:30.2673741Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(rb_vm_bugreport) /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/vm_dump.c:1151
2024-05-20T13:55:30.2675346Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(rb_bug_for_fatal_signal+0x104) [0x7f4e9d91ca04] /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/error.c:1065
2024-05-20T13:55:30.2677017Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(sigsegv+0x4d) [0x7f4e9da70f4d] /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/signal.c:926
2024-05-20T13:55:30.2678118Z /lib/x86_64-linux-gnu/libc.so.6(0x7f4e9d442520) [0x7f4e9d442520]
2024-05-20T13:55:30.2679248Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(get_bin+0x5) [0x7f4e9da7aa5c] /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/st.c:361
2024-05-20T13:55:30.2681124Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(get_bin) /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/st.c:356
2024-05-20T13:55:30.2682491Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(find_table_bin_ind) /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/st.c:915
2024-05-20T13:55:30.2683987Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(st_general_delete+0x34) [0x7f4e9da7c20f] /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/st.c:1333
2024-05-20T13:55:30.2685525Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(rb_st_delete) /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/st.c:1355
2024-05-20T13:55:30.2687362Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/pycall-1.5.1/lib/pycall.so(pycall_gcguard_delete+0x92) [0x7f4e7fb6f702] /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/pycall-1.5.1/ext/pycall/gc.c:68
2024-05-20T13:55:30.2689094Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/gems/3.3.0/gems/pycall-1.5.1/lib/pycall.so(pycall_gcguard_delete) (null):0
2024-05-20T13:55:30.2739394Z /opt/hostedtoolcache/Python/3.12.3/x64/lib/libpython3.12.so.1.0(_PyObject_FreeInstanceAttributes+0x15d) [0x7f4e7f63408d] ./Include/object.h:705
2024-05-20T13:55:30.2741939Z /opt/hostedtoolcache/Python/3.12.3/x64/lib/libpython3.12.so.1.0(subtype_dealloc+0x14b) [0x7f4e7f643dbb] Objects/typeobject.c:2017
2024-05-20T13:55:30.2745192Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(RTYPEDDATA_TYPE+0x0) [0x7f4e9d93fcd1] /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/gc.c:3500
2024-05-20T13:55:30.2748245Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(rb_data_free) /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/gc.c:3501
2024-05-20T13:55:30.2750920Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(obj_free) /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/gc.c:3659
2024-05-20T13:55:30.2753518Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(rb_objspace_call_finalizer+0x35b) [0x7f4e9d94383b] /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/gc.c:4704
2024-05-20T13:55:30.2766518Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(rb_ec_finalize+0x2a) [0x7f4e9d92803a] /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/eval.c:168
2024-05-20T13:55:30.2770875Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(rb_ec_cleanup) /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/eval.c:260
2024-05-20T13:55:30.2774144Z /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/libruby.so.3.3(ruby_run_node+0x9d) [0x7f4e9d92836d] /tmp/ruby-build.20240423130154.2039.IZzInp/ruby-3.3.1/eval.c:328
2024-05-20T13:55:30.2777120Z /opt/hostedtoolcache/Ruby/3.3.1/x64/bin/ruby(rb_main+0x21) [0x555a3ed44187] ./main.c:39
2024-05-20T13:55:30.2778727Z /opt/hostedtoolcache/Ruby/3.3.1/x64/bin/ruby(main) ./main.c:58
2024-05-20T13:55:30.2779961Z /lib/x86_64-linux-gnu/libc.so.6(0x7f4e9d429d90) [0x7f4e9d429d90]
2024-05-20T13:55:30.2782878Z /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f4e9d429e40]
2024-05-20T13:55:30.2784944Z [0x555a3ed441d5]
2024-05-20T13:55:30.2786163Z 

The full log is available at https://gist.github.com/mrkn/d04b1677ebf86e41100a2b6d13a94542.