bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #49466] xargs with 2>&1 returns error code in macOS 10.12


From: Michael Cahill
Subject: [bug #49466] xargs with 2>&1 returns error code in macOS 10.12
Date: Tue, 22 Nov 2016 03:51:56 +0000 (UTC)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36

Follow-up Comment #2, bug #49466 (project findutils):

I'm seeing the same thing, here is the stack trace as reported by Apple's
crash reporter:


3   libsystem_c.dylib                   0x00007fffc9447893 __assert_rtn + 320
4   xargs                               0x0000000100e02e9f 
complain_about_leaky_fds
+ 145
5   xargs                               0x0000000100e014f3 xargs_do_exec + 532
6   xargs                               0x0000000100e024f5 bc_do_exec + 248
7   xargs                               0x0000000100e00c7d main + 3117


This change avoids the crash by not checking the file descriptors for stdin,
stdout or stderr, but tbh I can't follow all of what's going on in there:


diff -ur findutils-4.6.0/lib/fdleak.c findutils-4.6.0.patched/lib/fdleak.c
--- findutils-4.6.0/lib/fdleak.c        2015-12-29 08:10:23.000000000 +1100
+++ findutils-4.6.0.patched/lib/fdleak.c        2016-11-22 14:47:29.000000000 
+1100
@@ -294,7 +294,7 @@
   context.used = n;
   context.lookup_pos = 0;
   context.leaked_fd = -1;
-  visit_open_fds (0, max_fd, find_first_leak_callback, &context);
+  visit_open_fds (3, max_fd, find_first_leak_callback, &context);
   return context.leaked_fd;
 }


I hope that helps,
Michael.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49466>

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]