[LLVMbugs] [Bug 21639] New: llvm::sys::process::get_self is not thread-safe

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 21 15:08:17 PST 2014


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

            Bug ID: 21639
           Summary: llvm::sys::process::get_self is not thread-safe
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: nico.rieck at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

llvm::sys::process::get_self() is not thread-safe (at least on Windows) because
initialization of function local statics is not thread-safe. I've been bitten
by this with random crashes when using Clang in a multi-threaded application.

As long as the minimum required MSVC version does not implement thread-safe
static initialization this should be guarded explicitly (maybe with
ManagedStatic?).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141121/8e35557a/attachment.html>


More information about the llvm-bugs mailing list