llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.81k stars 11.45k forks source link

[Clang] Assertion 'Symbol' failed. with `-fdebug-macro -gline-directives-only` #88153

Open patrick-rivos opened 4 months ago

patrick-rivos commented 4 months ago

Testcase:

int main() { }

Backtrace:

clang-19: /scratch/tc-testing/tc-apr-4/llvm/llvm/lib/MC/MCExpr.cpp:207: llvm::MCSymbolRefExpr::MCSymbolRefExpr(const llvm::MCSymbol*, llvm::MCSymbolRefExpr::VariantKind, const llvm::MCAsmInfo*, llvm::SMLoc): Assertion `Symbol' failed.
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: /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19 -cc1 -triple riscv64-unknown-linux-gnu -emit-obj -mrelax-all -dumpdir a- -disable-free -clear-ast-before-backend -main-file-name red.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu generic-rv64 -target-feature +m -target-feature +a -target-feature +f -target-feature +d -target-feature +c -target-feature +zicsr -target-feature -e -target-feature -h -target-feature -shcounterenw -target-feature -shgatpa -target-feature -shtvala -target-feature -shvsatpa -target-feature -shvstvala -target-feature -shvstvecd -target-feature -smaia -target-feature -smepmp -target-feature -ssaia -target-feature -ssccptr -target-feature -sscofpmf -target-feature -sscounterenw -target-feature -ssstateen -target-feature -ssstrict -target-feature -sstc -target-feature -sstvala -target-feature -sstvecd -target-feature -ssu64xl -target-feature -svade -target-feature -svadu -target-feature -svbare -target-feature -svinval -target-feature -svnapot -target-feature -svpbmt -target-feature -v -target-feature -xcvalu -target-feature -xcvbi -target-feature -xcvbitmanip -target-feature -xcvelw -target-feature -xcvmac -target-feature -xcvmem -target-feature -xcvsimd -target-feature -xsfcease -target-feature -xsfvcp -target-feature -xsfvfnrclipxfqf -target-feature -xsfvfwmaccqqq -target-feature -xsfvqmaccdod -target-feature -xsfvqmaccqoq -target-feature -xsifivecdiscarddlone -target-feature -xsifivecflushdlone -target-feature -xtheadba -target-feature -xtheadbb -target-feature -xtheadbs -target-feature -xtheadcmo -target-feature -xtheadcondmov -target-feature -xtheadfmemidx -target-feature -xtheadmac -target-feature -xtheadmemidx -target-feature -xtheadmempair -target-feature -xtheadsync -target-feature -xtheadvdot -target-feature -xventanacondops -target-feature -za128rs -target-feature -za64rs -target-feature -zacas -target-feature -zawrs -target-feature -zba -target-feature -zbb -target-feature -zbc -target-feature -zbkb -target-feature -zbkc -target-feature -zbkx -target-feature -zbs -target-feature -zca -target-feature -zcb -target-feature -zcd -target-feature -zce -target-feature -zcf -target-feature -zcmp -target-feature -zcmt -target-feature -zdinx -target-feature -zfa -target-feature -zfh -target-feature -zfhmin -target-feature -zfinx -target-feature -zhinx -target-feature -zhinxmin -target-feature -zic64b -target-feature -zicbom -target-feature -zicbop -target-feature -zicboz -target-feature -ziccamoa -target-feature -ziccif -target-feature -zicclsm -target-feature -ziccrse -target-feature -zicntr -target-feature -zicond -target-feature -zifencei -target-feature -zihintntl -target-feature -zihintpause -target-feature -zihpm -target-feature -zk -target-feature -zkn -target-feature -zknd -target-feature -zkne -target-feature -zknh -target-feature -zkr -target-feature -zks -target-feature -zksed -target-feature -zksh -target-feature -zkt -target-feature -zmmul -target-feature -zvbb -target-feature -zvbc -target-feature -zve32f -target-feature -zve32x -target-feature -zve64d -target-feature -zve64f -target-feature -zve64x -target-feature -zvfh -target-feature -zvfhmin -target-feature -zvkb -target-feature -zvkg -target-feature -zvkn -target-feature -zvknc -target-feature -zvkned -target-feature -zvkng -target-feature -zvknha -target-feature -zvknhb -target-feature -zvks -target-feature -zvksc -target-feature -zvksed -target-feature -zvksg -target-feature -zvksh -target-feature -zvkt -target-feature -zvl1024b -target-feature -zvl128b -target-feature -zvl16384b -target-feature -zvl2048b -target-feature -zvl256b -target-feature -zvl32768b -target-feature -zvl32b -target-feature -zvl4096b -target-feature -zvl512b -target-feature -zvl64b -target-feature -zvl65536b -target-feature -zvl8192b -target-feature -experimental-smmpm -target-feature -experimental-smnpm -target-feature -experimental-ssnpm -target-feature -experimental-sspm -target-feature -experimental-ssqosid -target-feature -experimental-supm -target-feature -experimental-zaamo -target-feature -experimental-zabha -target-feature -experimental-zalasr -target-feature -experimental-zalrsc -target-feature -experimental-zcmop -target-feature -experimental-zfbfmin -target-feature -experimental-zicfilp -target-feature -experimental-zicfiss -target-feature -experimental-zimop -target-feature -experimental-ztso -target-feature -experimental-zvfbfmin -target-feature -experimental-zvfbfwma -target-feature +relax -target-abi lp64d -msmall-data-limit 8 -debug-info-kind=line-directives-only -dwarf-version=5 -debugger-tuning=gdb -debug-info-macro -fdebug-compilation-dir=/scratch/tc-testing/compiler-fuzz-ci/csmith-discoveries/llvm-rand-opt-30-1 -fcoverage-compilation-dir=/scratch/tc-testing/compiler-fuzz-ci/csmith-discoveries/llvm-rand-opt-30-1 -resource-dir /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/lib/clang/19 -isysroot /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot -internal-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/lib/clang/19/include -internal-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot/usr/local/include -internal-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot/lib/gcc/riscv64-unknown-linux-gnu/14.0.1/../../../../riscv64-unknown-linux-gnu/include -internal-externc-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot/include -internal-externc-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot/usr/include -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /scratch/tmp/red-bc7993.o -x c red.c
1.      <eof> parser at end of file
2.      Code generation
 #0 0x0000639dd533e730 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1e50730)
 #1 0x0000639dd533bb3f llvm::sys::RunSignalHandlers() (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1e4db3f)
 #2 0x0000639dd533bc95 SignalHandler(int) Signals.cpp:0:0
 #3 0x000070a488442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000070a4884969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x000070a4884969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x000070a4884969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x000070a488442476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x000070a4884287f3 abort ./stdlib/abort.c:81:7
 #9 0x000070a48842871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x000070a488439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x0000639dd50303f5 (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1b423f5)
#12 0x0000639dd5030c3d llvm::MCSymbolRefExpr::create(llvm::MCSymbol const*, llvm::MCSymbolRefExpr::VariantKind, llvm::MCContext&, llvm::SMLoc) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1b42c3d)
#13 0x0000639dd5061984 llvm::MCStreamer::emitSymbolValue(llvm::MCSymbol const*, unsigned int, bool) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1b73984)
#14 0x0000639dd60edd41 llvm::DwarfDebug::emitDebugMacinfoImpl(llvm::MCSection*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2bffd41)
#15 0x0000639dd6107724 llvm::DwarfDebug::endModule() (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2c19724)
#16 0x0000639dd60c8f89 llvm::AsmPrinter::doFinalization(llvm::Module&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2bdaf89)
#17 0x0000639dd4de4cd5 llvm::FPPassManager::doFinalization(llvm::Module&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x18f6cd5)
#18 0x0000639dd4df0dff llvm::legacy::PassManagerImpl::run(llvm::Module&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1902dff)
#19 0x0000639dd559b92c clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, 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*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x20ad92c)
#20 0x0000639dd5bb8ab7 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x26caab7)
#21 0x0000639dd783715c clang::ParseAST(clang::Sema&, bool, bool) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x434915c)
#22 0x0000639dd5e50539 clang::FrontendAction::Execute() (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2962539)
#23 0x0000639dd5dd4856 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x28e6856)
#24 0x0000639dd5f21ee5 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2a33ee5)
#25 0x0000639dd41ebeaf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0xcfdeaf)
#26 0x0000639dd41e5593 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#27 0x0000639dd41e830f clang_main(int, char**, llvm::ToolContext const&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0xcfa30f)
#28 0x0000639dd41269eb main (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0xc389eb)
#29 0x000070a488429d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#30 0x000070a488429e40 call_init ./csu/../csu/libc-start.c:128:20
#31 0x000070a488429e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#32 0x0000639dd41e4845 _start (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0xcf6845)
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 19.0.0git (https://github.com/llvm/llvm-project.git 1b761205f2686516cebadbcbc37f798197d9c482)
Target: riscv64-unknown-linux-gnu
Thread model: posix
InstalledDir: /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /scratch/tmp/red-02f3fc.c
clang: note: diagnostic msg: /scratch/tmp/red-02f3fc.sh
clang: note: diagnostic msg:

********************

Godbolt: https://godbolt.org/z/eY183Pd5f

Reproducer: red-02f3fc.zip

These two options might conflict, but if that's the case clang should probably throw an error instead of crashing.

Found via fuzzer.

llvmbot commented 4 months ago

@llvm/issue-subscribers-debuginfo

Author: Patrick O'Neill (patrick-rivos)

Testcase: ```c int main() { } ``` Backtrace: ``` clang-19: /scratch/tc-testing/tc-apr-4/llvm/llvm/lib/MC/MCExpr.cpp:207: llvm::MCSymbolRefExpr::MCSymbolRefExpr(const llvm::MCSymbol*, llvm::MCSymbolRefExpr::VariantKind, const llvm::MCAsmInfo*, llvm::SMLoc): Assertion `Symbol' failed. 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: /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19 -cc1 -triple riscv64-unknown-linux-gnu -emit-obj -mrelax-all -dumpdir a- -disable-free -clear-ast-before-backend -main-file-name red.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu generic-rv64 -target-feature +m -target-feature +a -target-feature +f -target-feature +d -target-feature +c -target-feature +zicsr -target-feature -e -target-feature -h -target-feature -shcounterenw -target-feature -shgatpa -target-feature -shtvala -target-feature -shvsatpa -target-feature -shvstvala -target-feature -shvstvecd -target-feature -smaia -target-feature -smepmp -target-feature -ssaia -target-feature -ssccptr -target-feature -sscofpmf -target-feature -sscounterenw -target-feature -ssstateen -target-feature -ssstrict -target-feature -sstc -target-feature -sstvala -target-feature -sstvecd -target-feature -ssu64xl -target-feature -svade -target-feature -svadu -target-feature -svbare -target-feature -svinval -target-feature -svnapot -target-feature -svpbmt -target-feature -v -target-feature -xcvalu -target-feature -xcvbi -target-feature -xcvbitmanip -target-feature -xcvelw -target-feature -xcvmac -target-feature -xcvmem -target-feature -xcvsimd -target-feature -xsfcease -target-feature -xsfvcp -target-feature -xsfvfnrclipxfqf -target-feature -xsfvfwmaccqqq -target-feature -xsfvqmaccdod -target-feature -xsfvqmaccqoq -target-feature -xsifivecdiscarddlone -target-feature -xsifivecflushdlone -target-feature -xtheadba -target-feature -xtheadbb -target-feature -xtheadbs -target-feature -xtheadcmo -target-feature -xtheadcondmov -target-feature -xtheadfmemidx -target-feature -xtheadmac -target-feature -xtheadmemidx -target-feature -xtheadmempair -target-feature -xtheadsync -target-feature -xtheadvdot -target-feature -xventanacondops -target-feature -za128rs -target-feature -za64rs -target-feature -zacas -target-feature -zawrs -target-feature -zba -target-feature -zbb -target-feature -zbc -target-feature -zbkb -target-feature -zbkc -target-feature -zbkx -target-feature -zbs -target-feature -zca -target-feature -zcb -target-feature -zcd -target-feature -zce -target-feature -zcf -target-feature -zcmp -target-feature -zcmt -target-feature -zdinx -target-feature -zfa -target-feature -zfh -target-feature -zfhmin -target-feature -zfinx -target-feature -zhinx -target-feature -zhinxmin -target-feature -zic64b -target-feature -zicbom -target-feature -zicbop -target-feature -zicboz -target-feature -ziccamoa -target-feature -ziccif -target-feature -zicclsm -target-feature -ziccrse -target-feature -zicntr -target-feature -zicond -target-feature -zifencei -target-feature -zihintntl -target-feature -zihintpause -target-feature -zihpm -target-feature -zk -target-feature -zkn -target-feature -zknd -target-feature -zkne -target-feature -zknh -target-feature -zkr -target-feature -zks -target-feature -zksed -target-feature -zksh -target-feature -zkt -target-feature -zmmul -target-feature -zvbb -target-feature -zvbc -target-feature -zve32f -target-feature -zve32x -target-feature -zve64d -target-feature -zve64f -target-feature -zve64x -target-feature -zvfh -target-feature -zvfhmin -target-feature -zvkb -target-feature -zvkg -target-feature -zvkn -target-feature -zvknc -target-feature -zvkned -target-feature -zvkng -target-feature -zvknha -target-feature -zvknhb -target-feature -zvks -target-feature -zvksc -target-feature -zvksed -target-feature -zvksg -target-feature -zvksh -target-feature -zvkt -target-feature -zvl1024b -target-feature -zvl128b -target-feature -zvl16384b -target-feature -zvl2048b -target-feature -zvl256b -target-feature -zvl32768b -target-feature -zvl32b -target-feature -zvl4096b -target-feature -zvl512b -target-feature -zvl64b -target-feature -zvl65536b -target-feature -zvl8192b -target-feature -experimental-smmpm -target-feature -experimental-smnpm -target-feature -experimental-ssnpm -target-feature -experimental-sspm -target-feature -experimental-ssqosid -target-feature -experimental-supm -target-feature -experimental-zaamo -target-feature -experimental-zabha -target-feature -experimental-zalasr -target-feature -experimental-zalrsc -target-feature -experimental-zcmop -target-feature -experimental-zfbfmin -target-feature -experimental-zicfilp -target-feature -experimental-zicfiss -target-feature -experimental-zimop -target-feature -experimental-ztso -target-feature -experimental-zvfbfmin -target-feature -experimental-zvfbfwma -target-feature +relax -target-abi lp64d -msmall-data-limit 8 -debug-info-kind=line-directives-only -dwarf-version=5 -debugger-tuning=gdb -debug-info-macro -fdebug-compilation-dir=/scratch/tc-testing/compiler-fuzz-ci/csmith-discoveries/llvm-rand-opt-30-1 -fcoverage-compilation-dir=/scratch/tc-testing/compiler-fuzz-ci/csmith-discoveries/llvm-rand-opt-30-1 -resource-dir /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/lib/clang/19 -isysroot /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot -internal-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/lib/clang/19/include -internal-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot/usr/local/include -internal-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot/lib/gcc/riscv64-unknown-linux-gnu/14.0.1/../../../../riscv64-unknown-linux-gnu/include -internal-externc-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot/include -internal-externc-isystem /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/../sysroot/usr/include -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /scratch/tmp/red-bc7993.o -x c red.c 1. <eof> parser at end of file 2. Code generation #0 0x0000639dd533e730 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1e50730) #1 0x0000639dd533bb3f llvm::sys::RunSignalHandlers() (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1e4db3f) #2 0x0000639dd533bc95 SignalHandler(int) Signals.cpp:0:0 #3 0x000070a488442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) #4 0x000070a4884969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76 #5 0x000070a4884969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10 #6 0x000070a4884969fc pthread_kill ./nptl/pthread_kill.c:89:10 #7 0x000070a488442476 gsignal ./signal/../sysdeps/posix/raise.c:27:6 #8 0x000070a4884287f3 abort ./stdlib/abort.c:81:7 #9 0x000070a48842871b _nl_load_domain ./intl/loadmsgcat.c:1177:9 #10 0x000070a488439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96) #11 0x0000639dd50303f5 (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1b423f5) #12 0x0000639dd5030c3d llvm::MCSymbolRefExpr::create(llvm::MCSymbol const*, llvm::MCSymbolRefExpr::VariantKind, llvm::MCContext&, llvm::SMLoc) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1b42c3d) #13 0x0000639dd5061984 llvm::MCStreamer::emitSymbolValue(llvm::MCSymbol const*, unsigned int, bool) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1b73984) #14 0x0000639dd60edd41 llvm::DwarfDebug::emitDebugMacinfoImpl(llvm::MCSection*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2bffd41) #15 0x0000639dd6107724 llvm::DwarfDebug::endModule() (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2c19724) #16 0x0000639dd60c8f89 llvm::AsmPrinter::doFinalization(llvm::Module&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2bdaf89) #17 0x0000639dd4de4cd5 llvm::FPPassManager::doFinalization(llvm::Module&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x18f6cd5) #18 0x0000639dd4df0dff llvm::legacy::PassManagerImpl::run(llvm::Module&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x1902dff) #19 0x0000639dd559b92c clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, 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*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x20ad92c) #20 0x0000639dd5bb8ab7 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x26caab7) #21 0x0000639dd783715c clang::ParseAST(clang::Sema&, bool, bool) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x434915c) #22 0x0000639dd5e50539 clang::FrontendAction::Execute() (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2962539) #23 0x0000639dd5dd4856 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x28e6856) #24 0x0000639dd5f21ee5 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0x2a33ee5) #25 0x0000639dd41ebeaf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0xcfdeaf) #26 0x0000639dd41e5593 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0 #27 0x0000639dd41e830f clang_main(int, char**, llvm::ToolContext const&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0xcfa30f) #28 0x0000639dd41269eb main (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0xc389eb) #29 0x000070a488429d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 #30 0x000070a488429e40 call_init ./csu/../csu/libc-start.c:128:20 #31 0x000070a488429e40 __libc_start_main ./csu/../csu/libc-start.c:379:5 #32 0x0000639dd41e4845 _start (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang-19+0xcf6845) clang: error: unable to execute command: Aborted (core dumped) clang: error: clang frontend command failed due to signal (use -v to see invocation) clang version 19.0.0git (https://github.com/llvm/llvm-project.git 1b761205f2686516cebadbcbc37f798197d9c482) Target: riscv64-unknown-linux-gnu Thread model: posix InstalledDir: /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /scratch/tmp/red-02f3fc.c clang: note: diagnostic msg: /scratch/tmp/red-02f3fc.sh clang: note: diagnostic msg: ******************** ``` Godbolt: https://godbolt.org/z/eY183Pd5f Reproducer: [red-02f3fc.zip](https://github.com/llvm/llvm-project/files/14921726/red-02f3fc.zip) These two options might conflict, but if that's the case clang should probably throw an error instead of crashing. Found via fuzzer.