pkgsrc-Bugs archive

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

PR/53543 CVS commit: [netbsd-8] src/usr.bin/find



The following reply was made to PR pkg/53543; it has been noted by GNATS.

From: "Martin Husemann" <martin%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/53543 CVS commit: [netbsd-8] src/usr.bin/find
Date: Mon, 10 Sep 2018 15:48:26 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Sep 10 15:48:25 UTC 2018
 
 Modified Files:
 	src/usr.bin/find [netbsd-8]: function.c
 
 Log Message:
 Pull up following revision(s) (requested by kre in ticket #1016):
 
 	usr.bin/find/function.c: revision 1.77
 
 Inspired by PR pkg/53543
 
 When calculating the length of the args that can be
 appended in a "find .... -exec something {} +"
 usage, remember to allow for the arg pointers, which
 form part of what is allowed in ARG_MAX.
 
 From a fairly empty installation of HEAD on amd64
 and with a "/tmp/args" command that simply prints
 its arg count, and the length of the arg strings,
 with this mod I see ..
 
 netbsd# find / -exec /tmp/args {} +
 Argc 5000 Arglen 107645
 Argc 5000 Arglen 151324
 Argc 5000 Arglen 187725
 Argc 5000 Arglen 206591
 Argc 5000 Arglen 172909
 Argc 5000 Arglen 186264
 Argc 5000 Arglen 167906
 Argc 2881 Arglen 98260
 
 The upper limit of 5000 args is in the code.
 
 Using the biggest of those, 5000
 args, plus 206591 bytes of strings
 uses 246591 bytes total (this excludes
 the command name, so add a few more).
 
 That's fairly close to the ARG_MAX
 of 262144.
 
 On another system (with longer paths) I see:
 (this is just a small part of the output, using a
 different version of the dummy command, and a
 slightly different invocation)
 
 Args: 4546 Len 218030
 Args: 4878 Len 217991
 Args: 4813 Len 218028
 Args: 4803 Len 218029
 
 There, 4878*8 + 217991 == 257015 which is about
 as close as we'd want to come to the arg limit.
 
 XXX pullup -8
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.75.8.1 -r1.75.8.2 src/usr.bin/find/function.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index