segfault with static programs that don't use stdio functions

Khem Raj raj.khem at gmail.com
Thu Dec 11 01:06:20 UTC 2008


On (11/12/08 01:57), Denys Vlasenko wrote:
> On Wednesday 10 December 2008 15:57, Tino Keitel wrote:
> > So, _stdio_init() was called because the NULL check failed for some
> > reason:
> > 
> >     if (likely(_stdio_init != NULL))
> >         _stdio_init();
> > 
> > Without the likely(), the segfault also happens.
> 
> gcc thinks that function address is never NULL. Check assembly.
> I bet condition check got optimized away.

try -fno-delete-null-pointer-checks for experimenting.



More information about the uClibc mailing list