[clang] [Clang] Fix assertion failure in SDiagsWriter when finish() is not called (PR #181712)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 17 22:53:41 PST 2026
zeyi2 wrote:
Also, while working on this issue, I found another crash. I've tested it with 23.0.0 (trunk) and 21.1.8 and it seems like a regression:
```
m at n:~/.../projects/llvm-project$ ./build/bin/clang-check -serialize-diagnostic-file=foo.dia foo.cpp --
clang-check: Unknown command line argument '-serialize-diagnostic-file=foo.dia'. Try: './build/bin/clang-check --help'
clang-check: Did you mean '--ast-dump-filter=foo.dia'?
Program aborted due to an unhandled Error:
clang-check: Unknown command line argument '-serialize-diagnostic-file=foo.dia'. Try: './build/bin/clang-check --help'
clang-check: Did you mean '--ast-dump-filter=foo.dia'?
#0 0x00007fceb4ab7208 __interceptor_backtrace (/usr/lib/libasan.so.8+0xb7208)
#1 0x000055778c39abd1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./build/bin/clang-check+0x80a3bd1)
#2 0x000055778c38ba9a llvm::sys::RunSignalHandlers() (./build/bin/clang-check+0x8094a9a)
#3 0x000055778c38c353 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#4 0x00007fceb432f2d0 (/usr/lib/libc.so.6+0x3e2d0)
#5 0x00007fceb4389a2c (/usr/lib/libc.so.6+0x98a2c)
#6 0x00007fceb432f1a0 raise (/usr/lib/libc.so.6+0x3e1a0)
#7 0x00007fceb43165fe abort (/usr/lib/libc.so.6+0x255fe)
#8 0x000055778c1497d2 llvm::Error::fatalUncheckedError() const (./build/bin/clang-check+0x7e527d2)
#9 0x000055778a81b216 main (./build/bin/clang-check+0x6524216)
#10 0x00007fceb43186c1 (/usr/lib/libc.so.6+0x276c1)
#11 0x00007fceb43187f9 __libc_start_main (/usr/lib/libc.so.6+0x277f9)
#12 0x000055778a80c565 _start (./build/bin/clang-check+0x6515565)
Aborted ./build/bin/clang-check -serialize-diagnostic-file=foo.dia foo.cpp --
m at n:~/.../projects/llvm-project$ ./build/bin/clang-check --version
LLVM (http://llvm.org/):
LLVM version 23.0.0git
Optimized build with assertions.
m at n:~/.../projects/llvm-project$ /usr/bin/clang-check -serialize-diagnostic-file=foo.dia foo.cpp --
clang-check: Unknown command line argument '-serialize-diagnostic-file=foo.dia'. Try: '/usr/bin/clang-check --help'
clang-check: Did you mean '--analyzer-output-path=foo.dia'?
m at n:~/.../projects/llvm-project$ /usr/bin/clang-check --version
LLVM (http://llvm.org/):
LLVM version 21.1.8
Optimized build.
```
I'll open a new issue for it later.
https://github.com/llvm/llvm-project/pull/181712
More information about the cfe-commits
mailing list