bugfindutils - Bugs: bug #16738, find does not subtract environment...

 
 

bug #16738: find does not subtract environment size from ARG_MAX

Submitter:  Geoff Clare <geoffclare>
Submitted:  Fri 02 Jun 2006 04:52:48 PM UTC
   
 
Category:  find Severity:  4 - Important
Item Group:  Wrong result Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Geoff Clare Open/Closed:  Closed
Release:  4.2.27 Fixed Release:  4.2.28
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 05 Aug 2006 05:47:23 PM UTC, comment #2: 

Fixed in the development code.  The bug will be fixed in releases 4.2.28 (stable branch) and 4.3.1 (unstable branch).

James Youngman <jay>
Group administrator
Sat 22 Jul 2006 11:45:46 AM UTC, comment #1: 

I believe the attached test script reproduces the problem.

James Youngman <jay>
Group administrator
Fri 02 Jun 2006 04:52:48 PM UTC, original submission:  

In xargs.c there is the following code:

  /* Take the size of the environment into account.  */
  if (size_of_environment > posix_arg_size_max)
    {
      bc_ctl.arg_max = 0;
      env_too_big = 1;
    }
  else
    {
      bc_ctl.arg_max = posix_arg_size_max - size_of_environment;
    }

The equivalent code is missing from find.  This means that if
the environment passed to find is too large, it can produce
exec() errors when "{} +" is used:

$ env | wc -c
    1953
$ find . -exec true {} +
$ FOO=$(printf '%1024s' x) env | wc -c
    2982
$ FOO=$(printf '%1024s' x) find . -exec true {} +  
find: true: Argument list too long
find: true: Argument list too long

Geoff Clare <geoffclare>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #10412:  sv-bug-16738.sh added by jay (6KiB - application/x-shellscript - Updated updated script)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 11 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-08-05 jay Open/ClosedOpen Closed
    Fixed ReleaseNone 4.2.28
2006-08-05 jay StatusIn Progress Fixed
2006-07-24 jay Attached File#10399 Removed
2006-07-24 jay Attached File- Added sv-bug-16738.sh, #10412
2006-07-22 jay Attached File#10398 Removed
2006-07-22 jay Attached File- Added sv-bug-16738.sh, #10399
2006-07-22 jay Severity3 - Normal 4 - Important
    StatusNone In Progress
    Assigned toNone jay
    Attached File- Added sv-bug-16738.sh, #10398

Back to the top

Powered by Savane 3.14-8aba.
Corresponding source code