Skip to content

Commit

Permalink
Don't print bug report in asan_death_callback when no VM
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
peterzhu2118 committed Dec 20, 2024
1 parent aa360c3 commit 97f5546
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 97f5546

Please sign in to comment.