[lldb-dev] [Bug 20658] New: LLDB lies about --disable-aslr and leaves ASLR enabled

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 13 20:21:46 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20658

            Bug ID: 20658
           Summary: LLDB lies about --disable-aslr and leaves ASLR enabled
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: chandlerc at gmail.com
                CC: david.majnemer at gmail.com, tfiala at google.com
    Classification: Unclassified

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140814/82e71f5f/attachment.html>


More information about the lldb-dev mailing list