Yeah (redhat 7.2), on linux a pthread is an implementation of a LinuxThread isn't it.
The problem is intermittent, but I know how to reproduce now.
I'll see if I can reproduce with the code you posted. I'll post the results.
vVv, what's the effect of calling _exit before or directly after pthread_exit? I mean, pthread_exit just cleans up the thread resources, and according to my man page, _exit sends SIGCHLD signal to processes inherited by the init process etc.
ok, just tested last posted script. same problem.
I changed the code to:
after the code 'times out' and EXITS i get the following still in my process list (ps -auxf):
char *script1 = "#!/bin/sh\n"
"printf \"hello world\"";
The script is acually doing a snmpdf (disk space analysis using SNMP) on a remote windows box with a ropey snmp daemon.
root 9822 0.0 0.3 2232 1012 pts/5 S 12:37 0:00 /bin/sh my_bash_script.sh
Now, is this a Linux issue? Is snmpdf doing something wierd?
One hack is to kill the PID of my_bash_script.sh from the C daemon using pid files, but I want ot get to the root of the problem.
Well, if it's not my code (i.e. the system) then I need to hack:
1) Use pid file to explicitly kill the pid of my_bash_script.sh - i don't want to have to manage these really.
2) Run a cron job that stop the daemon kills all processes owned by it and starts it again - i know!
3) Use BSD.
I can't think of anything else!