[PATCH] D144006: [DebugMetadata][DwarfDebug] Support function-local types in lexical block scopes (4/7)

Jeremy Morse via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 04:11:39 PST 2023


jmorse added subscribers: StephenTozer, jmorse.
jmorse added a comment.

Hi,

Just to note that we've been seeing LTO crashes as a result of rG3b449bd46a11a <https://reviews.llvm.org/rG3b449bd46a11a55a40cbc0016a99b202fa05248e> (now reverted on trunk), which @StephenTozer has kindly reduced down to:

  https://gist.github.com/jmorse/b0248c3c9f9195487ffd7c7431a8d15e

Which triggers the assertion: DwarfDebug.cpp:2335: virtual void llvm::DwarfDebug::endFunctionImpl(const llvm::MachineFunction *): Assertion `LScopes.getAbstractScopesList().size() == NumAbstractSubprograms && "getOrCreateAbstractScope() inserted an abstract subprogram scope"' failed. If you revert-the-revert rG6beddd668 <https://reviews.llvm.org/rG6beddd668adf8e6bddbbc58ec02e4728dd889e9e> that is.

I haven't familiarised myself with this patch series (while greatly appreciating that it exists!), so perhaps this is already obvious but: This particular assertion is a check that no additional lexical scopes are discovered during DWARF emission that weren't found during the earlier building of the lexical-scopes-map, which enumerates all scopes/inlining-chains for all instructions' DebugLocs. If any more unexpectedly appear after that, I believe there's a risk that a container for lexical scopes gets reallocated, causing random crashes. I see there are now types in the retainedNodes field for DISubprograms with "scope" fields, I imagine that the discovery of those lexical scopes which weren't reachable from instructions might be causing the assertion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144006/new/

https://reviews.llvm.org/D144006



More information about the cfe-commits mailing list