Gcc/Glibc bug?

Andrew Heath fake at email.com
Sat Jan 3 17:54:23 PST 2004


mwright at acad.stedwards.edu wrote:
> Using LFS-5.0.
> 
> Followed the GCC, Glibc, and Binutils build instructions exactly. Ran all 
> test suites and got the expected results.
> 
> Used these to build the entire LFS system with no problems.
> 
> 
> Now, if I write a file:
> 
> /* 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!
> 
> 
> What's weird is that this seems to only occur when I try to assign 0 to
> *p. If I replace 0 with any other number, positive or negative, I get the 
> expected result (a core dump).
> 
> 
> Can anyone reproduce this? Has anyone experienced this before? Is it

I shouldn't expect to be able to reproduce this behaviour at all. You 
are playing with undefined behaviour; that you got any sort of 
indication of a problem with your program is just luck.

> peculiar to LFS? I tried to reproduce it on a non-LFS system and
> couldn't. Then again, it wouldn't core dump there, either.
> 
> If it's not LFS-specific, I assume I need to submit a bug report to Gcc
> or Glibc, but I'd like to know which one most likely has the problem (or
> if it's a problem in something else like Binutils that's causing it).
>

No bug, no problem, just a peculiarity of your system.

> 
> Thanks for any advice.
> 
> 




More information about the lfs-support mailing list