[LLVMbugs] [Bug 13156] New: Segmentation fault on simple testcase

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 20 12:11:57 PDT 2012


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

             Bug #: 13156
           Summary: Segmentation fault on simple testcase
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: markus at trippelsdorf.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


% < test.ii
template<typename=int> struct B;
struct A
{};
template<typename> struct B : A
{};
namespace tools {
template<class F> void sch(F p1)
{
  p1(0);
}
}
void compile_and_link_test()
{
  typedef B<> F3 (int);
  F3 b;
  tools::sch(&b);
}


 % clang++ test.ii
0  clang           0x0000000001907a7f
1  clang           0x0000000001907db0
2  libpthread.so.0 0x00007f6b5dcb91a0
3  clang           0x000000000182fe4e
llvm::ConstantFoldCastInstruction(unsigned int, llvm::Constant*, llvm::Type*) +
46
4  clang           0x00000000018363ca
llvm::ConstantExpr::getBitCast(llvm::Constant*, llvm::Type*) + 42
5  clang           0x000000000077fb73
clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo
const&, llvm::Value*, clang::CodeGen::ReturnValueSlot,
clang::CodeGen::CallArgList const&, clang::Decl const*, llvm::Instruction**) +
7187
6  clang           0x00000000007b8cfe
clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, llvm::Value*,
clang::CodeGen::ReturnValueSlot, clang::ConstExprIterator,
clang::ConstExprIterator, clang::Decl const*) + 222
7  clang           0x00000000007c09e0
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot) + 288
8  clang           0x00000000007cb986
9  clang           0x00000000007c7d77
10 clang           0x00000000007c848c
clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 172
11 clang           0x00000000007b56de
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 94
12 clang           0x00000000007c2786
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 70
13 clang           0x0000000000848a27
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 263
14 clang           0x0000000000848c0f
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 239
15 clang           0x000000000084b89a
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 218
16 clang           0x0000000000848935
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 21
17 clang           0x0000000000859c29
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 489
18 clang           0x000000000074d347
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 391
19 clang           0x000000000074dec3
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 259
20 clang           0x000000000074e009
clang::CodeGen::CodeGenModule::EmitDeferred() + 233
21 clang           0x000000000074e029 clang::CodeGen::CodeGenModule::Release()
+ 9
22 clang           0x0000000000739a1a
23 clang           0x0000000000878e62 clang::ParseAST(clang::Sema&, bool, bool)
+ 578
24 clang           0x000000000061d8f1 clang::FrontendAction::Execute() + 81
25 clang           0x0000000000600a67
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 263
26 clang           0x00000000005e9c3f
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1023
27 clang           0x00000000005e1400 cc1_main(char const**, char const**, char
const*, void*) + 6528
28 clang           0x00000000005e8b73 main + 7699
29 libc.so.6       0x00007f6b5d3c46b5 __libc_start_main + 245
30 clang           0x00000000005defc9
Stack dump:
0.      Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name test.ii -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.22.52.20120518 -momit-leaf-frame-pointer -resource-dir
/usr/local/bin/../lib/clang/3.2 -fdeprecated-macro -fdebug-compilation-dir
/var/tmp -ferror-limit 19 -fmessage-length 149 -mstackrealign
-fobjc-runtime=gnu-fragile -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-CYs38o.o -x
c++-cpp-output test.ii 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      test.ii:7:24: Generating code for declaration 'tools::sch'
4.      test.ii:8:1: LLVM IR generation of compound statement ('{}')
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.2 
Target: x86_64-unknown-linux-gnu
Thread model: posix

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