This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] posix: Remove dynamic memory allocation from execl{e,p}



> Em 29 de jan de 2016, Ãs 13:00, Zack Weinberg <zackw@panix.com> escreveu:
> 
> On Fri, Jan 29, 2016 at 8:53 AM, Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>> GLIBC execl{e,p} implementation might use malloc if the total number of
>> arguments exceeds initial assumption size (1024).  This might lead to
>> issues in two situations: [...]
> 
> I think it would help the discussion if you could outline the
> conditions under which these functions need to allocate memory in the
> first place.  Does it happen all the time, or only when falling back
> to non-#! shell script invocation, or what?
> 
> zw

Excel{e,p} first try to use a stack allocate buffer for up to 1024 arguments and try to allocate dynamic memory for large values (by trying to allocate memory to 2048 argument and doubling each time it does no fulfill the requirements).

These functions does not try to run shell script with shebang (different than execpe).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]