bugfindutils - Bugs: bug #42937, xargs --show-limits environment...

 
 

bug #42937: xargs --show-limits environment size subtracted twice possibly

Submitted by:  None
Submitted on:  Thu 07 Aug 2014 06:29:20 PM UTC  
 
Category: xargsSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Originator Name: Donald ZochOriginator Email: -unavailable-
Open/Closed: OpenRelease: 4.4.2
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 18 Sep 2014 08:39:42 PM UTC, comment #2:

Working on a test to check to confirm this is not happening.

Scott Jewloszewicz-Clarke <swjclarke>
Sun 10 Aug 2014 10:38:53 AM UTC, comment #1:

This seems correct to me, however, then also the output for
"POSIX upper limit on argument length (this system)"
should be fixed, too, because that should reflect the
original limit without 'size_of_environment' already being
subtracted. This amends to:

diff --git a/xargs/xargs.c b/xargs/xargs.c
index 89e78a3..673fdc0 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -696,13 +696,13 @@ main (int argc, char **argv)
(uintmax_t)bc_size_of_environment ());
fprintf (stderr,
_("POSIX upper limit on argument length (this system): %" PRIuMAX "\n"),
- (uintmax_t)bc_ctl.posix_arg_size_max);
+ (uintmax_t)bc_get_arg_max ());
fprintf (stderr,
_("POSIX smallest allowable upper limit on argument length (all systems): %" PRIuMAX "\n"),
(uintmax_t)bc_ctl.posix_arg_size_min);
fprintf (stderr,
_("Maximum length of command we could actually use: %" PRIuMAX "\n"),
- (uintmax_t)(bc_ctl.posix_arg_size_max - bc_size_of_environment ()));
+ (uintmax_t)(bc_ctl.posix_arg_size_max));
fprintf (stderr,
_("Size of command buffer we are actually using: %" PRIuMAX "\n"),
(uintmax_t)bc_ctl.arg_max);

Bernhard Voelker <berny>
Project Member
Thu 07 Aug 2014 06:29:20 PM UTC, original submission:

Hi

We have some code that parses the output of

xargs -show-limits

specifically the

"Maximum length of command we could actually use" line

We noticed when updating from findutils 4.2.30 to 4.4.2 that it appeared the
number was different and it appeared that the
environment size was being subtracted twice.

I notice in findutils 4.2.30 that line 446 in buildcmd.c doesn't actually
modify ctl->posix_arg_size_max

ctl->posix_arg_size_max - size_of_environment;

This was changed/corrected to

ctl->posix_arg_size_max -= size_of_environment;

in findutils 4.4.2, buildcmd.c line 479

So in xargs.c, should line 699 be changed to not subtract the environment again?

699,700c699
< (unsigned long)(bc_ctl.posix_arg_size_max -
< bc_size_of_environment()));
---

> (unsigned long)bc_ctl.posix_arg_size_max);


Thank you

Donald Zoch

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by swjclarke (Posted a comment)
  • -unavailable- added by berny (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1