| Issue |
87303
|
| Summary |
tidy crashes with readability-duplicate-include
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
jackua22
|
The crash is the same with llvm 17 and llvm 18.
The output looks like
```
clang-tidy: /.../llvm-v17.0.6d1rh74_lnx86/llvm-project/clang/lib/Basic/SourceManager.cpp:868: clang::FileID clang::SourceManager::getFileIDLoaded(clang::SourceLocation::UIntTy) const: Assertion `0 && "Invalid SLocOffset or bad function choice"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /.../llvm-v17.0.6d1rh74_lnx86/bin/clang-tidy --checks=-*,readability-duplicate-include --quiet /.../swfvDB.C -- -fpic -std=c++17 -pthread -stdlib=libc++ -O3 -I. -I.. -I/.../include
1. /.../ua/include/tbb/internal/_allocator_traits.h:31:2: current parser token 'include'
2. /.../ua/include/tbb/tbb_profiling.h:126:1: parsing namespace 'tbb'
#0 0x0000000003f6829b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/grid/common/test/llvm-v17.0.6d1rh74_lnx86/bin/clang-tidy+0x3f6829b)
#1 0x0000000003f65b4b llvm::sys::RunSignalHandlers() (/grid/common/test/llvm-v17.0.6d1rh74_lnx86/bin/clang-tidy+0x3f65b4b)
#2 0x0000000003f65c75 SignalHandler(int) Signals.cpp:0:0
#3 0x00002b7947953630 __restore_rt sigaction.c:0:0
#4 0x00002b794873c387 raise (/lib64/libc.so.6+0x36387)
#5 0x00002b794873da78 abort (/lib64/libc.so.6+0x37a78)
#6 0x00002b79487351a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
#7 0x00002b7948735252 (/lib64/libc.so.6+0x2f252)
#8 0x0000000003b22904 (/grid/common/test/llvm-v17.0.6d1rh74_lnx86/bin/clang-tidy+0x3b22904)
#9 0x0000000003b28eb5 clang::SourceManager::getSpellingLineNumber(clang::SourceLocation, bool*) const (/grid/common/test/llvm-v17.0.6d1rh74_lnx86/bin/clang-tidy+0x3b28eb5)
#10 0x00000000010ea696 clang::tidy::readability::advanceBeyondCurrentLine(clang::SourceManager const&, clang::SourceLocation, int) DuplicateIncludeCheck.cpp:0:0
#11 0x00000000010eb4b7 clang::tidy::readability::(anonymous namespace)::DuplicateIncludeCallbacks::InclusionDirective(clang::SourceLocation, clang::Token const&, llvm::StringRef, bool, clang::CharSourceRange, clang::CustomizableOptional<clang::FileEntryRef>, llvm::StringRef, llvm::StringRef, clang::Module const*, clang::SrcMgr::CharacteristicKind) DuplicateIncludeCheck.cpp:0:0
#12 0x0000000003a4635d clang::PPChainedCallbacks::InclusionDirective(clang::SourceLocation, clang::Token const&, llvm::StringRef, bool, clang::CharSourceRange, clang::CustomizableOptional<clang::FileEntryRef>, llvm::StringRef, llvm::StringRef, clang::Module const*, clang::SrcMgr::CharacteristicKind) (/grid/common/test/llvm-v17.0.6d1rh74_lnx86/bin/clang-tidy+0x3a4635d)
#13 0x0000000003a56856 clang::Preprocessor::HandleHeaderIncludeOrImport(clang::SourceLocation, clang::Token&, clang::Token&, clang::SourceLocation, clang::detail::SearchDirIteratorImpl<true>, clang::FileEntry const*)
```
The first several includes are
```
#include <vector>
#include <future>
#include <thread>
#include <queue>
#include <atomic>
#include <tbb/concurrent_vector.h>
#include <tbb/parallel_for.h>
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs