Gcc/Glibc bug?

johan johan at gvd.dyn.dhs.org
Tue Jan 6 17:55:32 PST 2004


Joel Miller wrote:

> 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.

Indeed, seems that I missed the point. Causing segfaults is not one of my
hobbys :)



More information about the lfs-support mailing list