Permalink
Browse files

Merge branch 'sverk/proc-race-leak/OTP-10041' into maint

* sverk/proc-race-leak/OTP-10041:
  erts: Fix memory leak caused by race on exiting process
  • Loading branch information...
2 parents 7c052e0 + 73e6d0f commit aa257fbe5248a054e3c3b660efe6013d9e52bc70 @sverker sverker committed Mar 30, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 erts/emulator/beam/erl_process_lock.h
@@ -958,8 +958,6 @@ erts_pid2proc_opt(Process *c_p,
if (flags & ERTS_P2P_FLG_TRY_LOCK)
proc = ERTS_PROC_LOCK_BUSY;
else {
- if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
- proc->lock.refc++;
#ifdef ERTS_ENABLE_LOCK_COUNT
erts_lcnt_proc_lock_unaquire(&proc->lock, lcnt_locks);
#endif
@@ -969,6 +967,8 @@ erts_pid2proc_opt(Process *c_p,
pid_need_locks,
pix_lock,
flags);
+ if (proc && (flags & ERTS_P2P_FLG_SMP_INC_REFC))
+ proc->lock.refc++;
}
}
}

0 comments on commit aa257fb

Please sign in to comment.