[LLVMbugs] [Bug 16892] New: Clang fails to diagnose (ICE: segfault) taking address of a destructor

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


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

            Bug ID: 16892
           Summary: Clang fails to diagnose (ICE: segfault) taking address
                    of a destructor
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ainsaar at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following input (test.cpp),...

struct S{};
void (S::*f)() = &S::~S;

... when run through "clang++ test.cpp", gives a segmentation fault with the
following backtrace. GCC, on the other hand, gives a correct error message
("error: taking address of destructor ‘S::~S’").

0  libLLVM-3.3.so  0x00007fc812c107e2 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  libLLVM-3.3.so  0x00007fc812c10639
2  libpthread.so.0 0x0000003e15410bf0
3  clang           0x000000000085acd0
clang::CodeGen::CodeGenFunction::EmitDeleteCall(clang::FunctionDecl const*,
llvm::Value*, clang::QualType) + 32
4  clang           0x0000000000802279
5  clang           0x000000000080f79f
6  clang           0x0000000000810799
clang::CodeGen::CodeGenFunction::PopCleanupBlock(bool, clang::SourceLocation) +
3289
7  clang           0x0000000000809112
clang::CodeGen::CodeGenFunction::EmitDestructorBody(clang::CodeGen::FunctionArgList&)
+ 242
8  clang           0x00000000007a1e00
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 1616
9  clang           0x00000000007f38c3
clang::CodeGen::CodeGenModule::EmitCXXDestructor(clang::CXXDestructorDecl
const*, clang::CXXDtorType) + 163
10 clang           0x00000000007b3241
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 465
11 clang           0x00000000007b4a70
clang::CodeGen::CodeGenModule::EmitDeferred() + 144
12 clang           0x00000000007b4aa9 clang::CodeGen::CodeGenModule::Release()
+ 9
13 clang           0x000000000079119b
14 clang           0x00000000008eba52 clang::ParseAST(clang::Sema&, bool, bool)
+ 514
15 clang           0x00000000006414f9 clang::FrontendAction::Execute() + 185
16 clang           0x00000000006245aa
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 282
17 clang           0x000000000060e55a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1514
18 clang           0x00000000006092e8 cc1_main(char const**, char const**, char
const*, void*) + 840
19 clang           0x00000000006082f9 main + 7385
20 libc.so.6       0x0000003e1482460d __libc_start_main + 237
21 clang           0x0000000000608e01
Stack dump:
0.      Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
test.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 2.23.1 -resource-dir /usr/bin/../lib/clang/3.3
-internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.3/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/siim/prog/test -ferror-limit 19 -fmessage-length
194 -mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -o /tmp/test-MqoqLb.o -x c++ test.cpp
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      test.cpp:1:10: Generating code for declaration 'S::~S'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-pc-linux-gnu
Thread model: posix

-- 
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/20130815/d7a0ebbd/attachment.html>


More information about the llvm-bugs mailing list