mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: Re: Segmentation fault in static binaries built with recent binutils
Date: Wed, 18 Jul 2018 21:00:24 +0200	[thread overview]
Message-ID: <20180718190024.GL4418@port70.net> (raw)
In-Reply-To: <20180718181438.nl4e333zkzw36rzl@reiner-h.de>

* Reiner Herrmann <reiner@reiner-h.de> [2018-07-18 20:14:38 +0200]:
> > Can you attach a readelf -a of the binary that's crashing?
> 
> The output is attached.

i could reproduce the crash in a debian:unstable docker image

i see incorrect auxv[AT_PHDR] value, not yet sure why.


Program received signal SIGSEGV, Segmentation fault.
static_init_tls (aux=aux@entry=0x7fffffffebc0) at ../src/env/__init_tls.c:88
88			if (phdr->p_type == PT_PHDR)
(gdb) disas
Dump of assembler code for function static_init_tls:
   0x0000000000401404 <+0>:	sub    $0x8,%rsp
   0x0000000000401408 <+4>:	mov    0x18(%rdi),%r9
   0x000000000040140c <+8>:	mov    0x28(%rdi),%rsi
   0x0000000000401410 <+12>:	xor    %ecx,%ecx
   0x0000000000401412 <+14>:	xor    %eax,%eax
   0x0000000000401414 <+16>:	mov    %r9,%rdx
   0x0000000000401417 <+19>:	test   %rsi,%rsi
   0x000000000040141a <+22>:	je     0x401456 <static_init_tls+82>
=> 0x000000000040141c <+24>:	mov    (%rdx),%r8d
...
(gdb) p/x aux[3]
$4 = 0x400040
(gdb) i proc map
process 13499
Mapped address spaces:

          Start Addr           End Addr       Size     Offset objfile
            0x401000           0x402000     0x1000     0x1000 /musl/build/a.out
            0x402000           0x403000     0x1000     0x2000 /musl/build/a.out
            0x403000           0x405000     0x2000     0x2000 /musl/build/a.out
      0x7ffff7ffa000     0x7ffff7ffd000     0x3000        0x0 [vvar]
      0x7ffff7ffd000     0x7ffff7fff000     0x2000        0x0 [vdso]
      0x7ffffffde000     0x7ffffffff000    0x21000        0x0 [stack]
(gdb) i reg
rax            0x0	0
rbx            0x0	0
rcx            0x0	0
rdx            0x400040	4194368
rsi            0x5	5
rdi            0x7fffffffebc0	140737488350144
rbp            0x1	0x1
rsp            0x7fffffffeb90	0x7fffffffeb90
r8             0x4015a1	4199841
r9             0x400040	4194368
r10            0x0	0
r11            0x0	0
r12            0x7fffffffed58	140737488350552
r13            0x401127	4198695
r14            0x0	0
r15            0x0	0
rip            0x40141c	0x40141c <static_init_tls+24>
eflags         0x10206	[ PF IF RF ]
cs             0x33	51
ss             0x2b	43
ds             0x0	0
es             0x0	0
fs             0x0	0
gs             0x0	0




  reply	other threads:[~2018-07-18 19:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18 16:39 Reiner Herrmann
2018-07-18 17:37 ` Rich Felker
2018-07-18 18:14 ` Reiner Herrmann
2018-07-18 19:00   ` Szabolcs Nagy [this message]
2018-07-18 19:38     ` Szabolcs Nagy
2018-07-18 20:19       ` Szabolcs Nagy
2018-07-18 20:24         ` Szabolcs Nagy
2018-07-18 20:50         ` Rich Felker
2018-07-18 20:53         ` Reiner Herrmann
2018-07-18 21:37           ` Szabolcs Nagy
2018-07-18 21:49             ` Reiner Herrmann

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=20180718190024.GL4418@port70.net \
    --to=nsz@port70.net \
    --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).