[llvm-bugs] [Bug 34556] New: C++ std::exception is NULL when compiled as ObjC++, but C++ is OK

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 11 07:40:13 PDT 2017


            Bug ID: 34556
           Summary: C++ std::exception is NULL when compiled as ObjC++,
                    but C++ is OK
           Product: clang
           Version: 5.0
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dlobron at akamai.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19133
  --> https://bugs.llvm.org/attachment.cgi?id=19133&action=edit
Minimal reproducing program, with .cc suffix

I'm observing failures on GNU/Linux (3.13.0-113-generic #160-Ubuntu SMP) when I
compile with clang/llvm-5.0.0 (the latest svn tree, checked out and built from
scratch on Sept 08, 2017), with libobjc2 as the Objective-C runtime.  The
proximate cause of the crashes is a NULL std::exception object.  This is
evident when I examine the stack from my minimal reproducer in gdb:

exceptionObject = 0x0

A more complicated program, which uses a custom C++ exception class derived
from std::exception, also shows this symptom (here, the variable "e" is of the
derived exception type):

e = @0x0: <error reading variable>

I've attached a minimal reproducing program, which is entirely C++. The crash
only occurs when compile as a .mm (Objective-C++) program.  When I compiled as
C++ (.cc), the problem goes away.

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/20170911/f7db8a39/attachment.html>

More information about the llvm-bugs mailing list