Assert failure/crash in LoadableByAddress
pass in getAddressForValue
when building FoundationEssentials
#78954
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
Description
When building FoundationEssentials with
--release --skip-early-swift-driver --skip-early-swiftsyntax
(and #77815), the frontend crashes or asserts withswift-frontend: ~/src/swift/swift/lib/IRGen/LoadableByAddress.cpp:3860: SILValue (anonymous namespace)::AddressAssignment::getAddressForValue(SILValue): Assertion
it != valueToAddressMap.end()' failed.`The workaround listed in #71744 (comment) still works (i.e., add
-Xfrontend -disable-large-loadable-types-reg2mem
to thetarget_compile_options
inswift-foundation/Sources/FoundationEssentials/CMakeLists.txt
). This only seems to reliably trip with Release builds; using Debug or RelWithDebInfo is also a workaround.(Source paths lightly redacted.)
Reproduction
Unfortunately, I haven't identified a very small reproducing case. I know this is a nonstandard configuration but I don't think this means the underlying issue can or should be necessarily fully discounted, especially since this looks very closely related to #71744 and the resolution in #72617.
This can be reproduced on Linux by applying #77815 at HEAD as well as the following.
Then build:
Stack dump
Expected behavior
Library successfully created.
Environment
Linux/x86_64 with #77815 and above diff to ensure successful compilation, Release builds.
Also triggers on OpenBSD/arm64, same conditions.
Additional information
Backtrace fragment (from Linux).
If I rebuild just
LoadableByAddress.cpp
with debug info enabled, then we get a bit more information. gdb session fragment:Forcibly dumping the silMod (
silMod->dump("...some file", true);
at the start ofrunPeepholesAndReg2Mem
) and examining the output shows this is related toNote this is an
unchecked_bitwise_cast
instruction but looks slightly different from theSILInstruction::dump
, but this looks like it is the closest thing that seems to be related.The text was updated successfully, but these errors were encountered: