[llvm-bugs] [Bug 36999] New: Crash in compilation time with std::bad_alloc when using vector::emplace_back

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 4 07:21:31 PDT 2018


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

            Bug ID: 36999
           Summary: Crash in compilation time with std::bad_alloc when
                    using vector::emplace_back
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: j.borrego at campus.fct.unl.pt
                CC: llvm-bugs at lists.llvm.org

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
#0 0x00007fb5e49fa3c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/llvm-4.0/bin/../lib/libLLVM-4.0.so.1+0x6d43c8)
#1 0x00007fb5e49f8586 llvm::sys::RunSignalHandlers()
(/usr/lib/llvm-4.0/bin/../lib/libLLVM-4.0.so.1+0x6d2586)
#2 0x00007fb5e49f86bb (/usr/lib/llvm-4.0/bin/../lib/libLLVM-4.0.so.1+0x6d26bb)
#3 0x00007fb5e72c7150 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x13150)
#4 0x00007fb5e34580bb gsignal
/build/glibc-itYbWN/glibc-2.26/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007fb5e3459f5d abort /build/glibc-itYbWN/glibc-2.26/stdlib/abort.c:92:0
#6 0x00007fb5e3e00095 __gnu_cxx::__verbose_terminate_handler()
(/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x92095)
#7 0x00007fb5e3dfdc86 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x8fc86)
#8 0x00007fb5e3dfdcd1 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x8fcd1)
#9 0x00007fb5e3dfdf14 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x8ff14)
#10 0x00007fb5e3dfe49c (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x9049c)
#11 0x000056394fe786af std::vector<llvm::Constant*,
std::allocator<llvm::Constant*> >::reserve(unsigned long)
(/usr/lib/llvm-4.0/bin/clang+0x4656af)
#12 0x000056394fe7ef2c
clang::CodeGen::CodeGenModule::EmitConstantValue(clang::APValue const&,
clang::QualType, clang::CodeGen::CodeGenFunction*)
(/usr/lib/llvm-4.0/bin/clang+0x46bf2c)
#13 0x000056394fe7f6ef
clang::CodeGen::CodeGenModule::EmitConstantValueForMemory(clang::APValue
const&, clang::QualType, clang::CodeGen::CodeGenFunction*)
(/usr/lib/llvm-4.0/bin/clang+0x46c6ef)
#14 0x000056394fe80742
clang::CodeGen::CodeGenModule::EmitConstantInit(clang::VarDecl const&,
clang::CodeGen::CodeGenFunction*) (/usr/lib/llvm-4.0/bin/clang+0x46d742)
#15 0x000056394ffcf6b7
clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission
const&) (/usr/lib/llvm-4.0/bin/clang+0x5bc6b7)
#16 0x000056394ffd4885
clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(clang::VarDecl const&)
(/usr/lib/llvm-4.0/bin/clang+0x5c1885)
#17 0x000056394ffd4a65 clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl
const&) (/usr/lib/llvm-4.0/bin/clang+0x5c1a65)
#18 0x000056394fe8abb7
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&)
(/usr/lib/llvm-4.0/bin/clang+0x477bb7)
#19 0x000056394fe97aeb
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
(/usr/lib/llvm-4.0/bin/clang+0x484aeb)
#20 0x000056394fe938d2 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*) (/usr/lib/llvm-4.0/bin/clang+0x4808d2)
#21 0x000056394fe93edf
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/lib/llvm-4.0/bin/clang+0x480edf)
#22 0x000056394febd0b1
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) (/usr/lib/llvm-4.0/bin/clang+0x4aa0b1)
#23 0x000056394fec346d
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/lib/llvm-4.0/bin/clang+0x4b046d)
#24 0x000056394fedf028
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/lib/llvm-4.0/bin/clang+0x4cc028)
#25 0x000056394fefcbd0
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/lib/llvm-4.0/bin/clang+0x4e9bd0)
#26 0x000056394fefdaa0
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/usr/lib/llvm-4.0/bin/clang+0x4eaaa0)
#27 0x000056394fefe37a
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/usr/lib/llvm-4.0/bin/clang+0x4eb37a)
#28 0x00005639502f3a11 (/usr/lib/llvm-4.0/bin/clang+0x8e0a11)
#29 0x00005639502ed4b6 (/usr/lib/llvm-4.0/bin/clang+0x8da4b6)
#30 0x000056395052f753 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/llvm-4.0/bin/clang+0xb1c753)
#31 0x00005639501b3916 clang::FrontendAction::Execute()
(/usr/lib/llvm-4.0/bin/clang+0x7a0916)
#32 0x00005639501816fc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/llvm-4.0/bin/clang+0x76e6fc)
#33 0x0000563950249a13
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/llvm-4.0/bin/clang+0x836a13)
#34 0x000056394fe0b748 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-4.0/bin/clang+0x3f8748)
#35 0x000056394fdfdadb main (/usr/lib/llvm-4.0/bin/clang+0x3eaadb)
#36 0x00007fb5e34421c1 __libc_start_main
/build/glibc-itYbWN/glibc-2.26/csu/../csu/libc-start.c:342:0
#37 0x000056394fe09b7a _start (/usr/lib/llvm-4.0/bin/clang+0x3f6b7a)
Stack dump:
0.      Program arguments: /usr/lib/llvm-4.0/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name Main.cpp -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -coverage-notes-file
/home/joao/Documentos/ubisom/cmake-build-debug/CMakeFiles/UbiSOM.dir/Main.cpp.gcno
-resource-dir /usr/lib/llvm-4.0/bin/../lib/clang/4.0.1 -I
/home/joao/Documentos/ubisom/marrow/include -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward
-internal-isystem /usr/include/clang/4.0.1/include/ -internal-isystem
/usr/local/include -internal-isystem
/usr/lib/llvm-4.0/bin/../lib/clang/4.0.1/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Wall -std=c++14 -fdeprecated-macro
-fdebug-compilation-dir /home/joao/Documentos/ubisom/cmake-build-debug
-ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
CMakeFiles/UbiSOM.dir/Main.cpp.o -x c++ /home/joao/Documentos/ubisom/Main.cpp 
1.      <eof> parser at end of file
2.      /home/joao/Documentos/ubisom/Main.cpp:27:5: LLVM IR generation of
declaration 'main'
3.      /home/joao/Documentos/ubisom/Main.cpp:27:5: Generating code for
declaration 'main'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.1-6 (tags/RELEASE_401/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
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-1ebea3.cpp
clang: note: diagnostic msg: /tmp/Main-1ebea3.sh
clang: note: diagnostic msg: 

********************
CMakeFiles/UbiSOM.dir/build.make:62: recipe for target
'CMakeFiles/UbiSOM.dir/Main.cpp.o' failed
make[3]: *** [CMakeFiles/UbiSOM.dir/Main.cpp.o] Error 254
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/UbiSOM.dir/all' failed
make[2]: *** [CMakeFiles/UbiSOM.dir/all] Error 2
CMakeFiles/Makefile2:80: recipe for target 'CMakeFiles/UbiSOM.dir/rule' failed
make[1]: *** [CMakeFiles/UbiSOM.dir/rule] Error 2
Makefile:118: recipe for target 'UbiSOM' failed
make: *** [UbiSOM] Error 2

-- 
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/20180404/27a9e527/attachment.html>


More information about the llvm-bugs mailing list