Re: posix_spawn facility

2023-07-31 Thread Corinna Vinschen via Cygwin
Hi Eric, On Jul 31 13:58, Eric Blake via Cygwin wrote: > Following up on an older thread: > > On Tue, Apr 18, 2023 at 03:49:20PM -0500, Eric Blake wrote: > > The glibc bug points to the sample posix_spawn() implementation in > > POSIX XRAT - but that example implementation is non-normative and >

Re: posix_spawn facility

2023-07-31 Thread Eric Blake via Cygwin
Following up on an older thread: On Tue, Apr 18, 2023 at 03:49:20PM -0500, Eric Blake wrote: > The glibc bug points to the sample posix_spawn() implementation in > POSIX XRAT - but that example implementation is non-normative and > known buggy, so it is not safe to rely on it. > > Clarifying the

Re: posix_spawn facility

2023-05-10 Thread gs-cygwin.com--- via Cygwin
On Thu, Apr 20, 2023 at 04:00:15PM -0400, gs-cygwin@gluelogic.com wrote: > On Thu, Apr 20, 2023 at 09:31:38PM +0200, Bruno Haible wrote: > > Glenn wrote: > > > > > https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-startupinfoexa > > > > > > > > > > and the PROC_THREAD_ATTR

Re: posix_spawn facility

2023-05-10 Thread gs-cygwin.com--- via Cygwin
On Thu, Apr 20, 2023 at 03:14:59AM -0400, gs-cygwin@gluelogic.com wrote: > On Mon, Apr 17, 2023 at 08:44:51PM +0200, Bruno Haible via Cygwin wrote: > > Btw, there are two more functions in the posix_spawn family meanwhile: > > * posix_spawn_file_actions_addchdir_np > > implemented by glib

Re: posix_spawn facility

2023-04-20 Thread gs-cygwin.com--- via Cygwin
On Thu, Apr 20, 2023 at 09:31:38PM +0200, Bruno Haible wrote: > Glenn wrote: > > > > https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-startupinfoexa > > > > > > > > and the PROC_THREAD_ATTRIBUTE_HANDLE_LIST argument described in > > > > > > > > https://learn.microsoft.com/en

Re: posix_spawn facility

2023-04-20 Thread Bruno Haible via Cygwin
Glenn wrote: > > > https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-startupinfoexa > > > > > > and the PROC_THREAD_ATTRIBUTE_HANDLE_LIST argument described in > > > > > > https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-updateprocthr

Re: posix_spawn facility

2023-04-20 Thread gs-cygwin.com--- via Cygwin
On Thu, Apr 20, 2023 at 05:40:52PM +0200, Corinna Vinschen via Cygwin wrote: > On Apr 20 16:58, Bruno Haible via Cygwin wrote: > > Corinna Vinschen wrote: > > > > Hmm. Your code uses lpReserved2 for that, but the functionality is > > > > one implemented in MSVCRT. For obvious reasons, Cygwin exec

Re: posix_spawn facility

2023-04-20 Thread gs-cygwin.com--- via Cygwin
On Thu, Apr 20, 2023 at 04:58:20PM +0200, Bruno Haible via Cygwin wrote: > Corinna Vinschen wrote: > > > Hmm. Your code uses lpReserved2 for that, but the functionality is > > > one implemented in MSVCRT. For obvious reasons, Cygwin executables > > > are not linked against msvcrt.dll and we're us

Re: posix_spawn facility

2023-04-20 Thread gs-cygwin.com--- via Cygwin
On Thu, Apr 20, 2023 at 04:40:52PM +0200, Corinna Vinschen via Cygwin wrote: > On Apr 20 16:21, Corinna Vinschen via Cygwin wrote: > > On Apr 20 12:18, Bruno Haible via Cygwin wrote: > > > The "inheritable handles" is a data structure that allows for the > > > arbitrary reshuffling of fil

Re: posix_spawn facility

