Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

ICE while generating debug information #51551

Open Quuxplusone opened 2 years ago

Quuxplusone commented 2 years ago
Bugzilla Link PR52584
Status NEW
Importance P enhancement
Reported by Mark de Wever (koraq@xs4all.nl)
Reported on 2021-11-22 10:15:00 -0800
Last modified on 2021-11-22 16:09:23 -0800
Version trunk
Hardware PC Linux
CC dblaikie@gmail.com, jdevlieghere@apple.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com
Fixed by commit(s)
Attachments d2fixed-8fb87e.reduced.bt (10733 bytes, text/plain)
d2fixed-8fb87e.reduced.cpp (314 bytes, text/x-c++src)
d2fixed-8fb87e.reduced.sh (116 bytes, application/x-shellscript)
Blocks
Blocked by
See also
Created attachment 25469
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.
Quuxplusone commented 2 years ago

Attached d2fixed-8fb87e.reduced.bt (10733 bytes, text/plain): backtrace of the crash

Quuxplusone commented 2 years ago

Attached d2fixed-8fb87e.reduced.cpp (314 bytes, text/x-c++src): Reduced source

Quuxplusone commented 2 years ago

Attached d2fixed-8fb87e.reduced.sh (116 bytes, application/x-shellscript): Reduced run script

Quuxplusone commented 2 years ago

Seems to reproduce with any debug info generation, not gmlt (no variables), but otherwise it'll crash.

Quuxplusone commented 2 years ago
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.
Quuxplusone commented 2 years ago

This is probably a dup of PR52333, or a similar class of issues.