[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Segfaults & ld.so wierditude



Hey all

Not sure ohw many programmers there are here, but I thought I'd throw it
out there.

I've been having some strange problems programming something recently:
my code uses random functions.  I was getting segfaults in fixup(),
strdup() and even malloc() (!!!!!) in glibc (can't remember exactly
when I got what) with a backtrace showing _dl_resolve[something] amongst
other things, when, I believe, I called any of srandom(), srand() or
srand48() (I tried all) to seed the random functions.

Removing the srandXXX() calls solved the problem, but, obvisouly, didn't
help.

I thought it was due to me using the glibc-debug (unstripped) libraries
(which I do by placing export LD_LIBRARY_PATH, LD_RUN_PATH, etc in my
.bashrc.)  So, I used a different user account without those envars set
and it still crashed. However, _compiling_ with that account and then
running didn't segfault, on either accounts.  So, I removed the envars
from .bashrc on the main account and then set about getting on with the
stipped glibcs.

All was fine until, for absolutely no reason, I start getting segfaults
in strdup(), with backstraces to __libc_start_main() !!!  I don't have
LD_LIBRARY_PATH or anything even set, and before I was using
glibc-debug, gdb couldn't even report __libc_start_main().  Something
very very strange is going on.

Any help would much be appreciated.  I can post the code if needed.

Cheers,

Bob

PS oh, yeah, just remembered, the _dl_XXX() calls (of which there were
sometimes more than one in the backtraces) and some others which gdb
couldn't find the names of were reported as being from
/lib/ld-linux.so.2.

--
Bob Ham:  bob [at] timecity.org   http://flux.mentaltempt.org/~node/
IRC: 'Bob' on irc.openprojects.net: #Slashdot #TimeCity
ICQ: 4396425 'The Tek' & 27699423 'The Tek.'

Time City Level Designer
Time City: http://www.timecity.org/
My work: http://flux.mentaltempt.org/~node/tc/

This email is Copyright (C) 2000 Robert Ham.  Copyright is protected in law
in the UK and by treaty in other countries. Permission to reproduce is
strictly forbidden.  If you wish to reproduce this email's content, please
apply by email to bob [at] timecity.org.

---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.