[LLVMbugs] [Bug 16888] New: [-cxx-abi microsoft] static local initialization requires a guard variable

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 14 14:33:35 PDT 2013


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

            Bug ID: 16888
           Summary: [-cxx-abi microsoft] static local initialization
                    requires a guard variable
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: rnk at google.com
          Reporter: rnk at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
            Blocks: 12477
    Classification: Unclassified

Basically, MicrosoftCXXABI::EmitGuardedInit() needs work.  It has this comment:
  // FIXME: this code was only tested for global initialization.
  // Not sure whether we want thread-safe static local variables as VS
  // doesn't make them thread-safe.

Given that we can have inline functions with static locals, I believe we
actually need to match MSVC's behavior exactly down to the mangling of the
guard variable in order to be compatible.

I discovered this because LLVM's outs() has a static raw_fd_ostream for
STDOUT_FILENO, and currently we register its destructor once per call to
outs(), leading to assertions in the CRT on double-close.

-- 
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/20130814/3371509f/attachment.html>


More information about the llvm-bugs mailing list