2023-04-20 Thread Corinna Vinschen via Cygwin
On Apr 20 16:58, Bruno Haible via Cygwin wrote: > Corinna Vinschen wrote: > > > Hmm. Your code uses lpReserved2 for that, but the functionality is > > > one implemented in MSVCRT. For obvious reasons, Cygwin executables > > > are not linked against msvcrt.dll and we're using lpReserved2 for our >

Re: posix_spawn facility

2023-04-20 Thread Bruno Haible via Cygwin
Corinna Vinschen wrote: > > Hmm. Your code uses lpReserved2 for that, but the functionality is > > one implemented in MSVCRT. For obvious reasons, Cygwin executables > > are not linked against msvcrt.dll and we're using lpReserved2 for our > > own purposes. > > Oh, btw., did you know that there'

Re: posix_spawn facility

2023-04-20 Thread Corinna Vinschen via Cygwin
On Apr 20 16:21, Corinna Vinschen via Cygwin wrote: > On Apr 20 12:18, Bruno Haible via Cygwin wrote: > > The "inheritable handles" is a data structure that allows for the > > arbitrary reshuffling of file descriptors required by posix_spawn > > (the addopen, adddup2, addclose action

Re: posix_spawn facility

2023-04-20 Thread Corinna Vinschen via Cygwin
On Apr 20 12:18, Bruno Haible via Cygwin wrote: > Corinna Vinschen wrote: > > Unfortunately you can't expect any noticable difference on Cygwin by > > using posix_spawn. While Cygwin has a spawn() family of functions, we > > don't (and can't... yet) use them. > > > > The problem is that we don't

Re: posix_spawn facility

2023-04-20 Thread Bruno Haible via Cygwin
Corinna Vinschen wrote: > Unfortunately you can't expect any noticable difference on Cygwin by > using posix_spawn. While Cygwin has a spawn() family of functions, we > don't (and can't... yet) use them. > > The problem is that we don't have a safe way to perform the spawn > attributes and file a

Re: posix_spawn facility

2023-04-20 Thread Corinna Vinschen via Cygwin
On Apr 20 03:14, gs-cygwin.com--- via Cygwin wrote: > On Mon, Apr 17, 2023 at 08:44:51PM +0200, Bruno Haible via Cygwin wrote: > > Btw, there are two more functions in the posix_spawn family meanwhile: > > * posix_spawn_file_actions_addchdir_np > > implemented by glibc [1], musl libc, macOS,

Re: posix_spawn facility

2023-04-20 Thread gs-cygwin.com--- via Cygwin
On Mon, Apr 17, 2023 at 08:44:51PM +0200, Bruno Haible via Cygwin wrote: > Btw, there are two more functions in the posix_spawn family meanwhile: > * posix_spawn_file_actions_addchdir_np > implemented by glibc [1], musl libc, macOS, FreeBSD [2], Solaris ≥ 11.3 > used by a few packages (Fi

Re: posix_spawn facility

2023-04-19 Thread Csaba Raduly via Cygwin
On Wed, 19 Apr 2023 at 13:56, Bruno Haible via Cygwin wrote: > Note a typo: line 126541 is on page 3694 not on page 3594. > That sentence is scary in and of itself :) Csaba -- You can get very substantial performance improvements by not doing the right thing. - Scott Meyers, An Effective C++11/

Re: posix_spawn facility

2023-04-19 Thread Bruno Haible via Cygwin
Eric Blake wrote: > POSIX issue now filed as > https://www.austingroupbugs.net/view.php?id=1674 Thank you very much! Note a typo: line 126541 is on page 3694 not on page 3594. Bruno -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Docum

Re: posix_spawn facility

2023-04-19 Thread Bruno Haible via Cygwin
I wrote: > * posix_spawn_file_actions_addfchdir_np > implemented in glibc, musl libc Correction: posix_spawn_file_actions_addfchdir_np is implemented in glibc, musl libc, FreeBSD ≥ 13.1, macOS ≥ 10.15. Bruno -- Problem reports: https://cygwin.com/problems.html FAQ:

Re: posix_spawn facility

2023-04-19 Thread Corinna Vinschen via Cygwin
Hi Bruno, On Apr 17 20:44, Bruno Haible via Cygwin wrote: > Btw, there are two more functions in the posix_spawn family meanwhile: > * posix_spawn_file_actions_addchdir_np > implemented by glibc [1], musl libc, macOS, FreeBSD [2], Solaris ≥ 11.3 > used by a few packages (Firefox, Chromiu

Re: posix_spawn facility

2023-04-19 Thread Corinna Vinschen via Cygwin
On Apr 18 21:39, Eric Blake via Cygwin wrote: > On Wed, Apr 19, 2023 at 12:10:34AM +0200, Bruno Haible wrote: > > Eric Blake wrote: > > > we now have implementations in the wild that differ in behavior, and > > > use security as a reason for the divergence, it is worth getting that > > > clarified

Re: posix_spawn facility

2023-04-18 Thread Eric Blake via Cygwin
On Wed, Apr 19, 2023 at 12:10:34AM +0200, Bruno Haible wrote: > Eric Blake wrote: > > we now have implementations in the wild that differ in behavior, and > > use security as a reason for the divergence, it is worth getting that > > clarified in POSIX. I'll file a bug against POSIX shortly > > Fo

Re: posix_spawn facility

2023-04-18 Thread Bruno Haible via Cygwin
Eric Blake wrote: > we now have implementations in the wild that differ in behavior, and > use security as a reason for the divergence, it is worth getting that > clarified in POSIX. I'll file a bug against POSIX shortly For the reference, the systems that return ENOEXEC for posix_spawnp attempti

Re: posix_spawn facility

2023-04-18 Thread Corinna Vinschen via Cygwin
Hi Eric, On Apr 18 15:49, Eric Blake via Cygwin wrote: > On Tue, Apr 18, 2023 at 11:25:11AM +0200, Corinna Vinschen via Cygwin wrote: > Jumping in to this conversation a bit belatedly, but as someone on the > Austin Group that can try to get an answer upstream... Many thanks for your input, it's

Re: posix_spawn facility

2023-04-18 Thread Eric Blake via Cygwin
On Tue, Apr 18, 2023 at 11:25:11AM +0200, Corinna Vinschen via Cygwin wrote: > Hi Bruno, > > On Apr 17 20:44, Bruno Haible via Cygwin wrote: > > Hi Corinna, Jumping in to this conversation a bit belatedly, but as someone on the Austin Group that can try to get an answer upstream... > But I'm not

Re: posix_spawn facility

2023-04-18 Thread Corinna Vinschen via Cygwin
Hi Bruno, On Apr 17 20:44, Bruno Haible via Cygwin wrote: > Hi Corinna, > > > > Would it be possible to change Cygwin's posix_spawnp implementation, > > > so that both tests succeed? > > > > Basically, yes, but... > > Thanks! > > > > Disclaimer: I have done my tests with Cygwin 2.9.0; so, if t

Re: posix_spawn facility

2023-04-17 Thread Bruno Haible via Cygwin
Hi Corinna, > > Would it be possible to change Cygwin's posix_spawnp implementation, > > so that both tests succeed? > > Basically, yes, but... Thanks! > > Disclaimer: I have done my tests with Cygwin 2.9.0; so, if things have > >

Re: posix_spawn facility

2023-04-17 Thread Corinna Vinschen via Cygwin
Hi Bruno, On Apr 16 13:46, Bruno Haible via Cygwin wrote: > Hi, > > AFAIU, Cygwin has a working posix_spawn[p] implementation since 2020 > (commit 3fbfcd11fb09d5f47af3043ee47ec5c7d863d872, 2020-08-03, Cygwin 3.1.7). > [

posix_spawn facility

2023-04-16 Thread Bruno Haible via Cygwin
Hi, AFAIU, Cygwin has a working posix_spawn[p] implementation since 2020 (commit 3fbfcd11fb09d5f47af3043ee47ec5c7d863d872, 2020-08-03, Cygwin 3.1.7). Additionally, Gnulib has a posix_spawn[p] implementation since 2022, that works on all platforms, including native Windows. Based on it, I recommen