-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Assertion failure: (FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments") when building in Release mode. #64642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Tagging @asavonic |
@fibrechannelscsi We cannot reproduce via And as far as I can see from Will you please double check? |
Cannot reproduce with For the record, here is the version of the compiler:
|
Ok, I see the issue. If I run, for example: |
@fibrechannelscsi can you pick the cmdline? So we can compare the difference? |
64642A.txt I do see in some cases it's using a different triple ( |
So, the difference is
|
SIL variables can be split by SILSROA into separate allocations, each having op_fragment expressions in debug_value (VarInfo.DIExpr). These allocations can be further split by IRGen (multiple values in Storage argument). These "nested" fragments refer to the same DI variable, so it is important to merge them for the LLVM IR DI expression. The compiler used to ignore fragment expressions from SIL when IRGen fragments were also present. This led to incorrect DI info generation, and for some cases even triggered assertions in LLVM X86 CodeGen: DwarfExpression.cpp:679: void llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression *): Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed. The patch fixes issue swiftlang#64642. The LIT test is a reduced reproducer from that issue.
…66448) SIL variables can be split by SILSROA into separate allocations, each having op_fragment expressions in debug_value (VarInfo.DIExpr). These allocations can be further split by IRGen (multiple values in Storage argument). These "nested" fragments refer to the same DI variable, so it is important to merge them for the LLVM IR DI expression. The compiler used to ignore fragment expressions from SIL when IRGen fragments were also present. This led to incorrect DI info generation, and for some cases even triggered assertions in LLVM X86 CodeGen: DwarfExpression.cpp:679: void llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression *): Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed. The patch fixes issue #64642. The LIT test is a reduced reproducer from that issue.
Description
The compiler generates an error message when attempting to compile the following code in Release mode. The exact error message is:
Assertion failed: (FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"), function addFragmentOffset, file DwarfExpression.cpp, line 679.
Steps to reproduce
This reproducer requires four files: two
Package.swift
files (one is for an internal package), and two regular Swift source files.The directory tree looks like this:
Listing for
./Package.swift
:Listing for
./Sources/InternalPackage/Package.swift
:Listing for
./Sources/InternalPackage/Sources/InternalPackage/User.swift
:Listing for
./Sources/ReproducerServer/Auth.swift
:Expected behavior
The compilation should complete successfully.
Environment
Additional Information
Stack trace:
Note that performing any of these operations causes the build to succeed:
User.swift
intoAuth.swift
.validateTOTP()
to simplyreturn true
.This may be similar to this issue:
#55703
however, Autodiff is not involved.
The text was updated successfully, but these errors were encountered: