bugfindutils - Bugs: bug #31424, _SC_ARG_MAX is unreliable on...


bug #31424: _SC_ARG_MAX is unreliable on Interix

Submitted by:  James Youngman <jay>
Submitted on:  Sat 23 Oct 2010 11:37:40 AM UTC  
Category:  xargs Severity:  3 - Normal
Item Group:  Wrong result Status:  Works For Me
Privacy:  Public Assigned to:  James Youngman <jay>
Originator Name:  Markus Duft Open/Closed:  Closed
Release:  None Fixed Release:  None

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sat 28 May 2011 11:46:14 PM UTC, comment #5: 

There was subsequent traffic on the bug-findutils list about this. 

The gnnulib library has recently opted to make suacomp mandatory for using gnulib on Windows.   So, I'm leaving suacomp to deal with ARG_MAX and _SC_ARG_MAX, and at Markus's request I'm reverting change 107af5aa0cd8cb6551e12c3ed0c21066f0fbd19f:


James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 11 May 2011 08:28:00 AM UTC, comment #4: 

No response. Closing as obsolete.   Please reopen if there is new information.

James Youngman <jay>
Project AdministratorIn charge of this item.
Sat 02 Apr 2011 10:06:42 PM UTC, comment #3: 

Hmm, I haven't made any subsequent code changes.  But this bug has been open for long enough that the problem in Interix may have been solved.   Any news?

James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 27 Oct 2010 11:14:06 PM UTC, comment #2: 

The patch does not work.   Markus writes an update:

owh - spoke too soon. there is no more problem with the too long argument list, but unfortunately, i now get "xargs: environment is too large for exec" all over the place (not always, but in  situations with increased environment :))

James Youngman <jay>
Project AdministratorIn charge of this item.
Sat 23 Oct 2010 11:50:07 AM UTC, comment #1: 

If we can't rely on _SC_ARG_MAX we need to make sure we adjust both find and xargs.  I've applied and pushed the attached patch.

(file #21763)

James Youngman <jay>
Project AdministratorIn charge of this item.
Sat 23 Oct 2010 11:37:40 AM UTC, original submission:  

I recently updated my findutils builds on interix (work without
any patches (except a gnulib patch i already submitted), thanks
for the great work ;) ), and stumbled across a small problem:

mduft xargs $ find /usr/ | ./xargs
./xargs: /bin/echo: Cannot allocate memory

mduft xargs $ ./xargs --show-limits
Your environment variables take up 3119 bytes
POSIX upper limit on argument length (this system): 1043409
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 1040290
Size of command buffer we are actually using: 131072

It seems that max argument length is too high...

Now, i'm pretty aware that interix is doing many things wrong, and sysconf(_SC_ARG_MAX) may well return a much too high number, but to consistently handle such cases, would it be wise to cap the max argument length to a sane value in xargs?

James Youngman <jay>
Project AdministratorIn charge of this item.


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jay (Markus Duft )
  • -email is unavailable- added by jay (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-05-28 jay Carbon-Copy- => Added markus.duft@salomon.at
    2011-05-11 jay StatusNeed Info => Works For Me
        Open/ClosedOpen => Closed
    2011-04-02 jay StatusNone => Need Info
    2010-10-27 jay StatusFixed => None
    2010-10-23 jay StatusNone => Fixed
    2010-10-23 jay Attached File- => Added 0001-Savannah-bug-31424-Work-around-Interix-bug-in-_SC_AR.patch, #21763

    Back to the top

    Powered by Savane 3.5