Skip to content

Commit 97f5546

Browse files
committed
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: ruby#12309 (comment)
1 parent aa360c3 commit 97f5546

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,9 @@ ruby_modular_gc_init(void)
940940
static void
941941
asan_death_callback(void)
942942
{
943-
rb_bug_without_die("ASAN error");
943+
if (GET_VM()) {
944+
rb_bug_without_die("ASAN error");
945+
}
944946
}
945947
#endif
946948

0 commit comments

Comments
 (0)