proccontrol: scrub newly created threads that fail to attach 259/head
authorJosh Stone <jistone@redhat.com>
Wed, 16 Nov 2016 21:44:37 +0000 (13:44 -0800)
committerJosh Stone <jistone@redhat.com>
Wed, 16 Nov 2016 21:44:37 +0000 (13:44 -0800)
commitf88802f0737f4cf2a684cb2528f2c3ae0addc393
treefad26f14356b1988b8da3fcc57ff53fe34d0470b
parent64edc81ee01131502e2568749f006e3511c44fb6
proccontrol: scrub newly created threads that fail to attach

If `int_thread::createThread` failed to actually attach to the thread,
it was leaving the thread object in the process in the `neonatal` state.
This failed assertions later when trying to stop all of the process's
threads, as it would have handler `stopped` and generator `neonatal`.

Now when a thread attach fails, it is set to `errorstate` and removed
from the active thread pools.  The assumption is that this thread simply
exited before we could attach, but we can't be sure of that without
having access to the ptrace return code (`ESRCH`).
proccontrol/src/process.C