Re: svn commit: r285803 - head/bin/ls

2015-07-24 Thread Allan Jude

On 2015-07-24 13:58, Antoine Brodin wrote:

On Wed, Jul 22, 2015 at 9:58 PM, Allan Jude allanj...@freebsd.org wrote:

Author: allanjude (doc committer)
Date: Wed Jul 22 19:58:21 2015
New Revision: 285803
URL: https://svnweb.freebsd.org/changeset/base/285803

Log:
   Remove an excess space accidently introduced in the output in ls(1) by 
r285734

   Spotted by:   dim
   Approved by:  eadler (mentor)
   Sponsored by: ScaleEngine Inc.
   Differential Revision:https://reviews.freebsd.org/D3152

Modified:
   head/bin/ls/print.c


Hi,

Some recent (less than 5 days old) changes on ls(1) broke it on i386,
and more than 8000 ports are affected by this.

See for instance
http://beefy3.nyi.freebsd.org/data/head-i386-default/p392703_s285807/logs/errors/autoconf-2.69.log

 From the log:
%%%
gmake[3]: Entering directory
'/wrkdirs/usr/ports/devel/autoconf/work/autoconf-2.69/doc'
Segmentation fault (core dumped)
../build-aux/mdate-sh: failed parsing 'ls -L -l -d -n /' output
Updating ./version.texi
%%%
It used to build fine with r285732 and doesn't work anymore at r285807.

Cheers,

Antoine




Modified: head/bin/ls/print.c
==
--- head/bin/ls/print.c Wed Jul 22 19:55:32 2015(r285802)
+++ head/bin/ls/print.c Wed Jul 22 19:58:21 2015(r285803)
@@ -456,7 +456,7 @@ printtime(const char *field, time_t ftim
 snprintf(fmt, sizeof(fmt), {d:%s/%%hs} , field);
 xo_attr(value, %ld, (long) ftime);
 xo_emit(fmt, longstring);
-   snprintf(fmt, sizeof(fmt), {en:%s/%%ld} , field);
+   snprintf(fmt, sizeof(fmt), {en:%s/%%ld}, field);
 xo_emit(fmt, (long) ftime);
  }




The r285734 change didn't explicitly cast some references to uid_t, 
resulting in a segfault on i386. Clang generated a warning about this 
immediately while I was debugging when I duplicated the xo_emit command 
as a printf.


Can we teach our clang that xo_emit is printf, and so the same 
formatting type matching should be checked? That would be very helpful.


I have posted a review for the fix: https://reviews.freebsd.org/D3191

--
Allan Jude
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r285803 - head/bin/ls

2015-07-24 Thread Pedro Giffuni



On 07/24/15 14:10, Allan Jude wrote:

...




The r285734 change didn't explicitly cast some references to uid_t, 
resulting in a segfault on i386. Clang generated a warning about this 
immediately while I was debugging when I duplicated the xo_emit 
command as a printf.


Can we teach our clang that xo_emit is printf, and so the same 
formatting type matching should be checked? That would be very helpful.




Perhaps something like this? (untested)

Pedro.


Index: contrib/libxo/libxo/xo.h
===
--- contrib/libxo/libxo/xo.h	(revision 285847)
+++ contrib/libxo/libxo/xo.h	(working copy)
@@ -160,10 +160,10 @@
 xo_emit_hv (xo_handle_t *xop, const char *fmt, va_list vap);
 
 int
-xo_emit_h (xo_handle_t *xop, const char *fmt, ...);
+xo_emit_h (xo_handle_t *xop, const char *fmt, ...) PRINTFLIKE(2, 3) ;
 
 int
-xo_emit (const char *fmt, ...);
+xo_emit (const char *fmt, ...) PRINTFLIKE(1, 2);
 
 int
 xo_open_container_h (xo_handle_t *xop, const char *name);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org

Re: svn commit: r285803 - head/bin/ls

2015-07-24 Thread Allan Jude

On 2015-07-24 15:41, Pedro Giffuni wrote:



