bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: gnulib posix_spawn_file_actions_addclose


From: Bruno Haible
Subject: Re: Fwd: gnulib posix_spawn_file_actions_addclose
Date: Wed, 07 Sep 2022 19:29:11 +0200

Hi Uwe,

> It looks like you are the author of the posix_spawn
> implementation in gnulib

Ulrich Drepper wrote most of the part for the Unix platforms;
I wrote the implementation for native Windows.

> so I wanted to ask a question privately before spamming bug-gnulib.

Better direct all questions to the mailing list.
1. So that you don't have to wait in times when I am not available.
2. So that the discussions are available for later reference.

> On a systems with musl-1.2.3 for its libc the gnulib configure (as
> part of m4 1.4.19) detects:
> 
> $ grep spawn .log.configure 
> checking for spawn.h... yes
> checking for posix_spawn_file_actions_addchdir_np... yes
> checking for posix_spawn_file_actions_addchdir... no
> checking for library containing posix_spawn... none required
> checking for posix_spawn... yes
> checking whether posix_spawn is declared... yes
> checking whether posix_spawn works... yes
> checking whether posix_spawn rejects scripts without shebang... yes
> checking whether posix_spawnp rejects scripts without shebang... yes
> checking whether posix_spawnattr_setschedpolicy is supported... yes
> checking whether posix_spawnattr_setschedparam is supported... yes
> checking for posix_spawnattr_t... yes
> checking for posix_spawn_file_actions_t... yes
> checking whether posix_spawn_file_actions_addclose works... yes
> checking whether posix_spawn_file_actions_adddup2 works... no
> checking whether posix_spawn_file_actions_addopen works... no
> 
> 
> The addclose configure test succeeds b/c of this commit:
> 
>   
> https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=36a838b081de0d2c62970df5b4b8d736d3aebe1d
> 
> that makes configure test a negative fd instead of a large fd.

Yes.

> However tests/test-posix_spawn_file_actions_addclose.c still tests for
> a large fd too and fails that test.

Yes. I believe the test verifies one of the assertions by POSIX [1].

> I wonder if either test-posix_spawn_file_actions_addclose.c should not
> check for the "big" fd (and neither should spawn_faction_addclose.c
> too?)  or the configure check should be reverted to check for the
> "big" fd to make the two match.

I believe it's a POSIX compliance bug in musl libc, but Rich Felker
disagrees. [2][3][4]

Bruno

[1] 
https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn_file_actions_addclose.html
[2] https://www.openwall.com/lists/musl/2019/03/24/2
[3] https://www.openwall.com/lists/musl/2019/03/24/5
[4] https://www.openwall.com/lists/musl/2019/03/24/7






reply via email to

[Prev in Thread] Current Thread [Next in Thread]