[Top][All Lists]

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

[bug #63070] posix_spawn fails to run a child process.

From: Dmitry Goncharov
Subject: [bug #63070] posix_spawn fails to run a child process.
Date: Tue, 20 Sep 2022 20:55:27 -0400 (EDT)

Follow-up Comment #10, bug #63070 (project make):

In glibc-2.17 posix_spawn returns 0 whether POSIX_SPAWN_USEVFORK is set or
When POSIX_SPAWN_USEVFORK is not set posix_spawn returns 0 and errno is 0.
When POSIX_SPAWN_USEVFORK is set posix_spawn returns 0 and errno is ENOEXEC.

However, today i realized one aspect that we overlooked. There is this
configure check which is supposed to disable posix_spawn.
Why was posix_spawn enabled on this box?

This is the configure check for posix_spawn.

       #include <spawn.h>
       #include <string.h>

       extern char **environ;

       int main() {
         char* path = strdup("./non-existent");
         char *argv[[2]];
         argv[[0]] = path;
         argv[[1]] =  0;
         return posix_spawn(0, path, 0, 0, argv, environ);
       [make_cv_synchronous_posix_spawn="no (cross-compiling)"])]))

This check contains a memory leak of string "./non-existent". i specify
-fsanitize=leak and this leak causes the test to fail.
when the test fails configure mistakenly treats this failure as a posix_spawn
return code being non zero and enables posix_spawn.

We can fix this configure check and keep job.c intact.


Reply to this item at:


Message sent via Savannah

reply via email to

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