Created attachment 25469 [details] backtrace of the crash While testing https://reviews.llvm.org/D70631 with the libc++ buildkite CI this build results in an crash https://buildkite.com/llvm-project/libcxx-ci/builds/6587#d7ec64f2-e31a-4d73-8d6c-e118e63a0cc1 The CI job builds clang and uses that Clang to build the patch. https://github.com/llvm/llvm-project/blob/main/libcxx/utils/ci/run-buildbot#L470 Two work-arounds are - Remove -DLLVM_ENABLE_ASSERTIONS=ON - Change the build type to Release Attached the backtrace and reduced reproducer.
Created attachment 25470 [details] Reduced source
Created attachment 25471 [details] Reduced run script
Seems to reproduce with any debug info generation, not gmlt (no variables), but otherwise it'll crash.
Specifically the crash is around: clang-tot: /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:509: void llvm::DwarfExpression::addExpression(llvm::DIExpressionCursor &&, llvm::function_ref<bool (unsigned int, DIExpressionCursor &)>): Assertion `SizeInBits >= OffsetInBits - FragmentOffset && "size underflow"' failed.
This is probably a dup of PR52333, or a similar class of issues.