Gcc/Glibc bug?

Joel Miller cheeziologist at mail.isc.rit.edu
Mon Jan 5 22:51:35 PST 2004


On Tue, 06 Jan 2004 01:26:48 +0100, johan <johan at gvd.dyn.dhs.org> wrote:

>> /* 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;
> }

you miss the point of his post. did you even read the comments on his 
code. this is bit of code is meat to cause a core dump. that is its 
purpose.

-- 
Registered LFS User 6929
Registered Linux User 298182




More information about the lfs-support mailing list