<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - lldb step over failed in musl dyn exe (Could not create return address breakpoint)"
href="https://bugs.llvm.org/show_bug.cgi?id=50935">50935</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lldb step over failed in musl dyn exe (Could not create return address breakpoint)
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>12.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rprichard@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>With a dynamically-linked musl executable (on x86_64 gLinux aka Debian), LLDB
is unable to step over a "printf" call. The problem happens with either PIE or
non-PIE executables, but not with statically-linked musl executables. LLDB is
able to step over this call if I use glibc instead (with either the Debian gcc
or clang compiler).
I tested with both LLDB 12.0.0 and with a current LLDB build from origin/main.
$ cat >test.c <<EOF
#include <stdio.h>
int main(void) {
printf("hello!\n");
return 0;
}
EOF
$ musl-gcc test.c -g
$ file a.out
a.out: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically
linked, interpreter /lib/ld-musl-x86_64.so.1, with debug_info, not stripped
$ /x/clang12/bin/lldb a.out
(lldb) target create "a.out"
Current executable set to '/x/mess/a.out' (x86_64).
(lldb) b main
Breakpoint 1: where = a.out`main + 4 at test.c:3:3, address =
0x0000000000001159
(lldb) run
Process 235162 launched: '/x/mess/a.out' (x86_64)
Process 235162 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x0000555555555159 a.out`main at test.c:3:3
1 #include <stdio.h>
2 int main(void) {
-> 3 printf("hello!\n");
4 return 0;
5 }
(lldb) n
Process 235162 stopped
* thread #1, name = 'a.out', stop reason = step over failed (Could not create
return address breakpoint.)
frame #0: 0x0000555555555020 a.out`puts
a.out`puts:
-> 0x555555555020 <+0>: jmpq *0x2ff2(%rip) ;
_GLOBAL_OFFSET_TABLE_ + 24
0x555555555026 <+6>: pushq $0x0
0x55555555502b <+11>: jmp 0x555555555010
a.out`__libc_start_main:
0x555555555030 <+0>: jmpq *0x2fea(%rip) ;
_GLOBAL_OFFSET_TABLE_ + 32
$ /x/clang12/bin/lldb --version
lldb version 12.0.0 (<a href="https://github.com/llvm/llvm-project/">https://github.com/llvm/llvm-project/</a> revision
b978a93635b584db380274d7c8963c73989944a1)
clang revision b978a93635b584db380274d7c8963c73989944a1
llvm revision b978a93635b584db380274d7c8963c73989944a1
$ musl-gcc --version
cc (Debian 10.2.1-6+build2) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ dpkg -l musl
...
ii musl:amd64 1.2.2-1 amd64 standard C library</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>