public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "safinaskar at mail dot ru" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/30759] New: Comment on SPAWN_ERROR is wrong
Date: Mon, 14 Aug 2023 19:46:58 +0000	[thread overview]
Message-ID: <bug-30759-131@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 30759
           Summary: Comment on SPAWN_ERROR is wrong
           Product: glibc
           Version: 2.40
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: safinaskar at mail dot ru
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Consider
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/spawni.c;h=ec687cb4238bac10a113ab924ea9b05500142b88;hb=1b214630ce6f7e0099b8b6f87246246739b079cf#l55
. The comment is wrong, because actual value of this macro (SPAWN_ERROR) in
fact is never used! Let me tell you why.

The only use site of this macro is
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/spawni.c;h=ec687cb4238bac10a113ab924ea9b05500142b88;hb=1b214630ce6f7e0099b8b6f87246246739b079cf#l306
. But, as well as I understand in this place args->err is non-zero. Then in
parent we expect this args->err in line
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/spawni.c;h=ec687cb4238bac10a113ab924ea9b05500142b88;hb=1b214630ce6f7e0099b8b6f87246246739b079cf#l417
. It is non-zero, so we fail to __waitpid. __waitpid doesn't save process
status, so the status (i. e. SPAWN_ERROR) is never observed.

So, I propose removing confusing comment. Also macro SPAWN_ERROR itself should
be removed, too. "_exit (SPAWN_ERROR)" should be replaced with "_exit(1) /*
This value is never observed */"

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

             reply	other threads:[~2023-08-14 19:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 19:46 safinaskar at mail dot ru [this message]
2023-08-16 12:15 ` [Bug libc/30759] " adhemerval.zanella at linaro dot org
2023-08-16 14:25 ` safinaskar at mail dot ru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30759-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).