llvm / llvm-project

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

clang-tidy 18 crash #71638

Open omartijn opened 1 year ago

omartijn commented 1 year ago

I'm getting a crash using clang-tidy 18~++20231107112322+4428b01faa41-1~exp1~20231107112339.320, installed from apt.llvm.org on debian 12.

Error running '/usr/bin/clang-tidy': PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /usr/bin/clang-tidy --extra-arg-before=--driver-mode=g++ /home/martijn/git/software2/resolume/Resolume/source/controller/actions/effects/PasteEffects.cpp -- /usr/bin/c++ -DAJASTATIC -DDEBUG -DDONT_SET_USING_JUCE_NAMESPACE=1 -DGLEW_STATIC -DGLEW_STATIC=1 -DJUCE_ASIO=0 -DJUCE_DISPLAY_SPLASH_SCREEN=0 -DJUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 -DJUCE_MODAL_LOOPS_PERMITTED=1 -DJUCE_MODULE_AVAILABLE_juce_analytics=1 -DJUCE_MODULE_AVAILABLE_juce_audio_basics=1 -DJUCE_MODULE_AVAILABLE_juce_audio_devices=1 -DJUCE_MODULE_AVAILABLE_juce_audio_formats=1 -DJUCE_MODULE_AVAILABLE_juce_audio_plugin_client=1 -DJUCE_MODULE_AVAILABLE_juce_audio_processors=1 -DJUCE_MODULE_AVAILABLE_juce_audio_utils=1 -DJUCE_MODULE_AVAILABLE_juce_box2d=1 -DJUCE_MODULE_AVAILABLE_juce_core=1 -DJUCE_MODULE_AVAILABLE_juce_cryptography=1 -DJUCE_MODULE_AVAILABLE_juce_data_structures=1 -DJUCE_MODULE_AVAILABLE_juce_dsp=1 -DJUCE_MODULE_AVAILABLE_juce_events=1 -DJUCE_MODULE_AVAILABLE_juce_graphics=1 -DJUCE_MODULE_AVAILABLE_juce_gui_basics=1 -DJUCE_MODULE_AVAILABLE_juce_gui_extra=1 -DJUCE_MODULE_AVAILABLE_juce_opengl=1 -DJUCE_MODULE_AVAILABLE_juce_osc=1 -DJUCE_MODULE_AVAILABLE_juce_product_unlocking=1 -DJUCE_MODULE_AVAILABLE_juce_video=0 -DJUCE_PLUGINHOST_VST=1 -DJUCE_REPORT_APP_USAGE=0 -DJUCE_STANDALONE_APPLICATION=1 -DJUCE_USE_DARK_SPLASH_SCREEN=0 -DJUCE_WIN_PER_MONITOR_DPI_AWARE=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_Standalone=0 -DJucePlugin_Build_Unity=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_VST=1 -DMEVI_MAX_SUBMISSIONS_PER_BATCH=64 -DMEVI_VI_USE_MANUAL_ALLOCATION=1 -DRAPIDJSON_HAS_CXX11_RVALUE_REFS=1 -DRAPIDJSON_HAS_STDSTRING=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_OS_UNIX=1 -DTINYXML2_DEBUG -DWIRE_VERSION_LATEST_AVAILABLE -I/home/martijn/git/software2/build/resolume/Resolume/generated -I/home/martijn/git/software2/resolume/Resolume/../../wire/dependencies -I/home/martijn/git/software2/resolume/version -I/home/martijn/git/software2/libs/json_dto/dev -I/home/martijn/git/software2/libs/wire-sdk/include -I/home/martijn/git/software2/common/rj -I/home/martijn/git/software2/libs/juce/modules -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/webkitgtk-4.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/home/martijn/git/software2/resolume/common/juce_resapi/. "-I/home/martijn/git/software2/build/resolume resapi/resapi/generated" "-I/home/martijn/git/software2/resolume resapi/resapi/source" -I/home/martijn/git/software2/libs/magma/mevi-gfx/libs/qusdk/api/Include -I/home/martijn/git/software2/libs/libjpeg-turbo/include -I/home/martijn/git/software2/libs/oscpack_1_1_0/osc -I/home/martijn/git/software2/libs/prores/include -I/home/martijn/git/software2/libs/stb_image -I/home/martijn/git/software2/libs/resolume-pnglib -I/home/martijn/git/software2/libs/resolume-zlib -I/home/martijn/git/software2/libs/uvm/v2 -I/home/martijn/git/software2/libs/magma/mevi-gfx/libs/moodycamel-1.0.3 -I/home/martijn/git/software2/libs/webapi/include -I/home/martijn/git/software2/libs/webapi/cpprouter/include -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-core "-I/home/martijn/git/software2/resolume resapi/resapi/source/engine/effectlibrary/shaders" "-I/home/martijn/git/software2/resolume resapi/resapi/source/math" "-I/home/martijn/git/software2/resolume resapi/resapi/source/geometry" -I/home/martijn/git/software2/resapi/gfx/Engine -I/home/martijn/git/software2/resapi/gfx/VideoEngine -I/home/martijn/git/software2/resapi/gfx/Tools -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-vktools -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-vkengine -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-vkengine/Frame -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-vkengine/Handles -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-vkengine/Shaders -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-vkout -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-vkll -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-vkll/libs/MoltenVK-1.3.244.0/include -I/home/martijn/git/software2/libs/magma/mevi-gfx/mevi-codec -I/home/martijn/git/software2/libs/magma/mevi-gfx/libs/tinyxml2-9.0.0 -I/home/martijn/git/software2/libs/magma/mevi-gfx/libs/json-3.10.5/include -I/home/martijn/git/software2/libs/magma/mevi-gfx/libs/VulkanMemoryAllocator-3.0.0/include -I/home/martijn/git/software2/libs/magma/mevi-gfx/libs/triangle -I/home/martijn/git/software2/build/resolume/common/juce_resapi/gui/generated -I/home/martijn/git/software2/wire/dependencies/moditone/multifunction/../.. -I/home/martijn/git/software2/libs/lzf -I/home/martijn/git/software2/resolume/ResolumeUI/source -I/home/martijn/git/software2/resolume/ScreenSetup -I/home/martijn/git/software2/resolume/dmxEditor -I/home/martijn/git/software2/resolume/common/juce_resapi_dmx -I/home/martijn/git/software2/libs/libartnet/common -isystem /home/martijn/git/software2/build/vcpkg_installed/x64-linux/include -isystem /home/martijn/git/software2/build/vcpkg_installed/x64-linux/share -isystem /home/martijn/git/software2/build/vcpkg_installed/x64-linux/include/ndi -isystem /home/martijn/git/software2/libs/rapidxml-1.13 -isystem /home/martijn/git/software2/build/vcpkg_installed/x64-linux/share/rapidjson/../../include -isystem /home/martijn/git/software2/libs/magic/include -isystem /home/martijn/git/software2/build/vcpkg_installed/x64-linux/include/ajalibraries -fstandalone-debug -Wall -Werror -Wno-overloaded-virtual -Wno-switch -Wno-format-security -Wno-objc-missing-super-calls -Wno-literal-conversion -Wno-shorten-64-to-32 -Wno-unused-variable -Wno-error=implicit-const-int-float-conversion -Wno-error=deprecated-anon-enum-enum-conversion -Wno-error=missing-declarations -Wno-error=macro-redefined -Wno-error=availability -Wno-error=unguarded-availability-new -Wno-error=deprecated-declarations -Wno-error=shorten-64-to-32 -g -std=gnu++20 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -include /home/martijn/git/software2/resolume/Resolume/source/headers.h -MD -MT resolume/Resolume/CMakeFiles/Resolume.dir/source/controller/actions/effects/PasteEffects.cpp.o -MF CMakeFiles/Resolume.dir/source/controller/actions/effects/PasteEffects.cpp.o.d -o CMakeFiles/Resolume.dir/source/controller/actions/effects/PasteEffects.cpp.o -c /home/martijn/git/software2/resolume/Resolume/source/controller/actions/effects/PasteEffects.cpp
1.  <eof> parser at end of file
2.  /home/martijn/git/software2/resolume/Resolume/source/controller/actions/effects/PasteEffects.cpp:65:22: instantiating function definition 'EffectActions::PasteEffects::paste()::(anonymous class)::operator()<VideoTrack>'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM-18.so.1    0x00007ff5df543d56 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 54
1  libLLVM-18.so.1    0x00007ff5df541d80 llvm::sys::RunSignalHandlers() + 80
2  libLLVM-18.so.1    0x00007ff5df54441b
3  libc.so.6          0x00007ff5de65afd0
4  libclang-cpp.so.18 0x00007ff5e7a74afe clang::Sema::tryCaptureVariable(clang::ValueDecl*, clang::SourceLocation, clang::Sema::TryCaptureKind, clang::SourceLocation, bool, clang::QualType&, clang::QualType&, unsigned int const*) + 622
5  libclang-cpp.so.18 0x00007ff5e7a3e939 clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&, clang::NestedNameSpecifierLoc, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) + 137
6  libclang-cpp.so.18 0x00007ff5e7a3e895 clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&, clang::CXXScopeSpec const*, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) + 149
7  libclang-cpp.so.18 0x00007ff5e7a42ad5 clang::Sema::BuildDeclarationNameExpr(clang::CXXScopeSpec const&, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::NamedDecl*, clang::TemplateArgumentListInfo const*, bool) + 1349
8  libclang-cpp.so.18 0x00007ff5e7eb7e34
9  libclang-cpp.so.18 0x00007ff5e7eaa6de
10 libclang-cpp.so.18 0x00007ff5e7eacdb5
11 libclang-cpp.so.18 0x00007ff5e7ea9639
12 libclang-cpp.so.18 0x00007ff5e7ebaff8
13 libclang-cpp.so.18 0x00007ff5e7eb2c49
14 libclang-cpp.so.18 0x00007ff5e7ea5f22 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) + 82
15 libclang-cpp.so.18 0x00007ff5e78931bd
16 libclang-cpp.so.18 0x00007ff5e7892024
17 libclang-cpp.so.18 0x00007ff5e788cf5f
18 libclang-cpp.so.18 0x00007ff5e788c8da clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) + 810
19 libclang-cpp.so.18 0x00007ff5e788f650 clang::Sema::CheckInstantiatedFunctionTemplateConstraints(clang::SourceLocation, clang::FunctionDecl*, llvm::ArrayRef<clang::TemplateArgument>, clang::ConstraintSatisfaction&) + 928
20 libclang-cpp.so.18 0x00007ff5e7e4420b clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool, llvm::function_ref<bool ()>) + 3195
21 libclang-cpp.so.18 0x00007ff5e7e98b57
22 libclang-cpp.so.18 0x00007ff5e775406d clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 61
23 libclang-cpp.so.18 0x00007ff5e7e45ad9 clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, bool, clang::QualType, clang::Expr::Classification, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>) + 2489
24 libclang-cpp.so.18 0x00007ff5e7d1978d clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool, clang::CallExpr::ADLCallKind, clang::OverloadCandidateParamOrder, bool) + 733
25 libclang-cpp.so.18 0x00007ff5e7d20400 clang::Sema::AddArgumentDependentLookupCandidates(clang::DeclarationName, clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::TemplateArgumentListInfo*, clang::OverloadCandidateSet&, bool) + 1088
26 libclang-cpp.so.18 0x00007ff5e7d2c9a7 clang::Sema::LookupOverloadedBinOp(clang::OverloadCandidateSet&, clang::OverloadedOperatorKind, clang::UnresolvedSetImpl const&, llvm::ArrayRef<clang::Expr*>, bool) + 503
27 libclang-cpp.so.18 0x00007ff5e7d2cced clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*, bool, bool, clang::FunctionDecl*) + 749
28 libclang-cpp.so.18 0x00007ff5e7a6bf1c
29 libclang-cpp.so.18 0x00007ff5e7a6bb03 clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) + 1171
30 libclang-cpp.so.18 0x00007ff5e7a3addf clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 2719
31 libclang-cpp.so.18 0x00007ff5e7d540e0 clang::Sema::BuildCXXForRangeStmt(clang::SourceLocation, clang::SourceLocation, clang::Stmt*, clang::SourceLocation, clang::Stmt*, clang::Stmt*, clang::Stmt*, clang::Expr*, clang::Expr*, clang::Stmt*, clang::SourceLocation, clang::Sema::BuildForRangeKind) + 2448
32 libclang-cpp.so.18 0x00007ff5e7ecaa43
33 libclang-cpp.so.18 0x00007ff5e7ec5c1d
34 libclang-cpp.so.18 0x00007ff5e7ebd8bf
35 libclang-cpp.so.18 0x00007ff5e7ea4d84 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) + 84
36 libclang-cpp.so.18 0x00007ff5e7ee5e41 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) + 2753
37 libclang-cpp.so.18 0x00007ff5e7ee84a7 clang::Sema::PerformPendingInstantiations(bool) + 663
38 libclang-cpp.so.18 0x00007ff5e7755a6f clang::Sema::ActOnEndOfTranslationUnitFragment(clang::Sema::TUFragmentKind) + 399
39 libclang-cpp.so.18 0x00007ff5e77560bf clang::Sema::ActOnEndOfTranslationUnit() + 351
40 libclang-cpp.so.18 0x00007ff5e6ffc1d9 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) + 1129
41 libclang-cpp.so.18 0x00007ff5e6f359de clang::ParseAST(clang::Sema&, bool, bool) + 782
42 libclang-cpp.so.18 0x00007ff5e8d24715 clang::FrontendAction::Execute() + 85
43 libclang-cpp.so.18 0x00007ff5e8c9c254 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 708
44 libclang-cpp.so.18 0x00007ff5e8f11391 clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) + 385
45 clang-tidy         0x000055d188fab361
46 libclang-cpp.so.18 0x00007ff5e8f1110f clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) + 287
47 libclang-cpp.so.18 0x00007ff5e8f0ff84 clang::tooling::ToolInvocation::run() + 1428
48 libclang-cpp.so.18 0x00007ff5e8f12915 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) + 3637
49 clang-tidy         0x000055d188fa7607 clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef) + 1063
50 clang-tidy         0x000055d18837380f clang::tidy::clangTidyMain(int, char const**) + 10223
51 libc.so.6          0x00007ff5de6461ca
52 libc.so.6          0x00007ff5de646285 __libc_start_main + 133
53 clang-tidy         0x000055d18836ebd1 _start + 33
Segmentation fault
PiotrZSL commented 1 year ago

This doesn't look to be clang-tidy issue, more like clang itself, as crash happen already on Sema level.

omartijn commented 1 year ago

This doesn't look to be clang-tidy issue, more like clang itself, as crash happen already on Sema level.

It doesn't happen when I disable clang-tidy.

PiotrZSL commented 1 year ago

This doesn't look to be clang-tidy issue, more like clang itself, as crash happen already on Sema level.

It doesn't happen when I disable clang-tidy.

If it compile with clang alone, you could try to move --driver-mode=g++ after -- and see if this help.