diff options
author | Sverker Eriksson <[email protected]> | 2013-08-02 15:04:14 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-08-07 16:07:42 +0200 |
commit | f499b39ddc5025074c5d22f272f1dd55df79f009 (patch) | |
tree | 8abc375d0ca4b957c1302bada04d383364e5bdd3 /erts/autoconf | |
parent | 8cece79b77952c991e62ae595bcf71cde016a052 (diff) | |
download | otp-f499b39ddc5025074c5d22f272f1dd55df79f009.tar.gz otp-f499b39ddc5025074c5d22f272f1dd55df79f009.tar.bz2 otp-f499b39ddc5025074c5d22f272f1dd55df79f009.zip |
erts: Fix race in ptab that can cause PID mix-ups
Since: R16B01
Symptom: A spawned process may get the same PID as an existing
process. The new process will "steal" the PID and make the old process
unreachable through the PID.
The problem also applies to port identities but has only been seen
for processes.
Conditions: SMP emulator with at least two scheduler threads. Rapid
spawning and termination of a large number of processes. A small
number of free slots in the process table will also increase the risk
for this bug.
Workaround: Use command line options "+P legacy" and "+Q legacy"
Cause: The race happens if a process terminates and gets stalled while
releasing its process table slot. The stall has to be so long (due to OS
preemptive scheduling most probably) for other schedluer threads to
consume all other free slots for newly spawn processes.
Fix: Write invalid-markers in the free-pid-table and do atomic exhange
operations in retry-loops to make sure each thread gets a unique PID.
Diffstat (limited to 'erts/autoconf')
0 files changed, 0 insertions, 0 deletions