Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ab5e7d10a265901c54f6f71443a26f4@exys.org>
Date: Sat, 02 Jun 2012 00:18:55 +0200
From: aep <aep@...s.org>
To: <musl@...ts.openwall.com>
Subject: hm, libc crashes  loading libc

with git 9ea20dcbaafe790bb034adadf05698088a2f9fab

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

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


#0  find_sym (dso=0x7ffff7ff8a00, s=s@...ry=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@...ry=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@...ry=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@...ry=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?

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.