Seeking advice on writing a test [Re: [patch] Fix BZ 20419 -- stack overflow with huge PT_NOTE segment]

Florian Weimer fweimer@redhat.com
Mon May 14 09:59:00 GMT 2018


On 05/14/2018 01:31 AM, Paul Pluzhnikov wrote:
> I wrote a program to generate DSO with that many Phdr[]s, and confirmed
> that "ld.so --list foo.so" passes with default 8MiB stack, but crashes with
> anything below 6600KiB with SIGSEGV due to stack overflow.
> 
> I think it's reasonable to expect "ld.so --list foo.so" to be able to run
> successfully with 1MiB (or even 128K) stack.

Well, if those are LOAD segments, then with tight limits you will run 
into VM limitations anyway.  But I see your point.

> My generator program is mostly machine independent, except it needs to set
> e_ident[EI_DATA] and e_machine appropriately.
> 
> The easiest approach is to put this program and the test into
> sysdeps/x86_64 and make this x86_64-only test. Would that be acceptable?

It should be a generic test is possible.

Could you read the required values from the ELF header of the current 
executable?

Thanks,
Florian



More information about the Libc-alpha mailing list