RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-12 Thread Volker Simonis
Since JDK13, executing commands in a sub-process defaults to the so called `POSIX_SPAWN` launching mechanism (i.e. `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by using `posix_spawn(3)` to firstly start a tiny helper program called `jspawnhelper` in a subprocess. In a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-12 Thread Roger Riggs
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-14 Thread Thomas Stuefe
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Volker Simonis
On Fri, 12 May 2023 21:37:36 GMT, Roger Riggs wrote: > Looks ok. > > Is it practical to write a test for this situation? Can I assume you've > validated the improvement as a remedy for the observed hangs? I thought about a test but couldn't come up with a practical way to write it. The JVM ha

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Volker Simonis
On Sun, 14 May 2023 17:28:33 GMT, Thomas Stuefe wrote: > Trying to understand this, and the scope of the problem: > > * Parent process opens "in" pipe. > > * Now owns read and write end of pipe. > > * Parent forks jspawnhelper. > > * jspawnhelper inherits handles. Now there ar

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Thomas Stuefe
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Thomas Stuefe
On Mon, 15 May 2023 12:31:49 GMT, Volker Simonis wrote: > > Looks ok. > > Is it practical to write a test for this situation? Can I assume you've > > validated the improvement as a remedy for the observed hangs? > > I thought about a test but couldn't come up with a practical way to write it.

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Volker Simonis
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Volker Simonis
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Thomas Stuefe
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Volker Simonis
On Mon, 15 May 2023 16:31:38 GMT, Thomas Stuefe wrote: > The fact that this error is in there since JDK 13 is scary. The error is there since ten years since the `posix_spawn` mechanism was initially introduced with [JDK-5049299](https://bugs.openjdk.org/browse/JDK-5049299) for JDK 8 and down

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Roger Riggs
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Bernd
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-15 Thread Joe Darcy
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-16 Thread David Holmes
On Fri, 12 May 2023 15:24:19 GMT, Volker Simonis wrote: > Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-16 Thread Thomas Stuefe
On Mon, 15 May 2023 18:45:24 GMT, Roger Riggs wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly start

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-16 Thread Thomas Stuefe
On Tue, 16 May 2023 07:24:31 GMT, David Holmes wrote: > I wonder if @Martin-Buchholz is able to look at this one? > > My concern with changes like this is that they fix an issue but then have > unexpected side-effects themselves. Are there any specific concerns you have? - PR Com

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-16 Thread Thomas Stuefe
On Mon, 15 May 2023 16:11:46 GMT, Volker Simonis wrote: > > 2. I think you don't actually have to hand in the in-pipe-read-end fd > > number via command line arg, just to have the child to close it. You could > > just, in the parent, set the fd to FD_CLOEXEC. Since posix_spawn() exec's > > the

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-16 Thread David Holmes
On Tue, 16 May 2023 07:56:35 GMT, Thomas Stuefe wrote: > > I wonder if @Martin-Buchholz is able to look at this one? > > My concern with changes like this is that they fix an issue but then have > > unexpected side-effects themselves. > > Are there any specific concerns you have? There seems t

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-16 Thread Thomas Stuefe
On Tue, 16 May 2023 12:07:10 GMT, David Holmes wrote: > > > I wonder if @Martin-Buchholz is able to look at this one? > > > My concern with changes like this is that they fix an issue but then have > > > unexpected side-effects themselves. > > > > > > Are there any specific concerns you have?

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-17 Thread Volker Simonis
On Tue, 16 May 2023 12:32:44 GMT, Thomas Stuefe wrote: > > > > I wonder if @Martin-Buchholz is able to look at this one? > > > > My concern with changes like this is that they fix an issue but then > > > > have unexpected side-effects themselves. > > > > > > > > > Are there any specific concer

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-17 Thread Volker Simonis
On Mon, 15 May 2023 18:45:24 GMT, Roger Riggs wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly start

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-17 Thread Volker Simonis
On Mon, 15 May 2023 20:00:28 GMT, Joe Darcy wrote: > Should this issue have a CSR for any behavioral changes? Well, you can certainly argue that every bug fix is a behavioral changes, right :) But seriously, I don't see how this PR could require a CSR. The only behavioral change is really tha

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-17 Thread Volker Simonis
On Mon, 15 May 2023 19:55:45 GMT, Bernd wrote: > Independent of the actual fix, it was mentioned that it can block listening > sockets, aren’t those close on exec? Also should a write and read timeout be > used in addition? At least to call the close descriptor code before retrying? While the

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-17 Thread Roger Riggs
On Wed, 17 May 2023 12:48:17 GMT, Volker Simonis wrote: > > Should this issue have a CSR for any behavioral changes? > > Well, you can certainly argue that every bug fix is a behavioral changes, > right :) > > But seriously, I don't see how this PR could require a CSR. The only > behavioral c

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-17 Thread Bernd
On Wed, 17 May 2023 12:40:58 GMT, Volker Simonis wrote: > If we do a short read we will work with corrupted `ChildStuff` and > `SpawnInfo` structures. i would agree failing after readFully returns short reads is fine. It won’t stop the method from retrying/completing endlessly in a pathologica

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-17 Thread Volker Simonis
On Wed, 17 May 2023 14:42:45 GMT, Roger Riggs wrote: > if parent process dies prematurely @RogerRiggs , I've created a release note for the issue based on your suggestions. Please feel free to proof-read and enhance it :) - PR Comment: https://git.openjdk.org/jdk/pull/13956#issuec

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-17 Thread Joe Darcy
On Wed, 17 May 2023 14:42:45 GMT, Roger Riggs wrote: > > Should this issue have a CSR for any behavioral changes? > > Well, you can certainly argue that every bug fix is a behavioral changes, > right :) > > But seriously, I don't see how this PR could require a CSR. The only > behavioral chan

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-18 Thread David Holmes
On Wed, 17 May 2023 12:40:58 GMT, Volker Simonis wrote: > Sorry, but I don't understand this argument. If we do a short read we will > work with corrupted ChildStuff and SpawnInfo > structures. This can in the extreme case execute arbitrary code (e.g. if > ChildStuff.argv is not fully read fro

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-19 Thread Roger Riggs
On Fri, 19 May 2023 06:28:47 GMT, David Holmes wrote: > > Sorry, but I don't understand this argument. If we do a short read we will > > work with corrupted ChildStuff and SpawnInfo > > structures. This can in the extreme case execute arbitrary code (e.g. if > > ChildStuff.argv is not fully rea

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-22 Thread David Holmes
On Fri, 19 May 2023 15:43:30 GMT, Roger Riggs wrote: > Given the purpose and implementation of the readFully function, I don't see > how it can return anything other than an error or the full requested read > length. @RogerRiggs it will return < requested read length if it encounters EOF - i.e

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-22 Thread Volker Simonis
On Wed, 17 May 2023 20:03:37 GMT, Joe Darcy wrote: > > > Should this issue have a CSR for any behavioral changes? > > > > > > Well, you can certainly argue that every bug fix is a behavioral changes, > > right :) > > But seriously, I don't see how this PR could require a CSR. The only > > beh

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-23 Thread Volker Simonis
On Fri, 19 May 2023 15:43:30 GMT, Roger Riggs wrote: >>> Sorry, but I don't understand this argument. If we do a short read we will >>> work with corrupted ChildStuff and SpawnInfo >>> structures. This can in the extreme case execute arbitrary code (e.g. if >>> ChildStuff.argv is not fully rea

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-24 Thread Volker Simonis
On Fri, 19 May 2023 15:43:30 GMT, Roger Riggs wrote: >>> Sorry, but I don't understand this argument. If we do a short read we will >>> work with corrupted ChildStuff and SpawnInfo >>> structures. This can in the extreme case execute arbitrary code (e.g. if >>> ChildStuff.argv is not fully rea

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-05-24 Thread Thomas Stuefe
On Wed, 24 May 2023 14:30:10 GMT, Volker Simonis wrote: >>> > Sorry, but I don't understand this argument. If we do a short read we >>> > will work with corrupted ChildStuff and SpawnInfo >>> > structures. This can in the extreme case execute arbitrary code (e.g. if >>> > ChildStuff.argv is not

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-06-01 Thread Volker Simonis
On Fri, 19 May 2023 15:43:30 GMT, Roger Riggs wrote: >>> Sorry, but I don't understand this argument. If we do a short read we will >>> work with corrupted ChildStuff and SpawnInfo >>> structures. This can in the extreme case execute arbitrary code (e.g. if >>> ChildStuff.argv is not fully rea

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it

2023-06-01 Thread Marius Lichtblau
On Thu, 1 Jun 2023 10:55:26 GMT, Volker Simonis wrote: >>> > Sorry, but I don't understand this argument. If we do a short read we >>> > will work with corrupted ChildStuff and SpawnInfo >>> > structures. This can in the extreme case execute arbitrary code (e.g. if >>> > ChildStuff.argv is not

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v2]

2023-05-17 Thread Volker Simonis
> Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a tiny helper program called > `jspawnhelper` in a subproc

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v2]

2023-05-17 Thread Thomas Stuefe
On Wed, 17 May 2023 12:33:48 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v2]

2023-05-17 Thread Roger Riggs
On Wed, 17 May 2023 12:33:48 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v2]

2023-05-17 Thread Volker Simonis
On Wed, 17 May 2023 14:55:00 GMT, Roger Riggs wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added test case > > src/java.base/unix/native/libjava/childproc.c line 408: > >> 406: * or the newly created jspawnh

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v3]

2023-05-17 Thread Volker Simonis
> Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a tiny helper program called > `jspawnhelper` in a subproc

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v2]

2023-05-17 Thread Volker Simonis
On Wed, 17 May 2023 13:46:29 GMT, Thomas Stuefe wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added test case > > src/java.base/unix/native/jspawnhelper/jspawnhelper.c line 140: > >> 138: struct stat buf;

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v2]

2023-05-17 Thread Volker Simonis
On Wed, 17 May 2023 14:10:59 GMT, Thomas Stuefe wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added test case > > src/java.base/unix/native/libjava/ProcessImpl_md.c line 490: > >> 488: pid_t resultPid; >>

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v2]

2023-05-17 Thread Thomas Stuefe
On Wed, 17 May 2023 16:05:58 GMT, Volker Simonis wrote: >> src/java.base/unix/native/jspawnhelper/jspawnhelper.c line 140: >> >>> 138: struct stat buf; >>> 139: /* argv[0] contains the fd number to read all the child info */ >>> 140: int r, fdinr, fdinw, fdout; >> >> Since you are h

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v3]

2023-05-17 Thread Roger Riggs
On Wed, 17 May 2023 16:00:23 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v3]

2023-05-18 Thread Thomas Stuefe
On Wed, 17 May 2023 16:00:23 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v2]

2023-05-18 Thread Thomas Stuefe
On Wed, 17 May 2023 16:12:15 GMT, Volker Simonis wrote: >> src/java.base/unix/native/libjava/ProcessImpl_md.c line 490: >> >>> 488: pid_t resultPid; >>> 489: int i, offset, rval, bufsize, magic; >>> 490: char *buf, buf1[24]; >> >> Since you are here could you please increase buffer

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v3]

2023-05-22 Thread Volker Simonis
On Wed, 17 May 2023 17:08:34 GMT, Roger Riggs wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> REALLY adding the test :) > > test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java line 116: > >> 114:

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v3]

2023-05-22 Thread Volker Simonis
On Wed, 17 May 2023 17:01:53 GMT, Roger Riggs wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> REALLY adding the test :) > > test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java line 63: > >> 61: i

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v3]

2023-05-22 Thread Volker Simonis
On Wed, 17 May 2023 17:05:54 GMT, Roger Riggs wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> REALLY adding the test :) > > test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java line 78: > >> 76: p

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v3]

2023-05-22 Thread Volker Simonis
On Wed, 17 May 2023 17:07:13 GMT, Roger Riggs wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> REALLY adding the test :) > > test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java line 106: > >> 104:

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v4]

2023-05-22 Thread Volker Simonis
> Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a tiny helper program called > `jspawnhelper` in a subproc

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v3]

2023-05-22 Thread Volker Simonis
On Thu, 18 May 2023 05:58:26 GMT, Thomas Stuefe wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> REALLY adding the test :) > > src/java.base/unix/native/libjava/childproc.c line 413: > >> 411: const char* env

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v4]

2023-05-22 Thread Roger Riggs
On Mon, 22 May 2023 10:22:16 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v4]

2023-05-22 Thread Joe Darcy
On Mon, 22 May 2023 10:22:16 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v4]

2023-05-23 Thread Marius Lichtblau
On Mon, 22 May 2023 10:22:16 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v4]

2023-05-23 Thread Volker Simonis
On Mon, 22 May 2023 10:22:16 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v4]

2023-05-23 Thread Thomas Stuefe
On Mon, 22 May 2023 10:22:16 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v4]

2023-05-23 Thread Volker Simonis
On Tue, 23 May 2023 05:34:15 GMT, Thomas Stuefe wrote: >> Volker Simonis has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains five commits: >> >> - Merge branch 'master' into JDK-8307990 >> - Address comments from tstuefe and RogerRi

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v5]

2023-05-23 Thread Volker Simonis
> Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a tiny helper program called > `jspawnhelper` in a subproc

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v5]

2023-05-23 Thread Roger Riggs
On Tue, 23 May 2023 14:21:06 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v6]

2023-05-24 Thread Volker Simonis
> Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a tiny helper program called > `jspawnhelper` in a subproc

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v7]

2023-05-25 Thread Volker Simonis
> Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a tiny helper program called > `jspawnhelper` in a subproc

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v7]

2023-05-25 Thread Volker Simonis
On Thu, 25 May 2023 15:25:40 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v7]

2023-05-26 Thread Thomas Stuefe
On Thu, 25 May 2023 15:25:40 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v7]

2023-05-26 Thread Roger Riggs
On Thu, 25 May 2023 15:25:40 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v8]

2023-05-30 Thread Volker Simonis
> Since JDK13, executing commands in a sub-process defaults to the so called > `POSIX_SPAWN` launching mechanism (i.e. > `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by > using `posix_spawn(3)` to firstly start a tiny helper program called > `jspawnhelper` in a subproc

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v7]

2023-05-30 Thread Volker Simonis
On Thu, 25 May 2023 15:25:40 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v7]

2023-05-30 Thread Volker Simonis
On Fri, 26 May 2023 17:23:01 GMT, Thomas Stuefe wrote: > Still think it would be cleaner and simpler to set the FD in the parent to > CLOEXEC, before doing posix_spawn, and at the same time set the childStuff > variable to -1 to prevent the child from attempting to re-close it. > Reconsider?

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v8]

2023-06-01 Thread Thomas Stuefe
On Tue, 30 May 2023 13:19:37 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta