public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/29016] New: popen() sets errno to ENOMEM when shell does not exist
@ 2022-04-01 12:53 arnaud.lb at gmail dot com
  2022-12-06 15:47 ` [Bug stdio/29016] " schwab@linux-m68k.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: arnaud.lb at gmail dot com @ 2022-04-01 12:53 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29016

            Bug ID: 29016
           Summary: popen() sets errno to ENOMEM when shell does not exist
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: arnaud.lb at gmail dot com
  Target Milestone: ---

Hi

I've found that popen() sets errno to ENOMEM when shell does not exist, and I'm
not sure whether it's expected or not by looking at the man page.

Here is a small reproducer:


```
// test.c

#include <stdio.h>
#include <errno.h>
#include <string.h>

int main() {
    errno = 0;
    FILE * f = popen("/true", "r");

    fprintf(stderr, "f: %p, errno: %d, strerror: %s\n", f, errno,
strerror(errno));
}
```

```
; gcc -static -o test test.c
; sudo chroot . /test
f: (nil), errno: 12, strerror: Cannot allocate memory
```

(Using chroot here to execute the program in an environment without /bin/sh)

>From the man page I can not tell whether this is expected or not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug stdio/29016] popen() sets errno to ENOMEM when shell does not exist
  2022-04-01 12:53 [Bug stdio/29016] New: popen() sets errno to ENOMEM when shell does not exist arnaud.lb at gmail dot com
@ 2022-12-06 15:47 ` schwab@linux-m68k.org
  2022-12-07 18:26 ` sam at gentoo dot org
  2023-02-14 18:37 ` adhemerval.zanella at linaro dot org
  2 siblings, 0 replies; 4+ messages in thread
From: schwab@linux-m68k.org @ 2022-12-06 15:47 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29016

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |2.29
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg
   Last reconfirmed|                            |2022-12-06

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
posix_spawn returns the appropriate error number, but it is ignored.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug stdio/29016] popen() sets errno to ENOMEM when shell does not exist
  2022-04-01 12:53 [Bug stdio/29016] New: popen() sets errno to ENOMEM when shell does not exist arnaud.lb at gmail dot com
  2022-12-06 15:47 ` [Bug stdio/29016] " schwab@linux-m68k.org
@ 2022-12-07 18:26 ` sam at gentoo dot org
  2023-02-14 18:37 ` adhemerval.zanella at linaro dot org
  2 siblings, 0 replies; 4+ messages in thread
From: sam at gentoo dot org @ 2022-12-07 18:26 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29016

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gentoo dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug stdio/29016] popen() sets errno to ENOMEM when shell does not exist
  2022-04-01 12:53 [Bug stdio/29016] New: popen() sets errno to ENOMEM when shell does not exist arnaud.lb at gmail dot com
  2022-12-06 15:47 ` [Bug stdio/29016] " schwab@linux-m68k.org
  2022-12-07 18:26 ` sam at gentoo dot org
@ 2023-02-14 18:37 ` adhemerval.zanella at linaro dot org
  2 siblings, 0 replies; 4+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2023-02-14 18:37 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29016

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |2.38

--- Comment #2 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
Fixed on 2.38.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-14 18:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-01 12:53 [Bug stdio/29016] New: popen() sets errno to ENOMEM when shell does not exist arnaud.lb at gmail dot com
2022-12-06 15:47 ` [Bug stdio/29016] " schwab@linux-m68k.org
2022-12-07 18:26 ` sam at gentoo dot org
2023-02-14 18:37 ` adhemerval.zanella at linaro dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).