On 07/24/15 14:10, Allan Jude wrote:

...




The r285734 change didn't explicitly cast some references to uid_t,
resulting in a segfault on i386. Clang generated a warning about this
immediately while I was debugging when I duplicated the xo_emit
command as a printf.

Can we teach our clang that xo_emit is printf, and so the same
formatting type matching should be checked? That would be very helpful.



Perhaps something like this? (untested)

Pedro.




Yes, jhb@ pointed me in the same direction, and I have already submitted 
it upstream. It seems they already had it on some things, just not the 
most useful case.


https://github.com/Juniper/libxo/pull/45


--
Allan Jude
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r285803 - head/bin/ls

2015-07-24 Thread Antoine Brodin
On Wed, Jul 22, 2015 at 9:58 PM, Allan Jude allanj...@freebsd.org wrote:
 Author: allanjude (doc committer)
 Date: Wed Jul 22 19:58:21 2015
 New Revision: 285803
 URL: https://svnweb.freebsd.org/changeset/base/285803

 Log:
   Remove an excess space accidently introduced in the output in ls(1) by 
 r285734

   Spotted by:   dim
   Approved by:  eadler (mentor)
   Sponsored by: ScaleEngine Inc.
   Differential Revision:https://reviews.freebsd.org/D3152

 Modified:
   head/bin/ls/print.c

Hi,

Some recent (less than 5 days old) changes on ls(1) broke it on i386,
and more than 8000 ports are affected by this.

See for instance
http://beefy3.nyi.freebsd.org/data/head-i386-default/p392703_s285807/logs/errors/autoconf-2.69.log

From the log:
%%%
gmake[3]: Entering directory
'/wrkdirs/usr/ports/devel/autoconf/work/autoconf-2.69/doc'
Segmentation fault (core dumped)
../build-aux/mdate-sh: failed parsing 'ls -L -l -d -n /' output
Updating ./version.texi
%%%
It used to build fine with r285732 and doesn't work anymore at r285807.

Cheers,

Antoine



 Modified: head/bin/ls/print.c
 ==
 --- head/bin/ls/print.c Wed Jul 22 19:55:32 2015(r285802)
 +++ head/bin/ls/print.c Wed Jul 22 19:58:21 2015(r285803)
 @@ -456,7 +456,7 @@ printtime(const char *field, time_t ftim
 snprintf(fmt, sizeof(fmt), {d:%s/%%hs} , field);
 xo_attr(value, %ld, (long) ftime);
 xo_emit(fmt, longstring);
 -   snprintf(fmt, sizeof(fmt), {en:%s/%%ld} , field);
 +   snprintf(fmt, sizeof(fmt), {en:%s/%%ld}, field);
 xo_emit(fmt, (long) ftime);
  }


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r285803 - head/bin/ls

2015-07-22 Thread Allan Jude
Author: allanjude (doc committer)
Date: Wed Jul 22 19:58:21 2015
New Revision: 285803
URL: https://svnweb.freebsd.org/changeset/base/285803

Log:
  Remove an excess space accidently introduced in the output in ls(1) by r285734
  
  Spotted by:   dim
  Approved by:  eadler (mentor)
  Sponsored by: ScaleEngine Inc.
  Differential Revision:https://reviews.freebsd.org/D3152

Modified:
  head/bin/ls/print.c

Modified: head/bin/ls/print.c
==
--- head/bin/ls/print.c Wed Jul 22 19:55:32 2015(r285802)
+++ head/bin/ls/print.c Wed Jul 22 19:58:21 2015(r285803)
@@ -456,7 +456,7 @@ printtime(const char *field, time_t ftim
snprintf(fmt, sizeof(fmt), {d:%s/%%hs} , field);
xo_attr(value, %ld, (long) ftime);
xo_emit(fmt, longstring);
-   snprintf(fmt, sizeof(fmt), {en:%s/%%ld} , field);
+   snprintf(fmt, sizeof(fmt), {en:%s/%%ld}, field);
xo_emit(fmt, (long) ftime);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org