[clang] [Modules] Add information about the built module when clang crashes. (PR #178108)

Volodymyr Sapsai via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 26 19:27:57 PST 2026


vsapsai wrote:

No test case as `#pragma clang __debug crash` crashes outside of `CompilerInstance::compileModule`.

By introducing a crash manually I have the information like
```
Assertion failed: (false && "introduce crash"), function compileModule, file CompilerInstance.cpp, line 1265.
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 -fsyntax-only -I ./include -fmodules -fmodules-cache-path=modules.noindex test.c
1.	test.c:1:2: current parser token 'include'
2.	Building module 'a' as '/tmp/dependent-module/modules.noindex/18XPNAILR6R9K/a-1RHYUDWKDSLAX.pcm'
 #0 0x000000010928bd10 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (clang-22+0x104fd3d10)
 #1 0x0000000109289c74 llvm::sys::RunSignalHandlers() (clang-22+0x104fd1c74)
...
```

https://github.com/llvm/llvm-project/pull/178108


More information about the cfe-commits mailing list