aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-07-12 15:54:57 +0200
committerSverker Eriksson <[email protected]>2018-07-12 15:54:57 +0200
commit346494638829cb4440aea106dbfc3ede45e1d274 (patch)
treefcd64f7eee2e66790dd42f26295c74ddc94e397e /erts/emulator/beam
parent44b09e036b31b29dddc3b178e8f6b9fc96a9a874 (diff)
downloadotp-346494638829cb4440aea106dbfc3ede45e1d274.tar.gz
otp-346494638829cb4440aea106dbfc3ede45e1d274.tar.bz2
otp-346494638829cb4440aea106dbfc3ede45e1d274.zip
erts: Fix bug in crash dump generation
Symptom: emulator core dumps during crash dump generation. Problem: erts_dump_lit_areas did not grow correctly to always be equal or larger than number of loaded modules. The comment about twice the size to include both curr and old did not seem right. The beam_ranges structure contains *all* loaded module instances until they are removed when purged.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/beam_ranges.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/erts/emulator/beam/beam_ranges.c b/erts/emulator/beam/beam_ranges.c
index fac4289271..8e96b762bf 100644
--- a/erts/emulator/beam/beam_ranges.c
+++ b/erts/emulator/beam/beam_ranges.c
@@ -34,10 +34,8 @@ typedef struct {
/*
* Used for crash dumping of literals. The size of erts_dump_lit_areas is
- * always twice the number of active ranges (to allow for literals in both
- * current and old code).
+ * always at least the number of active ranges.
*/
-
ErtsLiteralArea** erts_dump_lit_areas;
Uint erts_dump_num_lit_areas;
@@ -179,8 +177,8 @@ erts_end_staging_ranges(int commit)
(erts_aint_t) (r[dst].modules +
r[dst].n / 2));
- if (r[dst].allocated * 2 > erts_dump_num_lit_areas) {
- erts_dump_num_lit_areas *= 2;
+ if (r[dst].allocated > erts_dump_num_lit_areas) {
+ erts_dump_num_lit_areas = r[dst].allocated * 2;
erts_dump_lit_areas = (ErtsLiteralArea **)
erts_realloc(ERTS_ALC_T_CRASH_DUMP,
(void *) erts_dump_lit_areas,