RFR: 8234262: Unmask SIGQUIT in a child process [v2]

Thomas Stuefe stuefe at openjdk.org
Thu Sep 22 16:22:22 UTC 2022


On Thu, 22 Sep 2022 14:26:51 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> Hi Roger, Using the spawn attributes seems more far reaching than simply temporarily changing the signal mask of the calling thread. I'd be concerned this has some unintended side-effects.

I don't think that is a good idea. If the thread receives a SIGQUIT in the time it takes to fire up posix_spawn, will it be prepared to handle the signal? Using a pthread spawn attribute is much less intrusive, since it only affects the child process.

> > The launching of a new executable is a two+ step process. A small executable (jspawnhelper) is spawned and it does the exec of the requested executable. An alternate implementation is to have jspawnhelper reset its own signal mask before exec'ing the target application.
> 
> Doing this in jspawnhelper would be good to try.

I think using posix_spawn attributes is fine. It does what you would do manually in jspawnhelper: calling sigprocmask in the child process: https://github.com/lattera/glibc/blob/master/sysdeps/posix/spawni.c#L218 .

-------------

PR: https://git.openjdk.org/jdk/pull/10379


More information about the core-libs-dev mailing list