Skip to content

Commit

Permalink
Merge pull request #259 from cuviper/scrub-failed-createThread
Browse files Browse the repository at this point in the history
proccontrol: scrub newly created threads that fail to attach
  • Loading branch information
cuviper committed Nov 30, 2016
2 parents d2f0f10 + f88802f commit 6ccfab4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions proccontrol/src/process.C
Expand Up @@ -3495,8 +3495,14 @@ int_thread *int_thread::createThread(int_process *proc,
bool result = newthr->attach();
if (!result) {
pthrd_printf("Failed to attach to new thread %d/%d\n", proc->getPid(), lwp_id);
newthr->getUserState().setState(errorstate);
newthr->getHandlerState().setState(errorstate);
newthr->getGeneratorState().setState(errorstate);
ProcPool()->rmThread(newthr);
proc->threadPool()->rmThread(newthr);
return NULL;
}

if (newthr->isUser() && newthr->getUserState().getState() == neonatal) {
newthr->getUserState().setState(neonatal_intermediate);
newthr->getHandlerState().setState(neonatal_intermediate);
Expand Down

0 comments on commit 6ccfab4

Please sign in to comment.