xargs on qemu has bad ARG_MAX
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qemu-linaro (Ubuntu) |
Fix Released
|
Medium
|
Riku Voipio |
Bug Description
On a qemu chroot with Ubuntu 9.04 installed:
find /usr -print0 | xargs -0r pwd
produces:
Error loading /bin/pwd
Error loading /bin/pwd
Error loading /bin/pwd
Error loading /bin/pwd
/bin/pwd: ignoring non-option arguments
/usr/src/
(pwd is just a quiet command)
note that many other 'sensible looking' commands such as
find /usr -print0 | LANG=C xargs -0r |wc
don't show the problem.
nor does
find /usr -print0 | xargs --max-chars 128000 -0r pwd
This can be fixed by changing lib/buildcmd.c : 502 to use a lower value as the "sensible_arg_max"
enum { arg_size = (128u * 1024u) };
Whilst qemu should have a higher arg_max, I think xargs is at fault since it is hitting an internal hardcoded limit.
tags: | removed: arm |
Changed in findutils (Ubuntu): | |
assignee: | David Sugar (dyfet) → nobody |
tags: | added: arm-porting-queue |
confirmed that reconfiguring xargs with ARG_SIZE= "(127u * 1024u)"
DEFAULT_
instead of the default: (128u * 1024u)
fixes the problem.
patch to debian/rules :
--- rules.orig 2009-05-05 15:44:19.000000000 +0000
+++ rules 2009-05-05 10:54:23.000000000 +0000
@@ -36,7 +36,7 @@
dh_testdir ARG_SIZE= "(127u * 1024u)" CFLAGS="$(CFLAGS)" ./configure $(confflags) \
--prefix= /usr --localstatedir =/var/cache/ locate \
--enable- d_type- optimisation \
--libexecdir= '$${prefix} /lib/locate' \
# Add here commands to configure the package.
- CFLAGS="$(CFLAGS)" ./configure $(confflags) \
+ DEFAULT_