https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112020-04-11T00:51:17ZRuby Issue Tracking SystemRuby master - Bug #16771: Segmentation fault when inspecting a bound methodhttps://redmine.ruby-lang.org/issues/16771?journal_id=850412020-04-11T00:51:17Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>I can reproduce this in 2.7.1, but not on master. Here's debugging information:</p>
<pre><code>(gdb) bt
#0 0x00000bbf2523f290 in rb_funcallv_with_cc (cd=0xbbf25296430 <rb_inspect.rb_funcallv_data>, recv=12912719941280, mid=2753, argc=0, argv=0x0) at ./vm_eval.c:1012
#1 0x00000bbf2512f8cf in rb_inspect (obj=12912719941288) at object.c:680
#2 0x00000bbf251678cb in method_inspect (method=12913381588560) at proc.c:2854
#3 0x00000bbf2525014f in vm_call_cfunc_with_frame (ec=<optimized out>, reg_cfp=<optimized out>, calling=<optimized out>, cd=<optimized out>, empty_kw_splat=<optimized out>) at ./vm_insnhelper.c:2514
#4 vm_call_cfunc (ec=0xbbf3908ba50, reg_cfp=0xbbea2dd7f20, calling=<optimized out>, cd=<optimized out>) at ./vm_insnhelper.c:2539
#5 0x00000bbf2523ae24 in vm_sendish (ec=<optimized out>, reg_cfp=<optimized out>, cd=0xbbe82436780, block_handler=0, method_explorer=<optimized out>) at ./vm_insnhelper.c:4023
#6 vm_exec_core (ec=<optimized out>, initial=<optimized out>) at insns.def:801
#7 0x00000bbf2524c06a in rb_vm_exec (ec=<optimized out>, mjit_enable_p=<optimized out>) at vm.c:2139
#8 0x00000bbf25244327 in vm_yield (ec=0xbbf25296430 <rb_inspect.rb_funcallv_data>, argc=1, argv=<optimized out>, kw_splat=0) at vm.c:1179
#9 rb_yield_0 (argc=1, argv=<optimized out>) at ./vm_eval.c:1227
#10 rb_yield_1 (val=<optimized out>) at ./vm_eval.c:1233
#11 0x00000bbf25129918 in int_dotimes (num=200001) at numeric.c:5201
#12 0x00000bbf2525014f in vm_call_cfunc_with_frame (ec=<optimized out>, reg_cfp=<optimized out>, calling=<optimized out>, cd=<optimized out>, empty_kw_splat=<optimized out>) at ./vm_insnhelper.c:2514
#13 vm_call_cfunc (ec=0xbbf3908ba50, reg_cfp=0xbbea2dd7f90, calling=<optimized out>, cd=<optimized out>) at ./vm_insnhelper.c:2539
#14 0x00000bbf2523471b in vm_sendish (ec=<optimized out>, reg_cfp=<optimized out>, cd=0xbbf4722cef0, block_handler=<optimized out>, method_explorer=<optimized out>) at ./vm_insnhelper.c:4023
#15 vm_exec_core (ec=0xbbf3908ba50, initial=<optimized out>) at insns.def:782
#16 0x00000bbf2524c06a in rb_vm_exec (ec=<optimized out>, mjit_enable_p=<optimized out>) at vm.c:2139
#17 0x00000bbf250a094b in rb_ec_exec_node (ec=<optimized out>, n=<optimized out>) at eval.c:278
#18 ruby_run_node (n=<optimized out>) at eval.c:336
#19 0x00000bbc64c0139c in main (argc=<optimized out>, argv=<optimized out>) at ./main.c:50
(gdb) print *cd
$1 = {cc = {method_state = 140, class_serial = {6, 0, 0}, me = 0xbbea185bdb0, method_serial = 42, call = 0xbbf252339a0 <vm_call_general>, aux = {index = 0, method_missing_reason = MISSING_NOENTRY}}, ci = {mid = 2753, flag = 0, orig_argc = 0}}
(gdb) print *(cd->cc->me)
$2 = {flags = 9535493, defined_class = 12914954958280, def = 0x646f6874654d, called_id = 0, owner = 0}
(gdb) print *(cd->cc->me->def)
Cannot access memory at address 0x646f6874654d
</code></pre> Ruby master - Bug #16771: Segmentation fault when inspecting a bound methodhttps://redmine.ruby-lang.org/issues/16771?journal_id=850872020-04-13T02:18:42Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN</i> to <i>2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: REQUIRED</i></li></ul> Ruby master - Bug #16771: Segmentation fault when inspecting a bound methodhttps://redmine.ruby-lang.org/issues/16771?journal_id=858202020-05-26T20:18:49Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul> Ruby master - Bug #16771: Segmentation fault when inspecting a bound methodhttps://redmine.ruby-lang.org/issues/16771?journal_id=862612020-06-19T12:38:05Zdecuplet (Nikita Shilnikov)fg@flashgordon.ru
<ul></ul><p><a class="user active user-mention" href="https://redmine.ruby-lang.org/users/1604">@jeremyevans0 (Jeremy Evans)</a> was this fixed? I can't find any references to this issue from the repo, perhaps I'm missing something.</p> Ruby master - Bug #16771: Segmentation fault when inspecting a bound methodhttps://redmine.ruby-lang.org/issues/16771?journal_id=862622020-06-19T14:04:55Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>decuplet (Nikita Shilnikov) wrote in <a href="#note-4">#note-4</a>:</p>
<blockquote>
<p><a class="user active user-mention" href="https://redmine.ruby-lang.org/users/1604">@jeremyevans0 (Jeremy Evans)</a> was this fixed? I can't find any references to this issue from the repo, perhaps I'm missing something.</p>
</blockquote>
<p>It's fixed in master, so the issue is closed, but the flag to backport to 2.7 is set to required. This is our standard way to mark issues for backporting. I'll see if I can bisect to find the commit that fixes this.</p> Ruby master - Bug #16771: Segmentation fault when inspecting a bound methodhttps://redmine.ruby-lang.org/issues/16771?journal_id=862652020-06-19T16:00:09Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p><a class="user active user-mention" href="https://redmine.ruby-lang.org/users/404">@nagachika (Tomoyuki Chikanaga)</a> I bisected this to <a class="changeset" title="Don't display singleton class in Method#inspect unless method defined there Previously, if an ob..." href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/0d24fb774d84d4a99454ce10fd343da00049a588">0d24fb774d84d4a99454ce10fd343da00049a588</a>. As the inspect output is not of critical importance, I recommend reverting the commit in 2.7.</p> Ruby master - Bug #16771: Segmentation fault when inspecting a bound methodhttps://redmine.ruby-lang.org/issues/16771?journal_id=874762020-09-05T10:26:11Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: REQUIRED</i> to <i>2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: DONE</i></li></ul><p>ruby_2_7 2c9dd060ab487a96e391793bd782cef6fd471b83.</p> Ruby master - Bug #16771: Segmentation fault when inspecting a bound methodhttps://redmine.ruby-lang.org/issues/16771?journal_id=874772020-09-05T10:28:20Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul></ul><p>Thank you jeremy for your investigation.<br>
I reverted the commit at 2c9dd060ab487a96e391793bd782cef6fd471b83 according to your recommendation. thanks!</p>