diff options
author | Björn Gustavsson <[email protected]> | 2017-10-20 14:23:26 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-10-20 14:23:26 +0200 |
commit | 4b8255e9217c293f84a1e96b3ae8034d089e815b (patch) | |
tree | d65914ea3e8c939a5a5a1d97a1a8f9c3b07f0cdb /erts/emulator/beam/beam_ranges.c | |
parent | 3ea750a53874d61ef7d4d806656ca63c7759a8a4 (diff) | |
parent | 806c2de5ca3806ad8110531c99749063e5603ac0 (diff) | |
download | otp-4b8255e9217c293f84a1e96b3ae8034d089e815b.tar.gz otp-4b8255e9217c293f84a1e96b3ae8034d089e815b.tar.bz2 otp-4b8255e9217c293f84a1e96b3ae8034d089e815b.zip |
Merge branch 'maint'
* maint:
Bump version of crash dumps to 0.4
Verify that binaries of different sizes are dumped correctly
Don't dump literal areas that are not referenced at all
Dump literals separately to avoid incomplete heap data
Implement dumping of maps in crash dumps
Buffer writing of crash dumps
Conflicts:
erts/emulator/beam/erl_alloc.types
Diffstat (limited to 'erts/emulator/beam/beam_ranges.c')
-rw-r--r-- | erts/emulator/beam/beam_ranges.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_ranges.c b/erts/emulator/beam/beam_ranges.c index 6e373a3480..01bda7f3c1 100644 --- a/erts/emulator/beam/beam_ranges.c +++ b/erts/emulator/beam/beam_ranges.c @@ -32,6 +32,15 @@ typedef struct { erts_atomic_t end; /* (BeamInstr*) Points one word beyond last function in module. */ } Range; +/* + * 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). + */ + +ErtsLiteralArea** erts_dump_lit_areas; +Uint erts_dump_num_lit_areas; + /* Range 'end' needs to be atomic as we purge module by setting end=start in active code_ix */ #define RANGE_END(R) ((BeamInstr*)erts_atomic_read_nob(&(R)->end)) @@ -97,6 +106,11 @@ erts_init_ranges(void) r[i].allocated = 0; erts_atomic_init_nob(&r[i].mid, 0); } + + erts_dump_num_lit_areas = 8; + erts_dump_lit_areas = (ErtsLiteralArea **) + erts_alloc(ERTS_ALC_T_CRASH_DUMP, + erts_dump_num_lit_areas * sizeof(ErtsLiteralArea*)); } void @@ -164,6 +178,14 @@ erts_end_staging_ranges(int commit) erts_atomic_set_nob(&r[dst].mid, (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; + erts_dump_lit_areas = (ErtsLiteralArea **) + erts_realloc(ERTS_ALC_T_CRASH_DUMP, + (void *) erts_dump_lit_areas, + erts_dump_num_lit_areas * sizeof(ErtsLiteralArea*)); + } } } |