Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2013-11-13 13:19:36 -0500
committerEugene Tarassov2013-11-13 13:19:36 -0500
commit4fed88c82b781989a556f902024bd502fcac4f22 (patch)
treef4e6756f7325923e1b5c56efc080beda7e8570a7 /agent/system/Darwin
parent923cdcba1e36852c0d4e94e89635ef6231a38e84 (diff)
downloadorg.eclipse.tcf.agent-4fed88c82b781989a556f902024bd502fcac4f22.tar.gz
org.eclipse.tcf.agent-4fed88c82b781989a556f902024bd502fcac4f22.tar.xz
org.eclipse.tcf.agent-4fed88c82b781989a556f902024bd502fcac4f22.zip
TCF Agent: fixed: Assertion `ctx->ref_count > 0' can fail if a process exits before agent finishes attaching the process
Diffstat (limited to 'agent/system/Darwin')
-rw-r--r--agent/system/Darwin/tcf/context-darwin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/agent/system/Darwin/tcf/context-darwin.c b/agent/system/Darwin/tcf/context-darwin.c
index 55fcf739..2b6cb508 100644
--- a/agent/system/Darwin/tcf/context-darwin.c
+++ b/agent/system/Darwin/tcf/context-darwin.c
@@ -505,6 +505,7 @@ static void event_pid_exited(pid_t pid, int status, int signal) {
}
else {
assert(ctx->ref_count == 0);
+ ctx->ref_count = 1;
if (EXT(ctx)->attach_callback != NULL) {
if (status == 0) status = EINVAL;
EXT(ctx)->attach_callback(status, ctx, EXT(ctx)->attach_data);
@@ -512,7 +513,6 @@ static void event_pid_exited(pid_t pid, int status, int signal) {
assert(list_is_empty(&ctx->children));
assert(ctx->parent == NULL);
ctx->exited = 1;
- ctx->ref_count = 1;
context_unlock(ctx);
}
}

Back to the top