[LLVMbugs] [Bug 16260] New: Clang fails to compile code with Segmentation Fault
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Jun 7 03:42:43 PDT 2013
http://llvm.org/bugs/show_bug.cgi?id=16260
Bug ID: 16260
Summary: Clang fails to compile code with Segmentation Fault
Product: clang
Version: 3.2
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: 0coming.soon at gmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Clang fails to compile the following code
$ cat main.cpp
#include <list>
#include <memory>
template <typename T>
class CreateTypes
{
public:
CreateTypes()
{
[] (...)
{
}
(
(
m_types.push_back(std::unique_ptr<T>(new T()))
)
);
}
private:
std::list<std::unique_ptr<int>> m_types;
};
int main()
{
CreateTypes<int> createTypes;
return 0;
}
$ # No matter if use -stdlib=libc++ instead of libstdc++
$ clang++ -std=c++11 main.cpp
0 libLLVM-3.2.so 0xb6d35c98
1 libLLVM-3.2.so 0xb6d36064
2 linux-gate.so.1 0xb7726400 __kernel_sigreturn + 0
3 libLLVM-3.2.so 0xb6e7d9c5
llvm::SelectionDAGBuilder::LowerCallTo(llvm::ImmutableCallSite, llvm::SDValue,
bool, llvm::MachineBasicBlock*) + 677
4 libLLVM-3.2.so 0xb6e89aff
llvm::SelectionDAGBuilder::visitInvoke(llvm::InvokeInst const&) + 687
5 libLLVM-3.2.so 0xb6e69257 llvm::SelectionDAGBuilder::visit(unsigned int,
llvm::User const&) + 1383
6 libLLVM-3.2.so 0xb6e8f157
llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 71
7 libLLVM-3.2.so 0xb6ea202d
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 61
8 libLLVM-3.2.so 0xb6ea394b
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 1195
9 libLLVM-3.2.so 0xb6ea4724
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 916
10 libLLVM-3.2.so 0xb6916f8e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 126
11 libLLVM-3.2.so 0xb6668819
llvm::FPPassManager::runOnFunction(llvm::Function&) + 537
12 libLLVM-3.2.so 0xb6668a6c llvm::FPPassManager::runOnModule(llvm::Module&) +
76
13 libLLVM-3.2.so 0xb6668c78 llvm::MPPassManager::runOnModule(llvm::Module&) +
472
14 libLLVM-3.2.so 0xb6668d91 llvm::PassManagerImpl::run(llvm::Module&) + 113
15 libLLVM-3.2.so 0xb6668dd6 llvm::PassManager::run(llvm::Module&) + 38
16 clang 0x0838c2cb
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 3899
17 clang 0x08389b48
18 clang 0x084e440c clang::ParseAST(clang::Sema&, bool, bool) + 604
19 clang 0x08241b3c clang::ASTFrontendAction::ExecuteAction() + 108
20 clang 0x08388b3a clang::CodeGenAction::ExecuteAction() + 42
21 clang 0x08242248 clang::FrontendAction::Execute() + 88
22 clang 0x08220935
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 261
23 clang 0x0820a4f7
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1479
24 clang 0x08205838 cc1_main(char const**, char const**, char const*,
void*) + 1224
25 clang 0x082042b1 main + 8081
26 libc.so.6 0xb5f9b7c3 __libc_start_main + 243
27 clang 0x08204865
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple i386-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
main.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu pentium4
-target-linker-version 2.23.2 -momit-leaf-frame-pointer -resource-dir
/usr/bin/../lib/clang/3.2 -fmodule-cache-path /var/tmp/clang-module-cache
-internal-isystem
/usr/lib/gcc/i686-pc-linux-gnu/4.8.1/../../../../include/c++/4.8.1
-internal-isystem
/usr/lib/gcc/i686-pc-linux-gnu/4.8.1/../../../../include/c++/4.8.1/i686-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/i686-pc-linux-gnu/4.8.1/../../../../include/c++/4.8.1/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.2/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/soon/Src/C++/main -ferror-limit 19
-fmessage-length 80 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/main-qaDTzu.o -x c++ main.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'main.cpp'.
4. Running pass 'X86 DAG->DAG Instruction Selection' on function
'@_ZN11CreateTypesIiEC2Ev'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.2 (tags/RELEASE_32/final)
Target: i386-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/main-51VESR.cpp
clang: note: diagnostic msg: /tmp/main-51VESR.sh
clang: note: diagnostic msg:
Second attachment(/tmp/main-51VESR.sh):
/usr/bin/clang -cc1 -triple i386-pc-linux-gnu -emit-obj -mrelax-all
-disable-free -disable-llvm-verifier -main-file-name main.cpp
-mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu pentium4
-target-linker-version 2.23.2 -momit-leaf-frame-pointer -std=c++11
-fdeprecated-macro -ferror-limit 19 -fmessage-length 80 -mstackrealign
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -x c++ main-51VESR.cpp
--
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/20130607/161e88df/attachment.html>
More information about the llvm-bugs
mailing list