mailing list of musl libc
 help / color / mirror / code / Atom feed
* musl-1.1.22 -static segfaults in __init_tls
@ 2019-04-15 10:59 Sami Farin
  2019-04-15 13:07 ` Szabolcs Nagy
  0 siblings, 1 reply; 3+ messages in thread
From: Sami Farin @ 2019-04-15 10:59 UTC (permalink / raw)
  To: musl; +Cc: hvtaifwkbgefbaei

Fedora 29 Linux, gcc-8.3.1-2.fc29, x86_64 kernel 4.19.33.

$ cat musl_crash.c; musl-gcc musl_crash.c -static; ./a.out
int main(int argc, char* argv[]) {
    return 0;
}

Segmentation fault
$ gcc -static musl_crash.c; ./a.out
$

Program received signal SIGSEGV, Segmentation fault.
0x000000000040145c in __init_tls ()
(gdb) d32
Dump of assembler code from 0x40143c to 0x40147c:
   0x000000000040143c <__init_tls+12>:	xor    %ecx,%ecx
   0x000000000040143e <__init_tls+14>:	push   %rbp
   0x000000000040143f <__init_tls+15>:	xor    %edx,%edx
   0x0000000000401441 <__init_tls+17>:	mov    $0x800000,%ebp
   0x0000000000401446 <__init_tls+22>:	push   %rbx
   0x0000000000401447 <__init_tls+23>:	mov    0x18(%rdi),%r11
   0x000000000040144b <__init_tls+27>:	mov    $0x0,%ebx
   0x0000000000401450 <__init_tls+32>:	mov    0x28(%rdi),%r9
   0x0000000000401454 <__init_tls+36>:	mov    %r11,%rax
   0x0000000000401457 <__init_tls+39>:	test   %r9,%r9
   0x000000000040145a <__init_tls+42>:	je     0x4014b3 <__init_tls+131>
=> 0x000000000040145c <__init_tls+44>:	mov    (%rax),%esi
   0x000000000040145e <__init_tls+46>:	cmp    $0x6,%esi
   0x0000000000401461 <__init_tls+49>:	jne    0x401468 <__init_tls+56>
   0x0000000000401463 <__init_tls+51>:	mov    %r11,%rcx
   0x0000000000401466 <__init_tls+54>:	jmp    0x401475 <__init_tls+69>
   0x0000000000401468 <__init_tls+56>:	cmp    $0x2,%esi
   0x000000000040146b <__init_tls+59>:	jne    0x40147b <__init_tls+75>
   0x000000000040146d <__init_tls+61>:	test   %rbx,%rbx
   0x0000000000401470 <__init_tls+64>:	je     0x4014aa <__init_tls+122>
   0x0000000000401472 <__init_tls+66>:	mov    %rbx,%rcx
   0x0000000000401475 <__init_tls+69>:	sub    0x10(%rax),%rcx
   0x0000000000401479 <__init_tls+73>:	jmp    0x4014aa <__init_tls+122>
   0x000000000040147b <__init_tls+75>:	cmp    $0x7,%esi
End of assembler dump.
(gdb) p $rax
$1 = 4194368


-- 



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

end of thread, other threads:[~2019-04-15 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15 10:59 musl-1.1.22 -static segfaults in __init_tls Sami Farin
2019-04-15 13:07 ` Szabolcs Nagy
2019-04-15 15:10   ` Sami Farin

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).