[llvm] [clang] [CloneFunction][DebugInfo] Avoid cloning DILocalVariables of inlined functions (PR #75385)

Vladislav Dzhidzhoev via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 23 03:54:46 PST 2024


dzhidzhoev wrote:

> Hi,
> 
> We're seeing a crash with this commit and reproducer https://gist.github.com/jmorse/b0248c3c9f9195487ffd7c7431a8d15e
> 
> llc: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2338: virtual void llvm::DwarfDebug::endFunctionImpl(const llvm::MachineFunction *): Assertion `LScopes.getAbstractScopesList().size() == NumAbstractSubprograms && "getOrCreateAbstractScope() inserted an abstract subprogram scope"' failed.
> 
> I'd previously posted the reproducer on https://reviews.llvm.org/D144006#4656728 , however I'd anonymised the IR too much to the point where it was broken in unrelated ways. Revision 2 of the gist, as linked, should produce the crash. I suspect the extra lexical scopes reachable through the retained-nodes list also need to be explored when the LexicalScopes object gets constructed, to avoid scopes being added late and causing containers to invalidate iterators. (Which is what that assertion is there to detect).

Hello,

Sorry for bothering you. Could you please share the command you used as an interestingness test to reduce the crash? I've tried running llc/opt/ld.lld, but I haven't been able to reproduce it :( 

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


More information about the cfe-commits mailing list