[lldb-dev] [Bug 23465] New: getenv() returns a null char* when debugging with lldb

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat May 9 01:50:11 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23465

            Bug ID: 23465
           Summary: getenv() returns a null char* when debugging with lldb
           Product: lldb
           Version: 3.3
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: samuel.tebbs at gmail.com
    Classification: Unclassified

When calling getenv() with a valid environment variable name, a null char* is
returned and the following error report is shown by lldb when calling "new
std::string()" with the return value of getenv():

Process 21805 stopped
* thread #1: tid = 0x172288, 0x00007fff80e61152 libsystem_c.dylib`strlen + 18,
queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1,
address=0x0)
    frame #0: 0x00007fff80e61152 libsystem_c.dylib`strlen + 18
libsystem_c.dylib`strlen:
->  0x7fff80e61152 <+18>: pcmpeqb (%rdi), %xmm0
    0x7fff80e61156 <+22>: pmovmskb %xmm0, %esi
    0x7fff80e6115a <+26>: andq   $0xf, %rcx
    0x7fff80e6115e <+30>: orq    $-0x1, %rax
(lldb) v
lldb-330.0.44

This doesn't happen when executing the compiled binary without lldb.

Using Mac OS X v10.10.3 (Yosemite)

-- 
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/20150509/0f53cad3/attachment.html>


More information about the lldb-dev mailing list