[lldb-dev] [Bug 17477] New: lldb doesn't report line number for NULL function pointer crash

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 4 07:57:44 PDT 2013


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

            Bug ID: 17477
           Summary: lldb doesn't report line number for NULL function
                    pointer crash
           Product: lldb
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: kainjow at gmail.com
    Classification: Unclassified

If a NULL function pointer is called, lldb does not report the line number
properly, however gdb does.

Here is sample code:

#include <stdio.h>

struct blah {
    void (*asdf)();
};

int main() {
    struct blah b;
    b.asdf = NULL;
    b.asdf();
    return 0;
}

When I invoke lldb on the executable and 'run', then 'bt', it gives:

$ lldb Puke 
Current executable set to 'Puke' (x86_64).
(lldb) run
Process 53327 launched: '/path/to/PUke' (x86_64)
Process 53327 stopped
* thread #1: tid = 0x37a5c9, 0x0000000000000000, queue =
'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000000000000
error: memory read failed for 0x0
(lldb) bt
* thread #1: tid = 0x37a5c9, 0x0000000000000000, queue =
'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000000000000
    frame #1: 0x00007fff97ff47e1 libdyld.dylib`start + 1


Doing the same with gdb gives:

$ gdb Puke 
(gdb) run
Starting program: /path/to/Puke 
Reading symbols for shared libraries +.............................. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000100000f64 in main () at /path/to/main.c:11
(gdb)


lldb version lldb-300.5.46 (Xcode 5).

-- 
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/20131004/135efa60/attachment.html>


More information about the lldb-dev mailing list