Debian Bug report logs - #319085
findutils: xargs exits with wrong status when command exits with status 1

version graph

Package: findutils; Maintainer for findutils is Andreas Metzler <ametzler@debian.org>; Source for findutils is src:findutils (PTS, buildd, popcon).

Reported by: Glenn Ammons <ammons@us.ibm.com>

Date: Tue, 19 Jul 2005 19:33:02 UTC

Severity: normal

Tags: fixed-upstream

Found in version 4.2.22-2

Fixed in version findutils/4.2.24-1

Done: Andreas Metzler <ametzler@debian.org>

Bug is archived. No further changes may be made.

Forwarded to http://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=13878

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, ammons@us.ibm.com, Andreas Metzler <ametzler@debian.org>:
Bug#319085; Package findutils. (full text, mbox, link).


Acknowledgement sent to Glenn Ammons <ammons@us.ibm.com>:
New Bug report received and forwarded. Copy sent to ammons@us.ibm.com, Andreas Metzler <ametzler@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Glenn Ammons <ammons@us.ibm.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: findutils: xargs exits with wrong status when command exits with status 1
Date: Tue, 19 Jul 2005 15:16:27 -0400
Package: findutils
Version: 4.2.22-2
Severity: normal

xargs exits with the wrong status when the command exits with status 1:

    % false; echo $?
    1
    % echo foo | xargs -t false; echo $?
    false foo
    0

The exit status ought to be 123, according to the man page:

    xargs exits with the following status:
    0 if it succeeds
    123 if any invocation of the command exited with status 1-125
    ...

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-2-386
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages findutils depends on:
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an

findutils recommends no packages.

-- no debconf information



Noted your statement that Bug has been forwarded to http://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=13878. Request was from Andreas Metzler <ametzler@debian.org> to control@bugs.debian.org. (full text, mbox, link).


Message sent on to Glenn Ammons <ammons@us.ibm.com>:
Bug#319085. (full text, mbox, link).


Message #10 received at 319085-submitter@bugs.debian.org (full text, mbox, reply):

