Skip to content

Commit

Permalink
erts: Avoid SEGV in crash dump of global literals on debug target
Browse files Browse the repository at this point in the history
by making the chunk writable before we adjust the 'end' of the area
for correct crash dumping.
  • Loading branch information
sverker committed Oct 22, 2024
1 parent fc5415e commit f585777
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions erts/emulator/beam/erl_global_literals.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ ErtsLiteralArea *erts_global_literal_iterate_area(ErtsLiteralArea *prev)
next = global_literal_chunk;
}

#ifdef DEBUG
erts_mem_guard(next,
(byte*)next->area.end - (byte*)next,
1,
1);
#endif
next->area.end = next->hp;
return &next->area;
}
Expand Down

0 comments on commit f585777

Please sign in to comment.