I came across this a few days ago and struggled with it for a while before re-writing the code using "fork()" and "execvpe" to achieve the same effect. The "exec" calls also failed but they gave a proper error value (via errno) from which the cause of the error could be found (perror(errno)).
In my case, errno was 14 and the error message said "Bad address" which turned out to be caused by an invalid argument list passed to execvpe. I wasn't terminating the argument list with NULL set as the last element.
Having a better error reporting system in posix_spawnp would have saved me alot of trouble
No comments:
Post a Comment