mailing list of musl libc
 help / color / mirror / code / Atom feed
From: aep <aep@exys.org>
To: <musl@lists.openwall.com>
Subject: hm, libc crashes  loading libc
Date: Sat, 02 Jun 2012 00:18:55 +0200	[thread overview]
Message-ID: <9ab5e7d10a265901c54f6f71443a26f4@exys.org> (raw)

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?


             reply	other threads:[~2012-06-01 22:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-01 22:18 aep [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ab5e7d10a265901c54f6f71443a26f4@exys.org \
    --to=aep@exys.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).