mailing list of musl libc
 help / color / mirror / code / Atom feed
* hm, libc crashes  loading libc
@ 2012-06-01 22:18 aep
  2012-06-01 22:59 ` aep
  2012-06-02  4:03 ` Rich Felker
  0 siblings, 2 replies; 9+ messages in thread
From: aep @ 2012-06-01 22:18 UTC (permalink / raw)
  To: musl

with git 9ea20dcbaafe790bb034adadf05698088a2f9fab

this stuff scares me, so i'll just dump the relevant information, 
hoping someone knows what to do with it.

aep@nightbringer: /tmp echo "int main() {} " | musl-gcc -x c++ -
aep@nightbringer: /tmp ./a.out
zsh: segmentation fault  ./a.out


#0  find_sym (dso=0x7ffff7ff8a00, s=s@entry=0x7ffff7d7801d "__cgt", 
need_def=0) at src/ldso/dynlink.c:131
#1  0x00007ffff7d811a0 in do_relocs (dso=0x7ffff7ff8a00, 
strings=0x7ffff7d74d50 "", syms=0x7ffff7d6bdc8, rel_size=624, 
rel=0x7ffff7d786e8, base=0x7ffff7d69000 "\177ELF\002\001\001", 
stride=<optimized out>) at src/ldso/dynlink.c:161
#2  reloc_all (p=p@entry=0x7ffff7ff8a80) at src/ldso/dynlink.c:481
#3  0x00007ffff7d82667 in __dynlink (argc=<optimized out>, 
argv=<optimized out>) at src/ldso/dynlink.c:643
#4  0x00007ffff7d831e2 in _start () at src/ldso/x86_64/start.s:6
#5  0x0000000000000001 in ?? ()
#6  0x00007fffffffe77e in ?? ()
#7  0x0000000000000000 in ?? ()


reakpoint 1, reloc_all (p=p@entry=0x7ffff7ff8a80) at 
src/ldso/dynlink.c:472
472	{
(gdb) print p
$1 = (struct dso *) 0x7ffff7ff8a80
(gdb) p p->name
$3 = 0x7ffff7dcc012 "libc.so"

(gdb) step
Program received signal SIGSEGV, Segmentation fault.
find_sym (dso=0x7ffff7ff8a00, s=s@entry=0x7ffff7d7801d "__cgt", 
need_def=0) at src/ldso/dynlink.c:131
131			sym = lookup(s, h, dso->syms, dso->hashtab, dso->strings);
(gdb) print dso
$2 = (struct dso *) 0x7ffff7ff8a00
(gdb) step
lookup (strings=0x400308 "", hashtab=0x0, syms=0x400278, h=6642148, 
s=0x7ffff7d7801d "__cgt") at src/ldso/dynlink.c:111
111		for (i=hashtab[2+h%hashtab[0]]; i; i=hashtab[2+hashtab[0]+i]) {
(gdb) step

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)



hashtab=0x0 sounds wrong, but how did it become zero?


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-06-03 11:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-01 22:18 hm, libc crashes loading libc aep
2012-06-01 22:59 ` aep
2012-06-02  4:03 ` Rich Felker
2012-06-02 11:03   ` aep
2012-06-02 13:30   ` aep
2012-06-02 20:32     ` Rich Felker
2012-06-02 21:18       ` aep
2012-06-02 21:41         ` Rich Felker
2012-06-03 11:27           ` aep

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).