Gcc/Glibc bug?

johan johan at gvd.dyn.dhs.org
Mon Jan 5 16:26:48 PST 2004


> /* dumpcore.c
>  * Intentionally produces a segmentation violation
>  */
> 
> int main()
> {
>     int *p;
>     *p = 0;
> }
> 
> it compiles fine.
> 
> 
> When I try to run the resulting executable, however, I get this:
> 
> Inconsistency detected by ld.so: dl-fini.c: 66: _dl_fini: Assertion `i ==
> _rtld_local._dl_nloaded' failed!

the pointer p is pointing to an undefined memory location. You try to assign
a value to that undefined memory location. Personally I'm not supprised
this causes a segfault. Are you sure this is what you want or did you mean:

int main {
        int *p;
        p = 0;
}



More information about the lfs-support mailing list