Issue 53359
Summary clang-tidy segfault in <eof> parser at end of file
Labels new issue
Assignees
Reporter def-
    ```
Error running 'clang-tidy': PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.	Program arguments: clang-tidy --extra-arg-before=--driver-mode=g++ /media/ddnet/src/game/editor/layer_sounds.cpp -- /usr/bin/c++ -DCONF_DEBUG -DCONF_GLEW_HAS_CONTEXT_INIT -DCONF_INFORM_UPDATE -DGAME_RELEASE_VERSION=\"15.8.1\" -DGLEW_STATIC -I/media/ddnet/src -isystem /media/ddnet/ddnet-libs/curl/include -isystem /usr/include/freetype2 -isystem /media/ddnet/src/engine/external/glew -isystem /media/ddnet/ddnet-libs/opus/include -isystem /media/ddnet/ddnet-libs/opus/include/opus -isystem /media/ddnet/src/engine/external/pnglite -isystem /usr/include/SDL2 -isystem /media/ddnet/src/engine/external/wavpack -isystem /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/glib-2.0 -isystem /usr/lib/glib-2.0/include -isystem /usr/include/sysprof-4 -isystem /usr/include/libpng16 -isystem /usr/include/libmount -isystem /usr/include/blkid -isystem /media/ddnet/ddnet-libs/sqlite3/include -isystem /media/ddnet/src/engine/external/zlib -g -fdiagnostics-color=always -fstack-protector-all -fno-exceptions -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -MD -MT CMakeFiles/DDNet.dir/src/game/editor/layer_sounds.cpp.o -MF CMakeFiles/DDNet.dir/src/game/editor/layer_sounds.cpp.o.d -o CMakeFiles/DDNet.dir/src/game/editor/layer_sounds.cpp.o -c /media/ddnet/src/game/editor/layer_sounds.cpp
1.	<eof> parser at end of file
 #0 0x00007efe04962c93 (/usr/bin/../lib/libLLVM-13.so+0xba2c93)
 #1 0x00007efe049604a6 (/usr/bin/../lib/libLLVM-13.so+0xba04a6)
 #2 0x00007efe038d6da0 __restore_rt sigaction.c:0:0
 #3 0x000055be85838720 (/usr/bin/clang-tidy+0x537720)
 #4 0x00007efe0b893a7e (/usr/bin/../lib/libclang-cpp.so.13+0x12a5a7e)
 #5 0x00007efe0b8bd42f clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) (/usr/bin/../lib/libclang-cpp.so.13+0x12cf42f)
 #6 0x00007efe0b894526 (/usr/bin/../lib/libclang-cpp.so.13+0x12a6526)
 #7 0x00007efe0b8b3ea1 (/usr/bin/../lib/libclang-cpp.so.13+0x12c5ea1)
 #8 0x00007efe0b8ae882 (/usr/bin/../lib/libclang-cpp.so.13+0x12c0882)
 #9 0x00007efe0b8aea8c (/usr/bin/../lib/libclang-cpp.so.13+0x12c0a8c)
#10 0x00007efe0b8b3013 (/usr/bin/../lib/libclang-cpp.so.13+0x12c5013)
#11 0x00007efe0b8aa54a (/usr/bin/../lib/libclang-cpp.so.13+0x12bc54a)
#12 0x00007efe0b8b8499 (/usr/bin/../lib/libclang-cpp.so.13+0x12ca499)
#13 0x00007efe0b8a9be0 (/usr/bin/../lib/libclang-cpp.so.13+0x12bbbe0)
#14 0x00007efe0b8a9e50 clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) (/usr/bin/../lib/libclang-cpp.so.13+0x12bbe50)
#15 0x00007efe0cdbcc38 clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/bin/../lib/libclang-cpp.so.13+0x27cec38)
#16 0x00007efe0b1dbe59 clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/../lib/libclang-cpp.so.13+0xbede59)
#17 0x00007efe0cd81899 clang::FrontendAction::Execute() (/usr/bin/../lib/libclang-cpp.so.13+0x2793899)
#18 0x00007efe0cd0b9ec clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/../lib/libclang-cpp.so.13+0x271d9ec)
#19 0x00007efe0cf7d5d6 clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (/usr/bin/../lib/libclang-cpp.so.13+0x298f5d6)
#20 0x000055be858f8aab (/usr/bin/clang-tidy+0x5f7aab)
#21 0x00007efe0cf77241 clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) (/usr/bin/../lib/libclang-cpp.so.13+0x2989241)
#22 0x00007efe0cf79b6d clang::tooling::ToolInvocation::run() (/usr/bin/../lib/libclang-cpp.so.13+0x298bb6d)
#23 0x00007efe0cf7baf4 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (/usr/bin/../lib/libclang-cpp.so.13+0x298daf4)
#24 0x000055be85900676 (/usr/bin/clang-tidy+0x5ff676)
#25 0x000055be853ae9f9 (/usr/bin/clang-tidy+0xad9f9)
#26 0x00007efe038c1b25 __libc_start_main (/usr/bin/../lib/libc.so.6+0x27b25)
#27 0x000055be853a6f9e (/usr/bin/clang-tidy+0xa5f9e)
Segmentation fault
```
Reproducable with:
```
git clone https://github.com/def-/ddnet
git checkout crash-clang-tidy
cmake -G "Unix Makefiles" -DCMAKE_CXX_CLANG_TIDY="clang-tidy" -DCMAKE_C_CLANG_TIDY="clang-tidy" -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DPREFER_BUNDLED_LIBS=ON -GNinja .
ninja
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to