[PATCH 4/6] elf: Replace alloca with dl_scratch_buffer in _dl_load_cache_lookup

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Fri May 15 12:48:54 GMT 2026



On 14/05/26 23:02, H.J. Lu wrote:

>> +
>> +static int
>> +do_test (void)
>> +{
>> +  /* Sanity: from the main thread (no stack pressure needed).  */
>> +  dlopen_via_cache (NULL);
>> +
>> +  /* The motivating scenario: from a PTHREAD_STACK_MIN thread.  Before
>> +     _dl_load_cache_lookup was converted to dl_scratch_buffer this would
>> +     have alloca'd ~3 KB mid-dlopen and risked overflowing.  */
>> +  pthread_attr_t attr;
>> +  xpthread_attr_init (&attr);
>> +  xpthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN);
> 
> Does it work for Hurd?

It does not, I will send a new version.



More information about the Libc-alpha mailing list