diff options
author | Björn Gustavsson <[email protected]> | 2017-10-25 10:39:29 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-10-30 10:14:18 +0100 |
commit | c9765df137370b692cd9476ff5a4d00122b2ba93 (patch) | |
tree | 7542fb6684590563b7f79dc6d95419a6af34a442 /erts/emulator | |
parent | c26f0e58f440859abbfb9b4e3570713ac722e0da (diff) | |
download | otp-c9765df137370b692cd9476ff5a4d00122b2ba93.tar.gz otp-c9765df137370b692cd9476ff5a4d00122b2ba93.tar.bz2 otp-c9765df137370b692cd9476ff5a4d00122b2ba93.zip |
erl_process_dump: Don't assume that literals can be found
Native code does not register its literals in the code header for the
loaded code. Therefore, a literal created by native code can not be
found by mark_literal(). Ignore literals that can't be found instead
of crashing (the crasdump_viewer will report such literals as
incomplete heap data, but will not crash).
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/beam/erl_process_dump.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_process_dump.c b/erts/emulator/beam/erl_process_dump.c index 9fd024cae8..5641195458 100644 --- a/erts/emulator/beam/erl_process_dump.c +++ b/erts/emulator/beam/erl_process_dump.c @@ -728,8 +728,15 @@ static void mark_literal(Eterm* ptr) ap = bsearch(ptr, lit_areas, num_lit_areas, sizeof(ErtsLiteralArea*), search_areas); - ASSERT(ap); - ap[0]->off_heap = (struct erl_off_heap_header *) 1; + + /* + * If the literal was created by native code, this search will not + * find it and ap will be NULL. + */ + + if (ap) { + ap[0]->off_heap = (struct erl_off_heap_header *) 1; + } } |