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

           Summary: Bad handling of realpath
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: NetBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: System Library
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


System/Unix/Path.inc contains the following code:

  return Path(std::string(realpath(DLInfo.dli_fname, link_path)));

realpath can fail returning a NULL pointer, as clearly documented in the man
page, and clang then segfaults as it's constructing a std::string from a NULL
pointer.

On my system (NetBSD) this happens when invoking clang through a symlink.

$ clang /tmp/bug.c
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid
Stack dump:
0.      Program arguments: clang /tmp/bug.c 
Abort trap


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to