summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-12-20 14:09:19 -0500
committerPeter Zhu <[email protected]>2024-12-20 15:04:08 -0500
commit97f55466760d89a54e82608e5c7c31fba60158ca (patch)
tree0a2410102bcc933dd36c3b4ff6629e472a3ee0b8
parentaa360c3bee359f456d2f72dfa1bc9767074587ae (diff)
Don't print bug report in asan_death_callback when no VM
If we don't have the VM (e.g. printing memory leaks in LSAN after shutdown) then we will crash when we try to print the bug report. This issue was reported in: https://github.com/ruby/ruby/pull/12309#issuecomment-2555766525
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12413
-rw-r--r--gc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index d504b96497..150450489c 100644
--- a/gc.c
+++ b/gc.c
@@ -940,7 +940,9 @@ ruby_modular_gc_init(void)
static void
asan_death_callback(void)
{
- rb_bug_without_die("ASAN error");
+ if (GET_VM()) {
+ rb_bug_without_die("ASAN error");
+ }
}
#endif