Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2012 05:50:09 GMT
From:      Matthew Story <matthewstory@gmail.com>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/165155: [PATCH][bin][standards] xargs does not print diagnostic information on utility termination via signal, or utility exit 255
Message-ID:  <201202150550.q1F5o9UU026705@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR standards/165155; it has been noted by GNATS.

From: Matthew Story <matthewstory@gmail.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: standards/165155: [PATCH][bin][standards] xargs does not print
 diagnostic information on utility termination via signal, or utility exit 255
Date: Wed, 15 Feb 2012 00:42:39 -0500

 --bcaec5014bf3f3f9da04b8fa2daa
 Content-Type: text/plain; charset=ISO-8859-1
 
 On Tue, Feb 14, 2012 at 5:00 PM, Matthew Story <matthewstory@gmail.com>wrote:
 
 >
 > >Number:         165155
 > [...snip]
 > Patch attached with submission follows:
 >
 > diff -u a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
 > --- a/usr.bin/xargs/xargs.c     2012-01-02 22:23:44.000000000 -0500
 > +++ b/usr.bin/xargs/xargs.c     2012-02-14 16:39:20.000000000 -0500
 > @@ -608,8 +608,11 @@
 >                 * If utility signaled or exited with a value of 255,
 >                 * exit 1-125.
 >                 */
 > -               if (WIFSIGNALED(status) || WEXITSTATUS(status) == 255)
 > -                       exit(1);
 > +               if (WIFSIGNALED(status))
 > +                       errx(1, "%s: terminated with signal %d, aborting",
 > +                               name, WTERMSIG(status));
 > +               if (WEXITSTATUS(status) == 255)
 > +                       errx(1, "%s: exited with status 255, aborting",
 > name);
 >                if (WEXITSTATUS(status))
 >                        rval = 1;
 >        }
 >
 
 This fix exposes an existing, but hard to reproduce bug ( see: PR 165164:
 http://www.freebsd.org/cgi/query-pr.cgi?pr=165164 ).  The patch from PR
 165164 should be applied prior to, on along side this patch, else you will
 see a lot more:
 
 xargs: (null): error
 
 diagnostic messages.
 
 
 >
 >
 > >Release-Note:
 > >Audit-Trail:
 > >Unformatted:
 > _______________________________________________
 > freebsd-standards@freebsd.org mailing list
 > http://lists.freebsd.org/mailman/listinfo/freebsd-standards
 > To unsubscribe, send any mail to "
 > freebsd-standards-unsubscribe@freebsd.org"
 >
 
 
 
 -- 
 regards,
 matt
 
 --bcaec5014bf3f3f9da04b8fa2daa
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 On Tue, Feb 14, 2012 at 5:00 PM, Matthew Story <span dir=3D"ltr">&lt;<a hre=
 f=3D"mailto:matthewstory@gmail.com">matthewstory@gmail.com</a>&gt;</span> w=
 rote:<br><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=
 =3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 <br>
 &gt;Number: =A0 =A0 =A0 =A0 165155<br>[...snip]<br>
 Patch attached with submission follows:<br>
 <br>
 diff -u a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c<br>
 --- a/usr.bin/xargs/xargs.c =A0 =A0 2012-01-02 22:23:44.000000000 -0500<br>
 +++ b/usr.bin/xargs/xargs.c =A0 =A0 2012-02-14 16:39:20.000000000 -0500<br>
 @@ -608,8 +608,11 @@<br>
  =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * If utility signaled or exited with a val=
 ue of 255,<br>
  =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * exit 1-125.<br>
  =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */<br>
 - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (WIFSIGNALED(status) || WEXITSTATUS(status=
 ) =3D=3D 255)<br>
 - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 exit(1);<br>
 + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (WIFSIGNALED(status))<br>
 + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 errx(1, &quot;%s: terminated =
 with signal %d, aborting&quot;,<br>
 + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 name, WTERMSI=
 G(status));<br>
 + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (WEXITSTATUS(status) =3D=3D 255)<br>
 + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 errx(1, &quot;%s: exited with=
  status 255, aborting&quot;, name);<br>
  =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (WEXITSTATUS(status))<br>
  =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rval =3D 1;<br>
  =A0 =A0 =A0 =A0}<br></blockquote><div><br></div><div>This fix exposes an e=
 xisting, but hard to reproduce bug ( see: PR 165164: <a href=3D"http://www.=
 freebsd.org/cgi/query-pr.cgi?pr=3D165164">http://www.freebsd.org/cgi/query-=
 pr.cgi?pr=3D165164</a> ). =A0The patch from PR 165164 should be applied pri=
 or to, on along side this patch, else you will see a lot more:</div>
 <div><br></div><div>xargs: (null): error</div><div><br></div><div>diagnosti=
 c messages.</div><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"m=
 argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 <br>
 <br>
 &gt;Release-Note:<br>
 &gt;Audit-Trail:<br>
 &gt;Unformatted:<br>
 _______________________________________________<br>
 <a href=3D"mailto:freebsd-standards@freebsd.org">freebsd-standards@freebsd.=
 org</a> mailing list<br>
 <a href=3D"http://lists.freebsd.org/mailman/listinfo/freebsd-standards" tar=
 get=3D"_blank">http://lists.freebsd.org/mailman/listinfo/freebsd-standards<=
 /a><br>
 To unsubscribe, send any mail to &quot;<a href=3D"mailto:freebsd-standards-=
 unsubscribe@freebsd.org">freebsd-standards-unsubscribe@freebsd.org</a>&quot=
 ;<br>
 </blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>regards,<br>=
 matt<br>
 
 --bcaec5014bf3f3f9da04b8fa2daa--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202150550.q1F5o9UU026705>