From: jean.boussier@... Date: 2020-03-09T12:58:20+00:00 Subject: [ruby-core:97419] [Ruby master Bug#16682] Ruby 2.7.0p0 crash on exit if there is an active RUBY_INTERNAL_EVENT_GC_EXIT tracepoint Issue #16682 has been updated by byroot (Jean Boussier). > fails the type check, exception is raised, which allocs a String for the message. Yep, the `allocation during garbage collection phase` is merely a fallout following a previous issue. So I patched my ruby a bit further to get the actual class name: ``` diff --git a/error.c b/error.c index b9ec8427e652..5cb57057bced 100644 --- a/error.c +++ b/error.c @@ -910,9 +910,13 @@ rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type) wrong_type: etype = builtin_class_name(obj); if (!etype) + printf("wrong_type: wrong argument type %s (expected %s)", + RSTRING_PTR(rb_mod_name(rb_obj_class(obj))), data_type->wrap_struct_name); rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (expected %s)", rb_obj_class(obj), data_type->wrap_struct_name); wrong_datatype: ``` Gives me: ``` .wrong_type: wrong argument type TracePoint (expected tracepoint) ``` I need to dig a bit deeper, to understand the difference though. ---------------------------------------- Bug #16682: Ruby 2.7.0p0 crash on exit if there is an active RUBY_INTERNAL_EVENT_GC_EXIT tracepoint https://bugs.ruby-lang.org/issues/16682#change-84552 * Author: byroot (Jean Boussier) * Status: Open * Priority: Normal * ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- ``` [BUG] object allocation during garbage collection phase ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19] -- Crash Report log information -------------------------------------------- See Crash Report log file under the one of following: * ~/Library/Logs/DiagnosticReports * /Library/Logs/DiagnosticReports for more details. Don't forget to include the above Crash Report log file in bug reports. -- Control frame information ----------------------------------------------- c:0001 p:0001 s:0003 E:002690 (none) [FINISH] -- C level backtrace information ------------------------------------------- /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_vm_bugreport+0x96) [0x10fa9f266] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_bug+0xcc) [0x10faabb86] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(newobj_slowpath+0x99c) [0x10f8f939c] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(newobj_slowpath_wb_protected+0x14) [0x10f8f89d4] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_str_buf_new+0x1e) [0x10fa151be] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_enc_vsprintf+0x48) [0x10fa03178] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_vraise+0x14) [0x10f8d4d84] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_raise+0x7b) [0x10f8d052b] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_check_typeddata+0xf3) [0x10f8d19a3] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(tp_call_trace+0x2a) [0x10faa1aaa] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_exec_event_hooks+0x163) [0x10faa0ab3] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_objspace_call_finalizer+0x8b7) [0x10f8eded7] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(rb_ec_cleanup+0x2de) [0x10f8dc35e] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(ruby_run_node+0x5f) [0x10f8dc4ff] /Users/byroot/.rubies/ruby-2.7.0/bin/ruby(main+0x5d) [0x10f833d0d] ``` It also crash in other circumstances, but I'm not able to reproduce them as easily. Older versions are not affected. I created a repository to easily reproduce the issue: https://github.com/casperisfine/ruby-tracepoint-crash -- https://bugs.ruby-lang.org/ Unsubscribe: