[llvm] [SelectionDAG] Fix null pointer dereference in resolveDanglingDebugInfo (PR #173500)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 28 22:49:05 PST 2025


MetalOxideSemi wrote:

> > @MacDue @MetalOxideSemi -- We are seeing crashes on the test introduced in this PR in our builders. Please fix or revert. Thank you.
> > 
> > 
> > 
> > https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-host-mac-x64/b8694215607458775105/overview
> > 
> > 
> > 
> > ```
> > 
> > UNSUPPORTED: LLVM :: CodeGen/Hexagon/cext-valid-packet2.ll (13783 of 61939)
> > 
> > FAIL: LLVM :: CodeGen/Generic/selectiondag-dbgvalue-null-crash.ll (13784 of 61939)
> > 
> > ******************** TEST 'LLVM :: CodeGen/Generic/selectiondag-dbgvalue-null-crash.ll' FAILED ********************
> > 
> > Exit Code: 139
> > 
> > 
> > 
> > Command Output (stderr):
> > 
> > --
> > 
> > /Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc -O3 < /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/llvm/test/CodeGen/Generic/selectiondag-dbgvalue-null-crash.ll # RUN: at line 1
> > 
> > + /Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc -O3
> > 
> > PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
> > 
> > Stack dump:
> > 
> > 0.	Program arguments: /Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc -O3
> > 
> > 1.	Running pass 'Function Pass Manager' on module '<stdin>'.
> > 
> > 2.	Running pass 'X86 Assembly Printer' on function '@test'
> > 
> >  #0 0x00000001089770d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x10240b0d8)
> > 
> >  #1 0x0000000108974aab llvm::sys::RunSignalHandlers() (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x102408aab)
> > 
> >  #2 0x0000000108977d82 SignalHandler(int, __siginfo*, void*) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x10240bd82)
> > 
> >  #3 0x00007ff8151be37d (/usr/lib/system/libsystem_platform.dylib+0x7ff802bc137d)
> > 
> >  #4 0x00007ff046904a00
> > 
> >  #5 0x00000001076105ed llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction const*) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x1010a45ed)
> > 
> >  #6 0x00000001075eba23 llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x10107fa23)
> > 
> >  #7 0x00000001075bbddf llvm::AsmPrinter::emitFunctionBody() (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x10104fddf)
> > 
> >  #8 0x0000000106673a84 llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x100107a84)
> > 
> >  #9 0x00000001078d3433 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x101367433)
> > 
> > #10 0x0000000107e9ded4 llvm::FPPassManager::runOnFunction(llvm::Function&) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x101931ed4)
> > 
> > #11 0x0000000107ea5c34 llvm::FPPassManager::runOnModule(llvm::Module&) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x101939c34)
> > 
> > #12 0x0000000107e9e948 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x101932948)
> > 
> > #13 0x00000001065a6d87 main (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc+0x10003ad87)
> > 
> > #14 0x00007ff814ddd781
> > 
> > /Volumes/Work/s/w/ir/x/w/llvm_build/test/CodeGen/Generic/Output/selectiondag-dbgvalue-null-crash.ll.script: line 1: 43274 Segmentation fault: 11  /Volumes/Work/s/w/ir/x/w/llvm_build/bin/llc -O3 < /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/llvm/test/CodeGen/Generic/selectiondag-dbgvalue-null-crash.ll
> > 
> > 
> > 
> > --
> > 
> > 
> > 
> > ```
> 
> Hi, I see the test is failing on macOS CI. This appears to be revealing a pre-existing platform-specific bug, not an issue with the original fix.
> 
> I'll soon creat a follow-up PR to temporarily disable the test on Darwin while investigating. 
> 
> The original fix is correct - the null check prevents a real crash on all platforms. The macOS failure is a separate, pre-existing issue.
> 

cc @arsenm @MacDue 

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


More information about the llvm-commits mailing list