diff options
author | Rickard Green <[email protected]> | 2016-08-02 15:58:06 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2016-08-29 16:26:24 +0200 |
commit | 9d0638216d35ca0f21c1eea20f8daa3992ac4f71 (patch) | |
tree | b270d8f0226e88c376826584c4ea88ae377dff6f /lib/tools/test/cover_SUITE_data | |
parent | 2fe03e832adb11c50bcfc62679cf17779b284124 (diff) | |
download | otp-9d0638216d35ca0f21c1eea20f8daa3992ac4f71.tar.gz otp-9d0638216d35ca0f21c1eea20f8daa3992ac4f71.tar.bz2 otp-9d0638216d35ca0f21c1eea20f8daa3992ac4f71.zip |
Fix purge of code
Ensure that we cannot get any dangling pointers into code that
has been purged. This is done by a two phase purge. At first
phase all fun entries pointing into the code to purge are marked
for purge. All processes trying to call these funs will be suspended
and by this we avoid getting new direct references into the code.
When all processes has been checked, these processes are resumed.
The new purge strategy now also completely ignore the existence of
indirect references to the code (funs). If such exist, they will
cause bad fun exceptions to the caller, but will not prevent a
soft purge or cause a kill of a process having such live references
during a hard purge. This since it is impossible to give any
guarantees that no processes in the system have such indirect
references. Even when the system is completely clean from such
references, new ones can appear via distribution and/or disk.
Diffstat (limited to 'lib/tools/test/cover_SUITE_data')
-rw-r--r-- | lib/tools/test/cover_SUITE_data/otp_6115/f1.erl | 15 | ||||
-rw-r--r-- | lib/tools/test/cover_SUITE_data/otp_6115/f2.erl | 14 |
2 files changed, 7 insertions, 22 deletions
diff --git a/lib/tools/test/cover_SUITE_data/otp_6115/f1.erl b/lib/tools/test/cover_SUITE_data/otp_6115/f1.erl index 5399b33f19..fc4a62e70e 100644 --- a/lib/tools/test/cover_SUITE_data/otp_6115/f1.erl +++ b/lib/tools/test/cover_SUITE_data/otp_6115/f1.erl @@ -1,13 +1,6 @@ -module(f1). --export([start_a/0, start_b/0]). +-export([non_tail_call_f2_wait/0]). -start_a() -> - f2:start(fun() -> - ok - end). - -start_b() -> - f2:start(fun fun1/0). - -fun1() -> - ok. +non_tail_call_f2_wait() -> + f2:wait(), + im_back. diff --git a/lib/tools/test/cover_SUITE_data/otp_6115/f2.erl b/lib/tools/test/cover_SUITE_data/otp_6115/f2.erl index 72a6a64c4d..4bc88035c7 100644 --- a/lib/tools/test/cover_SUITE_data/otp_6115/f2.erl +++ b/lib/tools/test/cover_SUITE_data/otp_6115/f2.erl @@ -1,13 +1,5 @@ -module(f2). --export([start/1]). +-export([wait/0]). -start(Fun) -> - spawn(fun() -> - wait(Fun) - end). - -wait(Fun) -> - receive - go -> - Fun() - end. +wait() -> + receive after infinity -> ok end. |