problems with execv and spawnv in QNX6

I am running into problems with the execv() and spawnv() functions in QNX6.
There are times when the execv() and spawnv() functions never execute the
new program or return an error, it just hangs forever. After this happens
the calling process still shows up when you do a “ps -a” along with a
process that has no name, some sort of zombie and cannot be killed with any
signal including a kill -9 without rebooting the machine. If I do a
“ps -ef” the program shows up an infinite (sic) amount of times in the
listing and never stops scrolling. If I do a “ps -ef | grep filename” the ps
hangs and never returns.

I noticed that if I touch the executable file without recompiling the code
and try to run it again everything seems to work fine, sometimes.

This exact code has been running under QNX4.25 without issue in the field
for 2 years but is very inconsistent at best under QNX6.

If anyone has experienced anything similar or knows what could be causing
this I would appreciate your input.

Do you call waitpid() to query the exit status of the child ?
if not, may this is the reason for the zombies. The child process terminates
and keeps
the exit status until you query it with waitpid(). Alternatively you can use
the
P_NOWAITO mode flag in execvpe().
The hang of the ps -ef | … is may because your parent proc creates the
child proc
at a very high frequency. Did you checked the return value/errno of the
execv()/spawnv() ?
cheers, Peter

“Michael Kapp” <kapptain@hotmail.com> schrieb im Newsbeitrag
news:akibup$2ec$1@inn.qnx.com

I am running into problems with the execv() and spawnv() functions in
QNX6.
There are times when the execv() and spawnv() functions never execute the
new program or return an error, it just hangs forever. After this happens
the calling process still shows up when you do a “ps -a” along with a
process that has no name, some sort of zombie and cannot be killed with
any
signal including a kill -9 without rebooting the machine. If I do a
“ps -ef” the program shows up an infinite (sic) amount of times in the
listing and never stops scrolling. If I do a “ps -ef | grep filename” the
ps
hangs and never returns.

I noticed that if I touch the executable file without recompiling the code
and try to run it again everything seems to work fine, sometimes.

This exact code has been running under QNX4.25 without issue in the field
for 2 years but is very inconsistent at best under QNX6.

If anyone has experienced anything similar or knows what could be causing
this I would appreciate your input.

The parent process just checks which process to kick off based upon
configuration and does nothing else. The execv() is to overlay a completely
new process from the spawner.

The problem is the exec does not return and the process hangs leaving the
original parent that cannot be killed and a zombie child that also cannot be
killed. It appears that the exec begins but does not properly overlay the
new image.

Very perplexing.



“dolphin GmbH” <pw@dolphin.de> wrote in message
news:aklbhl$9dd$1@inn.qnx.com

Do you call waitpid() to query the exit status of the child ?
if not, may this is the reason for the zombies. The child process
terminates
and keeps
the exit status until you query it with waitpid(). Alternatively you can
use
the
P_NOWAITO mode flag in execvpe().
The hang of the ps -ef | … is may because your parent proc creates the
child proc
at a very high frequency. Did you checked the return value/errno of the
execv()/spawnv() ?
cheers, Peter

“Michael Kapp” <> kapptain@hotmail.com> > schrieb im Newsbeitrag
news:akibup$2ec$> 1@inn.qnx.com> …
I am running into problems with the execv() and spawnv() functions in
QNX6.
There are times when the execv() and spawnv() functions never execute
the
new program or return an error, it just hangs forever. After this
happens
the calling process still shows up when you do a “ps -a” along with a
process that has no name, some sort of zombie and cannot be killed with
any
signal including a kill -9 without rebooting the machine. If I do a
“ps -ef” the program shows up an infinite (sic) amount of times in the
listing and never stops scrolling. If I do a “ps -ef | grep filename”
the
ps
hangs and never returns.

I noticed that if I touch the executable file without recompiling the
code
and try to run it again everything seems to work fine, sometimes.

This exact code has been running under QNX4.25 without issue in the
field
for 2 years but is very inconsistent at best under QNX6.

If anyone has experienced anything similar or knows what could be
causing
this I would appreciate your input.

\

I assume you have something like:
// in the parent
if(!fork())
execv(new_prog…)

Can you post the code snippet of the relevant parts ?

“Michael Kapp” <kapptain@hotmail.com> schrieb im Newsbeitrag
news:al5cel$766$1@inn.qnx.com

The parent process just checks which process to kick off based upon
configuration and does nothing else. The execv() is to overlay a
completely
new process from the spawner.

The problem is the exec does not return and the process hangs leaving the
original parent that cannot be killed and a zombie child that also cannot
be
killed. It appears that the exec begins but does not properly overlay the
new image.

Very perplexing.



“dolphin GmbH” <> pw@dolphin.de> > wrote in message
news:aklbhl$9dd$> 1@inn.qnx.com> …
Do you call waitpid() to query the exit status of the child ?
if not, may this is the reason for the zombies. The child process
terminates
and keeps
the exit status until you query it with waitpid(). Alternatively you can
use
the
P_NOWAITO mode flag in execvpe().
The hang of the ps -ef | … is may because your parent proc creates the
child proc
at a very high frequency. Did you checked the return value/errno of the
execv()/spawnv() ?
cheers, Peter

“Michael Kapp” <> kapptain@hotmail.com> > schrieb im Newsbeitrag
news:akibup$2ec$> 1@inn.qnx.com> …
I am running into problems with the execv() and spawnv() functions in
QNX6.
There are times when the execv() and spawnv() functions never execute
the
new program or return an error, it just hangs forever. After this
happens
the calling process still shows up when you do a “ps -a” along with a
process that has no name, some sort of zombie and cannot be killed
with
any
signal including a kill -9 without rebooting the machine. If I do a
“ps -ef” the program shows up an infinite (sic) amount of times in the
listing and never stops scrolling. If I do a “ps -ef | grep filename”
the
ps
hangs and never returns.

I noticed that if I touch the executable file without recompiling the
code
and try to run it again everything seems to work fine, sometimes.

This exact code has been running under QNX4.25 without issue in the
field
for 2 years but is very inconsistent at best under QNX6.

If anyone has experienced anything similar or knows what could be
causing
this I would appreciate your input.








\