[LLVMbugs] [Bug 7144] New: [C++ CodeGen] Erroneous __cxa_guard_abort call when throwing after a static is fully initialized

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 14 15:44:19 PDT 2010


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

           Summary: [C++ CodeGen]  Erroneous __cxa_guard_abort call when
                    throwing after a static is fully initialized
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dgregor at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
            Blocks: 6023


Created an attachment (id=4893)
 --> (http://llvm.org/bugs/attachment.cgi?id=4893)
Affected test case

When compiled with Clang, the attached test case aborts at run-time. Here's
what's happening:

  - We call __cxa_guard_acquire before initializing the static
  - We initialize the static X
  - We call __cxa_guard_release after initializing the static (good)
  - We throw Y as an exception
  - Unwinding calls __cxa_guard_abort on the static X
  - Boom!

It appears that the __cxa_guard_abort call is in the wrong EH cleanup block.
This breaks Boost.ProgramOptions.

-- 
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.



More information about the llvm-bugs mailing list