STOPPED state for thread

This is related to my previous question. We have a thread that is starting
3 other threads. When they exit, they are DEAD, but also once the last
thread (of the three created) exits, all our other threads associated with
this process enter into STOPPED state. What events can cause the our other
threads to enter this STOPPED states…

Jay Witherspoon <spoon@scubadiving.com> wrote:

This is related to my previous question. We have a thread that is starting
3 other threads. When they exit, they are DEAD, but also once the last
thread (of the three created) exits, all our other threads associated with
this process enter into STOPPED state. What events can cause the our other
threads to enter this STOPPED states…

If a process is hit with a STOP signal, all the threads will be put into
the STOPPED state.

Hitting the process with a SIGSTOP explicitly would do it.

When a debugger attaches/stops a process, it uses a SIGSTOP for that.

Typing ctrl-Z to stop a process at a terminal will do this.
(This is probably SIGTSTP rather than SIGSTOP.)

Thread termination should not do this.

I can’t think of anything else, offhand, that would automatically
drop a STOP signal on a process.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

David,

Thanks for the info. I grep’d and verified that SIGSTOP and SIGSTP are not
being sent by our code and we are not pressing ctl-Z. I was guessing that
with our DEAD threads that maybe we were not properly cleaning something up
and our threads were blocking and somehow entering the STOPPED state… We
were aware of the debugger. So, it sounds like the only way to enter the
STOPPED state is the result of a signal, so will focus on that… Thanks,
will continue looking.

“David Gibbs” <dagibbs@qnx.com> wrote in message
news:behdrh$2gh$2@nntp.qnx.com

Jay Witherspoon <> spoon@scubadiving.com> > wrote:
This is related to my previous question. We have a thread that is
starting
3 other threads. When they exit, they are DEAD, but also once the last
thread (of the three created) exits, all our other threads associated
with
this process enter into STOPPED state. What events can cause the our
other
threads to enter this STOPPED states…

If a process is hit with a STOP signal, all the threads will be put into
the STOPPED state.

Hitting the process with a SIGSTOP explicitly would do it.

When a debugger attaches/stops a process, it uses a SIGSTOP for that.

Typing ctrl-Z to stop a process at a terminal will do this.
(This is probably SIGTSTP rather than SIGSTOP.)

Thread termination should not do this.

I can’t think of anything else, offhand, that would automatically
drop a STOP signal on a process.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Jay Witherspoon <spoon@scubadiving.com> wrote:

This is related to my previous question. We have a thread that is starting
3 other threads. When they exit, they are DEAD, but also once the last
thread (of the three created) exits, all our other threads associated with
this process enter into STOPPED state. What events can cause the our other
threads to enter this STOPPED states…

Could be job control. If using the ksh shell, disable job control and
see if the issue goes away – “set +m”.

Are you running dumper? If you process faults, I think your process
could be STOPPED while dumper reads your process’s memory.


Kirk Russell Bridlewood Software Testers Guild