From: Andreas Metzler <savannah-bounces@gnu.org>
To: 319085-submitter@bugs.debian.org, Andreas Metzler <gnu@downhill.at.eu.org>, bug-findutils@gnu.org
Subject: [bug #13878] xargs exits with exitcode 1 instead of 123 if invoked command fails
Date: Thu, 21 Jul 2005 17:33:27 +0000
URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13878>

                 Summary: xargs exits with exitcode 1 instead of 123 if
invoked command fails
                 Project: findutils
            Submitted by: ametzler
            Submitted on: Don 21.07.2005 um 17:33
                Category: xargs
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Glenn Ammons
        Originator Email: 319085-submitter@bugs.debian.org
             Open/Closed: Open
                 Release: 4.2.22
           Fixed Release: None

    _______________________________________________________

Details:

Hello,
this is http://bugs.debian.org/319085 reported by Glenn Ammons:

---------------------
xargs exits with the wrong status when the command exits with status 1:

    % false; echo $?
    1
    % echo foo | xargs -t false; echo $?
    false foo
    0

The exit status ought to be 123, according to the man page:

    xargs exits with the following status:
    0 if it succeeds
    123 if any invocation of the command exited with status 1-125
---------------------
I've verifioed that this applies to 4.2.22 and current CVS, 4.120 worked as
documented.
             thanks, cu andreas



    _______________________________________________________

Carbon-Copy List:

CC Address                          | Comment
------------------------------------+-----------------------------
319085-submitter@bugs.debian.org    | Originator Email




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13878>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/




Message sent on to Glenn Ammons <ammons@us.ibm.com>:
Bug#319085. (full text, mbox, link).


Message #13 received at 319085-submitter@bugs.debian.org (full text, mbox, reply):

From: James Youngman <savannah-bounces@gnu.org>
To: 319085-submitter@bugs.debian.org, Andreas Metzler <gnu@downhill.at.eu.org>, James Youngman <jay@gnu.org>, bug-findutils@gnu.org
Subject: [bug #13878] xargs exits with exitcode 1 instead of 123 if invoked command fails
Date: Fri, 22 Jul 2005 20:47:06 +0000
Update of bug #13878 (project findutils):

                  Status:                    None => Fixed                  
             Assigned to:                    None => jay                    

    _______________________________________________________

Follow-up Comment #1:

That was an interesting problem.  The issue is that child_error is changed in
wait_for_all() after exit() has already been called on (since we fall off the
end of main()).   That means that it's too late by then to change the return
value.  As a workaround for this problem we now call _exit() when this
happens, passing the correct return value.    It might have been neater to
just call wait_for_all() before returning from main().  Anyway, the attached
patch (which I have committed to the development code) fixes the problem. 

 
    _______________________________________________________

Additional Item Attachment:

File name: xargs-child-failure-exit-123.patch Size:2 KB
Fix
<http://savannah.gnu.org/bugs/download.php?item_id=13878&item_file_id=2734>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13878>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




Message sent on to Glenn Ammons <ammons@us.ibm.com>:
Bug#319085. (full text, mbox, link).


Message #16 received at 319085-submitter@bugs.debian.org (full text, mbox, reply):

From: James Youngman <savannah-bounces@gnu.org>
To: 319085-submitter@bugs.debian.org, Andreas Metzler <gnu@downhill.at.eu.org>, James Youngman <jay@gnu.org>, bug-findutils@gnu.org
Subject: [bug #13878] xargs exits with exitcode 1 instead of 123 if invoked command fails
Date: Fri, 29 Jul 2005 22:27:24 +0000
Update of bug #13878 (project findutils):

             Open/Closed:                    Open => Closed                 
           Fixed Release:                    None => 4.2.24                 


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13878>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




Reply sent to Andreas Metzler <ametzler@debian.org>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Glenn Ammons <ammons@us.ibm.com>:
Bug acknowledged by developer. (full text, mbox, link).


Message #21 received at 319085-close@bugs.debian.org (full text, mbox, reply):

From: Andreas Metzler <ametzler@debian.org>
To: 319085-close@bugs.debian.org
Subject: Bug#319085: fixed in findutils 4.2.24-1
Date: Sat, 30 Jul 2005 02:02:09 -0700
Source: findutils
Source-Version: 4.2.24-1

We believe that the bug you reported is fixed in the latest version of
findutils, which is due to be installed in the Debian FTP archive:

findutils_4.2.24-1.diff.gz
  to pool/main/f/findutils/findutils_4.2.24-1.diff.gz
findutils_4.2.24-1.dsc
  to pool/main/f/findutils/findutils_4.2.24-1.dsc
findutils_4.2.24-1_i386.deb
  to pool/main/f/findutils/findutils_4.2.24-1_i386.deb
findutils_4.2.24.orig.tar.gz
  to pool/main/f/findutils/findutils_4.2.24.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 319085@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Metzler <ametzler@debian.org> (supplier of updated findutils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 30 Jul 2005 09:14:35 +0200
Source: findutils
Binary: findutils
Architecture: source i386
Version: 4.2.24-1
Distribution: unstable
Urgency: low
Maintainer: Andreas Metzler <ametzler@debian.org>
Changed-By: Andreas Metzler <ametzler@debian.org>
Description: 
 findutils  - utilities for finding files--find, xargs, and locate
Closes: 317019 317086 318417 319085 320378
Changes: 
 findutils (4.2.24-1) unstable; urgency=low
 .
   * standards-version 3.6.2, no changes required.
   * New upstream version 4.2.24:
     - "-printf %Y %y"n works correctly again (Closes: #320378).
     - new option -regextype to finds for selecting more useful regex-variants
       than the default GNU Emacs.
     - find -exec rm -i {} \; works again. (Closes: #317019)
     - xargs exits with correct exit status 123 if invoked command returned
       non-zero returncode. (Closes: #319085)
     - xargs -I option documented in manpage. (Closes: #317086)
     - fixes to find.1 manpage (Closes: #318417)
Files: 
 a3328d1a5043dc1d2088161a73da8ae3 663 base required findutils_4.2.24-1.dsc
 f551df975740eb01ba315e33be836454 1007589 base required findutils_4.2.24.orig.tar.gz
 d5eaf1eef3a2b98aae43fe812cc4ce29 12221 base required findutils_4.2.24-1.diff.gz
 44491460bd72299539dbe4c5cf0521a2 373062 base required findutils_4.2.24-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC6z7YHTOcZYuNdmMRAhdFAKCCJGlv40HmNrszF0u/atfJBLVvCwCcD1Fk
TrPvQwhfh/3Lf87Bs/ZJMks=
=pb/t
-----END PGP SIGNATURE-----




Tags added: fixed-upstream Request was from bts-link-upstream@lists.alioth.debian.org to control@bugs.debian.org. (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 26 Jun 2007 21:47:48 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Dec 23 16:44:15 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.