kill and wait unbehaves

We are running QNX6.1 on a PowerPC 8250 and we have a very strange behavior
involving wait() and kill();

Our app consists of two processes A and B, where A is the parent process of
B.

The code in A is as follows:
//------------------------------------------------------------------
void sigh(int s)
{ // do nothing
}

void main(void)
{
int chpid1;
int siginfo;
signal(SIGINT,sigh);

while(1)
{
chpid1=spawnl(P_NOWAIT, “B”, “B”, 0);
if(chpid1<0)
{
perror(“spawn”);
return 0;
}
fprintf(stderr,“starting %d\n”,chpid1);

while( (exitpid=wait(&siginfo))==-1); // wait for B termination or a
signal

// B has terminated
fprintf(stderr,"%d exited\n",exitpid);
} // end while
} // main

//------------------------------------------------------------------

The B app is a bit complex BUT the only communication between A and B is
that B is sending the signal SIGINT to A once a second (using kill). The
only knowledge B has about A is the pid of A.

When started everything works fine and if B is terminated A sees this and
spawns B again. BUT after 30 minutes or so suddenly A seems to become totaly
dead. It does not react to B termination anymore but even more strange is
that it cannot even be killed with ‘slay -sSIGKILL A’!!!

I have generated a dump of A using dumper when it is hung like this and it
shows the following backtrace:
0 MsgSendv
1 waitid
2 wait4
3 wait
:
this is also what it normally looks like when A is not hung. The state of A
is also in both situations (hung/not hung) = REPLY.

The A app is exactly as above but B is more complex. I made a simple-B doing
only the following:
while(1)
{
kill(getppid(),SIGINT);
sleep(1);
}

but this does not give the described problem. This of course points to that
it must be something funny that B is doing and I agree on that but how can B
make A behave this strange??

best regards, Mats B