Hi Roger, I think this is fine.
Could you please also print out WIFEXITED and WIFSIGNALLED? Since I am not sure if the WEXITSTATUS contains valid info if WIFEXITED is 0, or just random noise. Same for WTERMSIG. Alternatively: if (WIFEXITED) print("exited normaly with %d", WEXITSTATUS) else if (WIFSTOPPED) print("terminated with signal %d", WTERMSIG) ... I am curious what what will print. If the "posix_spawn exec failed" message was correct we will see WIFEXITED=1 and WEXITSTATUS=127. But if my patch is wrong and it gave a false positive - maybe the child process run through just fine and this is just a fluke in communicating with the parent - we see something different. Thanks, Thomas On Mon, Jun 17, 2019 at 7:19 PM Roger Riggs <roger.ri...@oracle.com> wrote: > Hi Thomas, > > yes, I meant WTERMSIG. I figured the useful info was the value of those > two fields of the status > but a bit easier to read than the hex formatted value. > If there is any other information available at that point of execution, > let me know. > > Thanks, Roger > > [1] > http://cr.openjdk.java.net/~rriggs/webrev-spawn-diag-8225192-1/index.html > > On 6/17/19 1:08 PM, Thomas Stüfe wrote: > > Hi Roger, > > thanks for taking care of this! > > I think WIFSIGNALED is just a bool though; to get the terminating signal, > you need to use WTERMSIG. Strictly speaking, WEXISTSTATUS is only valid if > WIFEXITED!=0 and WTERMSIG only if WIFSIGNALLED!=0; I think they are > undefined otherwise. > > > They are undefined, yet still extract the values from the status return > from waitpid. > > > Cheers, Thoams > > > > On Mon, Jun 17, 2019 at 6:04 PM Roger Riggs <roger.ri...@oracle.com> > wrote: > >> Please review adding diagnostic information to the native code handing >> failures >> to exec the jspawnhelper. Some information about the child process >> status can be included. >> >> Jira: >> diag task: https://bugs.openjdk.java.net/browse/JDK-8226242 >> Issue: https://bugs.openjdk.java.net/browse/JDK-8226192 >> >> Webrev: >> http://cr.openjdk.java.net/~rriggs/webrev-spawn-diag-8225192/ >> >> Thanks, Roger >> > >