LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 52584 - ICE while generating debug information
Summary: ICE while generating debug information
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: DebugInfo (show other bugs)
Version: trunk
Hardware: PC Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-22 10:15 PST by Mark de Wever
Modified: 2021-11-22 16:09 PST (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments
backtrace of the crash (10.48 KB, text/plain)
2021-11-22 10:15 PST, Mark de Wever
Details
Reduced source (314 bytes, text/x-c++src)
2021-11-22 10:16 PST, Mark de Wever
Details
Reduced run script (116 bytes, application/x-shellscript)
2021-11-22 10:16 PST, Mark de Wever
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark de Wever 2021-11-22 10:15:00 PST
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.
Comment 1 Mark de Wever 2021-11-22 10:16:03 PST
Created attachment 25470 [details]
Reduced source
Comment 2 Mark de Wever 2021-11-22 10:16:29 PST
Created attachment 25471 [details]
Reduced run script
Comment 3 David Blaikie 2021-11-22 10:56:17 PST
Seems to reproduce with any debug info generation, not gmlt (no variables), but otherwise it'll crash.
Comment 4 David Blaikie 2021-11-22 10:56:47 PST
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.
Comment 5 David Blaikie 2021-11-22 16:09:23 PST
This is probably a dup of PR52333, or a similar class of issues.