From b385f7670ffa420790bc548747fa4b58c4c5d8f6 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Wed, 11 Mar 2020 10:37:14 -0400 Subject: Clear all trace events during teardown Since 0c2d81dada, not all trace events are cleared during VM teardown. This causes a crash when there is a tracepoint for `RUBY_INTERNAL_EVENT_GC_EXIT` active during teardown. The commit looks like a refactoring commit so I think this change was unintentional. [Bug #16682] --- vm_trace.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vm_trace.c') diff --git a/vm_trace.c b/vm_trace.c index f1aa35d664..920a8d55ed 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -278,6 +278,12 @@ rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec) rb_threadptr_remove_event_hook(ec, rb_ec_thread_ptr(ec), 0, Qundef); } +void +rb_ec_clear_all_trace_func(const rb_execution_context_t *ec) +{ + rb_threadptr_remove_event_hook(ec, MATCH_ANY_FILTER_TH, 0, Qundef); +} + /* invoke hooks */ static void -- cgit v1.2.1