llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.87k stars 11.92k forks source link

Compiler crashes #51862

Closed c2a3e69c-562c-4f99-832d-c31da5d7e71d closed 2 years ago

c2a3e69c-562c-4f99-832d-c31da5d7e71d commented 2 years ago
Bugzilla Link 52520
Resolution DUPLICATE
Resolved on Nov 16, 2021 03:38
Version 12.0
OS Linux
CC @DimitryAndric

Extended Description

Hi there, I'd like to report a crash clang when trying to compile one of our source code files. Stacktrace and attachments can be found below.

Best regards Michael

Attachments: https://moduleworksgmbh-my.sharepoint.com/:u:/g/personal/michael_moduleworks_com/EdWAA5iQ-dJFrcoNNiSfa8wBAelou2ya0RIDRYX7i_NcOA?e=8cfXW9

Stack dump:

  1. Program arguments: /usr/bin/clang++-12 -O3 -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -fexceptions -Wall -Wno-unknown-pragmas -Wno-logical-op-parentheses -Wno-inconsistent-missing-override -Wno-unused-value -Wno-braced-scalar-init -Wno-unknown-warning-option -Wno-dtor-name -fvisibility=hidden -include../../../executor_0/checkouts/trunk/dev/libraries/misc/public/mwTarget_Platform.hpp -include../../../executor_0/checkouts/trunk/dev/libraries/misc/public/mwAvoid_Warnings.hpp -fopenmp=libomp -std=c++17 -DBOOST_NO_CXX11_UNICODE_LITERALS -DBOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=\"/usr/lib/gcc/x86_64-linux-gnu/9/include/backtrace.h\" -DBOOST_STACKTRACE_USE_BACKTRACE -DCOLLCORE_STATIC_DEFINE -DDISTCALC_STATIC_DEFINE -DEIGEN_MPL2_ONLY -DMW_DISABLE_PRECOMPILED_HEADER -DPROF_NEW_LIBRARY -DUNICODE -DUSE_DOUBLES -D_UNICODE -Doptics_EXPORTS "-I/home/jenkins_slave/workspace/AutoTest - ClangBuild ExactOutput Trunk/cmake-clang/Binaries/inc" -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/optics/include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/optics/. -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/cadcam/cadcam/internal -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/cadcam/cadcam/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/cadcam/cadcamGeo/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/mathdef/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/misc/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/mwCppLanguageSupport/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/measures/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/interactors/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/cadcam/cadcamAlgorithms/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/geoDef/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/geomsplit/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/cadcam/cadcamGeo/internal -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/misc/include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/mwstd/include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/mwstd/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/third_party/tinyxml/. -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/measures/include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/mathdef/internal -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/interactors/include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/third_party/rapidxml/. -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/cadcam/cadcamAlgorithms/internal -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/intersect/./include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/wmadapters/Include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/geoDef/include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/third_party/WildMagic5/SDK/Include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/TestHelper/internal -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/collision/collCore/prof -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/collision/collCore/prof_2018 -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/collision/collCore/include "-I/home/jenkins_slave/workspace/AutoTest - ClangBuild ExactOutput Trunk/cmake-clang/libraries/collision/collCore" -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/collision/collCore/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/SolidAdapters/include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/third_party/Solid/solid3/include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/distcalc/./include "-I/home/jenkins_slave/workspace/AutoTest - ClangBuild ExactOutput Trunk/cmake-clang/libraries/distcalc" -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/distcalc/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/DistTool/src/DistTool/. -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/DistTool/src/DistTool/.. -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/OffsetAdapters/include -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/OffsetAdapters/public -I/home/jenkins_slave/executor_0/checkouts/trunk/dev/third_party/dlib/. -isystem /home/jenkins_slave/executor_0/checkouts/trunk/dev/third_party/boost/. -DNDEBUG -c -o libraries/optics/CMakeFiles/optics.dir/src/mwOpticSurfGridSampler.cpp.o /home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/optics/src/mwOpticSurfGridSampler.cpp
  2. parser at end of file
  3. Per-file LLVM IR generation
  4. /home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/optics/src/mwOpticSurfGridSampler.cpp:227:64: Generating code for declaration 'optics::mwOpticSurfGridSampler::CreateSamples(optics::mwOpticSurfGridSampler::BoundingBox3d &, optics::mwOpticSurfGridSampler::BoundingBox3d &, interact::mwUpdateHandlerExecutant::Ptr)::(anonymous class)::operator()'
  5. /home/jenkins_slave/executor_0/checkouts/trunk/dev/libraries/optics/src/mwOpticSurfGridSampler.cpp:250:3: LLVM IR generation of compound statement ('{}')

    ​0 0x00007f152d3bbef3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xbd8ef3)

    ​1 0x00007f152d3ba210 llvm::sys::RunSignalHandlers() (/usr/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xbd7210)

    ​2 0x00007f152d3bb64d llvm::sys::CleanupOnSignal(unsigned long) (/usr/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xbd864d)

    ​3 0x00007f152d30b416 (/usr/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xb28416)

    ​4 0x00007f1534bf23c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)

    ​5 0x00007f15336e7747 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x174e747)

    ​6 0x00007f15335fa590 clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(clang::DeclRefExpr const*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1661590)

    ​7 0x00007f15335f0829 clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1657829)

    ​8 0x00007f1533614993 clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr const, clang::CXXMethodDecl const, clang::CodeGen::ReturnValueSlot, bool, clang::NestedNameSpecifier, bool, clang::Expr const) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x167b993)

    ​9 0x00007f1533615a41 clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(clang::CXXOperatorCallExpr const, clang::CXXMethodDecl const, clang::CodeGen::ReturnValueSlot) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x167ca41)

    ​10 0x00007f15335f9195 clang::CodeGen::CodeGenFunction::EmitCallExprLValue(clang::CallExpr const*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1660195)

    ​11 0x00007f15335f0799 clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1657799)

    ​12 0x00007f15335f0561 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1657561)

    ​13 0x00007f1533725dbd clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const, llvm::ArrayRef<clang::Attr const>) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x178cdbd)

    ​14 0x00007f153372fd8c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1796d8c)

    ​15 0x00007f153372f22f clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x179622f)

    ​16 0x00007f153372640a clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const, llvm::ArrayRef<clang::Attr const>) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x178d40a)

    ​17 0x00007f1533725ce4 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const, llvm::ArrayRef<clang::Attr const>) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x178cce4)

    ​18 0x00007f15336e52d4 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x174c2d4)

    ​19 0x00007f15336d3e4b clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(clang::CodeGen::CodeGenFunction&, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&, bool) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x173ae4b)

    ​20 0x00007f15336bac67 clang::CodeGen::CGOpenMPRuntime::emitCriticalRegion(clang::CodeGen::CodeGenFunction&, llvm::StringRef, clang::CodeGen::RegionCodeGenTy const&, clang::SourceLocation, clang::Expr const*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1721c67)

    ​21 0x00007f15337472ab clang::CodeGen::CodeGenFunction::EmitOMPCriticalDirective(clang::OMPCriticalDirective const&) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17ae2ab)

    ​22 0x00007f1533725f74 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const, llvm::ArrayRef<clang::Attr const>) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x178cf74)

    ​23 0x00007f153372fd8c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1796d8c)

    ​24 0x00007f153377ba1b clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17e2a1b)

    ​25 0x00007f153377c23c clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17e323c)

    ​26 0x00007f15337943f7 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17fb3f7)

    ​27 0x00007f153378e644 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17f5644)

    ​28 0x00007f1533784f01 clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17ebf01)

    ​29 0x00007f1533784f1f clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17ebf1f)

    ​30 0x00007f1533784f1f clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17ebf1f)

    ​31 0x00007f1533784f1f clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17ebf1f)

    ​32 0x00007f1533784f1f clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17ebf1f)

    ​33 0x00007f1533784f1f clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17ebf1f)

    ​34 0x00007f1533783ca9 clang::CodeGen::CodeGenModule::Release() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17eaca9)

    ​35 0x00007f1533805574 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x186c574)

    ​36 0x00007f1533773406 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x17da406)

    ​37 0x00007f15328d1d94 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x938d94)

    ​38 0x00007f1533e67118 clang::FrontendAction::Execute() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1ece118)

    ​39 0x00007f1533df4dd1 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1e5bdd1)

    ​40 0x00007f1533ec9502 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1f30502)

    ​41 0x0000000000412782 cc1_main(llvm::ArrayRef<char const>, char const, void*) (/usr/bin/clang++-12+0x412782)

    ​42 0x0000000000410afe (/usr/bin/clang++-12+0x410afe)

    ​43 0x00007f1533b10d82 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b77d82)

    ​44 0x00007f152d30b1ed llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xb281ed)

    ​45 0x00007f1533b10579 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool) const (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b77579)

    ​46 0x00007f1533ae5b2f clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b4cb2f)

    ​47 0x00007f1533ae5ee7 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b4cee7)

    ​48 0x00007f1533afa99c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b6199c)

    ​49 0x00000000004103d4 main (/usr/bin/clang++-12+0x4103d4)

    ​50 0x00007f152c2ca0b3 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3

    ​51 0x000000000040dcbe _start (/usr/bin/clang++-12+0x40dcbe)

    clang: error: clang frontend command failed with exit code 139 (use -v to see invocation) Ubuntu clang version 12.0.0-3ubuntu1~20.04.4 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin 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/mwOpticSurfGridSampler-4192e7.cpp clang: note: diagnostic msg: /tmp/mwOpticSurfGridSampler-4192e7.sh clang: note: diagnostic msg:


DimitryAndric commented 2 years ago

This crash (actually an UNREACHABLE, if assertions are enabled) got fixed for bug 48571 in https://github.com/llvm/llvm-project/commit/7654bb6303d290b19cad29137be810e69a0bf917, and the fix was merged to the release/12.x branch in https://github.com/llvm/llvm-project/commit/7cc5b1593554c4a589e5e57c64c28bbd85c9987f.

This bug has been marked as a duplicate of bug llvm/llvm-project#47915