[llvm-bugs] [Bug 24889] New: clang crash emitting code for placement delete

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 20 19:35:36 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24889

            Bug ID: 24889
           Summary: clang crash emitting code for placement delete
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ethan54 at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 14911
  --> https://llvm.org/bugs/attachment.cgi?id=14911&action=edit
Source file that reproduces the issue

Ubuntu clang version 3.8.0-svn247666-1~exp1 (trunk) (based on LLVM 3.8.0)

The following (also attached) reproduces the issue:

#include <new>

class Test {
public:
  Test() {}

  static void New() {
    char buf[1000];
    new (buf) Test;
  }

  static void operator delete(void*, void*) throw() {}
  static void operator delete(void*) throw() {}
};

int main(int argc, char** argv) {
  Test::New();
  return 0;
}

Compiling triggers a segfault:

0  libLLVM-3.8.so.1 0x00007fec5458fb58
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 56
1  libLLVM-3.8.so.1 0x00007fec5458f016 llvm::sys::RunSignalHandlers() + 54
2  libLLVM-3.8.so.1 0x00007fec5458f17b
3  libpthread.so.0  0x00007fec52b15d10
4  clang            0x0000000000a11d65
clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo
const&, llvm::Value*, clang::CodeGen::ReturnValueSlot,
clang::CodeGen::CallArgList const&, clang::\
Decl const*, llvm::Instruction**) + 8101
5  clang            0x0000000000a5aaa1
6  clang            0x0000000000a5e401
7  clang            0x0000000000a20110
8  clang            0x0000000000a21931
clang::CodeGen::CodeGenFunction::PopCleanupBlock(bool) + 4337
9  clang            0x0000000000a22353
clang::CodeGen::CodeGenFunction::DeactivateCleanupBlock(clang::CodeGen::EHScopeStack::stable_iterator,
llvm::Instruction*) + 147
10 clang            0x0000000000a625ec
clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(clang::CXXNewExpr const*) +
3708
11 clang            0x0000000000a7655c
12 clang            0x0000000000a76e70
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 64
13 clang            0x0000000000a413fa
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 90
14 clang            0x0000000000a4e9cf
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 47
15 clang            0x000000000092efba
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 202
16 clang            0x000000000092f3ff
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 95
17 clang            0x0000000000952e82
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) + 178
18 clang            0x0000000000959ca3
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 739
19 clang            0x000000000097f573
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 307
20 clang            0x000000000097f910
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 288
21 clang            0x000000000097fa82
clang::CodeGen::CodeGenModule::EmitDeferred() + 130
22 clang            0x000000000097fbc9 clang::CodeGen::CodeGenModule::Release()
+ 9
23 clang            0x00000000008da96e
24 clang            0x0000000000af178d clang::ParseAST(clang::Sema&, bool,
bool) + 893
25 clang            0x00000000007191ce clang::FrontendAction::Execute() + 302
26 clang            0x00000000006f2da9
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 313
27 clang            0x00000000006da143
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1843
28 clang            0x00000000006d2440 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 2336
29 clang            0x00000000006cfcc8 main + 1192
30 libc.so.6        0x00007fec52236a40 __libc_start_main + 240
31 clang            0x00000000006d14a9 _start + 41

-- 
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/20150921/d2fb221c/attachment.html>


More information about the llvm-bugs mailing list