aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_x86_gc.h
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-05-23 15:41:31 +0200
committerMagnus Lång <[email protected]>2016-07-06 16:08:20 +0200
commitf0131c58c42a286c8b3f611b47106393a37197b6 (patch)
treecaefc37baef32b065e69f23cc363a83ff70dcd12 /erts/emulator/hipe/hipe_x86_gc.h
parent3b409021a70427bb2fe3834707edf822b6afce2d (diff)
downloadotp-f0131c58c42a286c8b3f611b47106393a37197b6.tar.gz
otp-f0131c58c42a286c8b3f611b47106393a37197b6.tar.bz2
otp-f0131c58c42a286c8b3f611b47106393a37197b6.zip
check_process_code: Sweep HiPE stack for literals
Because check_process_code neglected checking the HiPE stack for references to the literal area, such references would survive the purge and subsequent deletion of a module and its literal area. These dangling references would then cause incorrect behaviour or even hard crashes of the VM. By simply adding a scan of the HiPE stack to check_process_code and erts_garbage_collect_literals, this problem is fixed. In order to support full stack walks without deleting the graylimit trap, a new stack walking interface function, nstack_walk_init_sdesc_ignore_trap() was introduced.
Diffstat (limited to 'erts/emulator/hipe/hipe_x86_gc.h')
-rw-r--r--erts/emulator/hipe/hipe_x86_gc.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_x86_gc.h b/erts/emulator/hipe/hipe_x86_gc.h
index c22b28c2d5..00fe03d8f9 100644
--- a/erts/emulator/hipe/hipe_x86_gc.h
+++ b/erts/emulator/hipe/hipe_x86_gc.h
@@ -81,6 +81,23 @@ nstack_walk_init_sdesc(const Process *p, struct nstack_walk_state *state)
#endif
}
+static inline const struct sdesc*
+nstack_walk_init_sdesc_ignore_trap(const Process *p,
+ struct nstack_walk_state *state)
+{
+#ifdef SKIP_YOUNGEST_FRAME
+ unsigned long ra = p->hipe.nsp[0];
+ const struct sdesc *sdesc;
+ if (ra == (unsigned long)nbif_stack_trap_ra)
+ ra = (unsigned long)p->hipe.ngra;
+ sdesc = hipe_find_sdesc(ra);
+ state->sdesc0 = sdesc;
+ return sdesc;
+#else
+ return nstack_walk_init_sdesc(p, state);
+#endif
+}
+
static inline void nstack_walk_update_trap(Process *p, const struct sdesc *sdesc0)
{
#ifdef SKIP_YOUNGEST_FRAME