Issue 139869
Summary [nsan] nsan pass failure on long autogenerated C++ file
Labels new issue
Assignees
Reporter hageboeck
    When running the attached preprocessed C++ file, the nsan pass fails as below.
I don't know if this helps, but It passes OK when I remove `-O2 -g`.

```
$ clang++-20 -fsanitize=numerical -pipe -pthread -O2 -g -DNDEBUG -fno-omit-frame-pointer -std=c++20 -fPIC -o /tmp/repro.cxx.o -x c++-cpp-output -c /tmp/repro.cxx.i 

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: clang++-20 -fsanitize=numerical -pipe -pthread -O2 -g -DNDEBUG -fno-omit-frame-pointer -std=c++20 -fPIC -o /tmp/repro.cxx.o -x c++-cpp-output -c /tmp/repro.cxx.i
1.	<eof> parser at end of file
2.	Optimizer
3.	Running pass "nsan" on module "/home/stephan/code/root-nsan/graf2d/gpadv7/G__ROOTGpadv7.cxx"

 #0 0x00007fe9df7f0ae3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0xbf0ae3)
 #1 0x00007fe9df7ee0c5 llvm::sys::RunSignalHandlers() (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0xbee0c5)
 #2 0x00007fe9df7009c8 (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0xb009c8)
 #3 0x00007fe9de662f50 (/usr/lib64/libc.so.6+0x3df50)
 #4 0x00007fe9e09e0b67 (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0x1de0b67)
 #5 0x00007fe9e09e0d00 (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0x1de0d00)
 #6 0x00007fe9e09e0d00 (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0x1de0d00)
 #7 0x00007fe9e09e3773 (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0x1de3773)
 #8 0x00007fe9e09eb23c llvm::NumericalStabilitySanitizerPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0x1deb23c)
 #9 0x00007fe9e9b0f486 (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x1f0f486)
#10 0x00007fe9df9d56a1 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0xdd56a1)
#11 0x00007fe9e9b2511c (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x1f2511c)
#12 0x00007fe9e9b28e19 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x1f28e19)
#13 0x00007fe9e9fb7f62 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x23b7f62)
#14 0x00007fe9e85d837c clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x9d837c)
#15 0x00007fe9ea9894e2 clang::FrontendAction::Execute() (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x2d894e2)
#16 0x00007fe9ea90f687 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x2d0f687)
#17 0x00007fe9eaa110f7 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x2e110f7)
#18 0x0000563fe6b7dbbd cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm/20/bin/clang-20+0x17bbd)
#19 0x0000563fe6b781c3 (/usr/lib/llvm/20/bin/clang-20+0x121c3)
#20 0x00007fe9ea51ac65 (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x291ac65)
#21 0x00007fe9df700aba llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/llvm/20/bin/../lib64/libLLVM.so.20.1+0xb00aba)
#22 0x00007fe9ea51d395 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x291d395)
#23 0x00007fe9ea4d7f66 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x28d7f66)
#24 0x00007fe9ea4d83f8 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x28d83f8)
#25 0x00007fe9ea4ec91b clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/llvm/20/bin/../lib64/libclang-cpp.so.20.1+0x28ec91b)
#26 0x0000563fe6b799c8 clang_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm/20/bin/clang-20+0x139c8)
#27 0x0000563fe6b76613 main (/usr/lib/llvm/20/bin/clang-20+0x10613)
#28 0x00007fe9de64c4d8 (/usr/lib64/libc.so.6+0x274d8)
#29 0x00007fe9de64c59c __libc_start_main (/usr/lib64/libc.so.6+0x2759c)
#30 0x0000563fe6b76675 _start (/usr/lib/llvm/20/bin/clang-20+0x10675)

clang++-20: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 20.1.4
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/20/bin
Configuration file: /etc/clang/20/x86_64-pc-linux-gnu-clang++.cfg
clang++-20: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
```

I have to attach it as `.txt` to make github happy:
[repro.cxx.i.txt](https://github.com/user-attachments/files/20204721/repro.cxx.i.txt)


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to