<html>
<head>
<base href="http://llvm.org/bugs/" />
</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 lies about --disable-aslr and leaves ASLR enabled"
href="http://llvm.org/bugs/show_bug.cgi?id=20658">20658</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LLDB lies about --disable-aslr and leaves ASLR enabled
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</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@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Reporter</th>
<td>chandlerc@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>david.majnemer@gmail.com, tfiala@google.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>A transcript follows:
% cat x.cpp
int main() {
int *ip = new int(42);
return *ip;
}
% nl x.cpp
1 int main() {
2 int *ip = new int(42);
3 return *ip;
4 }
% clang++ -g -o x x.cpp
% lldb -- ./x
Current executable set to './x' (x86_64).
(lldb) b x.cpp:3
Breakpoint 1: where = x`main + 43 at x.cpp:3, address = 0x000000000040065b
(lldb) process launch --disable-aslr
Process 7581 launching
Process 7581 launched: './x' (x86_64)
Process 7581 stopped
* thread #1: tid = 7581, , name = 'x'
frame #0:
Process 7581 stopped
* thread #1: tid = 7581, 0x000000000040065b x`main + 43 at x.cpp:3, name = 'x',
stop reason = breakpoint 1.1
frame #0: 0x000000000040065b x`main + 43 at x.cpp:3
1 int main() {
2 int *ip = new int(42);
-> 3 return *ip;
4 }
(lldb) p ip
(int *) $0 = 0x0000000001ed9010
(lldb) process launch --disable-aslr
There is a running process, kill it and restart?: [Y/n] y
Process 7581 exited with status = 0 (0x00000000)
Process 15338 launching
Process 15338 launched: './x' (x86_64)
Process 15338 stopped
* thread #1: tid = 15338, 0x00007ff3b04432d0, name = 'x'
frame #0:
Process 15338 stopped
* thread #1: tid = 15338, 0x000000000040065b x`main + 43 at x.cpp:3, name =
'x', stop reason = breakpoint 1.1
frame #0: 0x000000000040065b x`main + 43 at x.cpp:3
1 int main() {
2 int *ip = new int(42);
-> 3 return *ip;
4 }
(lldb) p ip
(int *) $1 = 0x000000000234e010
Nope! Let's try GDB:
% gdb --args ./x
Reading symbols from ./x...done.
(gdb) b x.cpp:3
Breakpoint 1 at 0x40065b: file x.cpp, line 3.
(gdb) r
Starting program: /usr/local/google/home/chandlerc/tmp/x
Breakpoint 1, main () at x.cpp:3
3 return *ip;
(gdb) p ip
$1 = (int *) 0x403010
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/local/google/home/chandlerc/tmp/x
Breakpoint 1, main () at x.cpp:3
3 return *ip;
(gdb) p ip
$2 = (int *) 0x403010
Yep. That's what I wanted.
Also, please make this the default and make the flag '--enable-aslr'. I really
never, ever want my debugger to default to ASLR. I only want that when I'm
chasing a bug which manifests in no other way.</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>