-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Span<byte> from local variable bug in .net 7.x Release #89666
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsDescriptionWhen using Span to map a local variable to an array, after a certain number of iterations, changing the local variable does not change the bytes in the Span
Reproduction Steps
Expected behaviorall output files must be identical Actual behavior
Regression?No response Known WorkaroundsNo response Configuration.net 6.0.20 Other informationNo response
|
Does this reproduce with This looks like an OSR bug, cc @AndyAyersMS |
Yes, it does. @check4game thank you for reporting this. |
Also repros in 8.0. |
@dotnet/jit-contrib feel free to poach this one if you want to gain some experience with OSR. |
The bug is in this bit of code. For OSR we don't have accurate ref counts like we do for regular methods, since some of the uses may be in the Tier0 part of the method. runtime/src/coreclr/jit/liveness.cpp Lines 1576 to 1599 in e42429e
Fix is to simply exclude OSR locals here. |
The local var ref count for OSR locals can be misleading, since some of the appearances may be in the "tier0" parts of the methods and won't be visible once we trim the OSR method down to just the part we're going to compile. So, we can't rely on ref counts to enable a dead store of an OSR local. Fixes dotnet#89666.
The local var ref count for OSR locals can be misleading, since some of the appearances may be in the "tier0" parts of the methods and won't be visible once we trim the OSR method down to just the part we're going to compile. Fix by giving OSR-exposed locals an implicit ref count. Fixes #89666.
Backport of dotnet#89743 to 7.0. The local var ref count for OSR locals can be misleading, since some of the appearances may be in the "tier0" parts of the methods and won't be visible once we trim the OSR method down to just the part we're going to compile. Fix by giving OSR-exposed locals an implicit ref count. Fixes dotnet#89666.
Backport of dotnet#89743 to 7.0. The local var ref count for OSR locals can be misleading, since some of the appearances may be in the "tier0" parts of the methods and won't be visible once we trim the OSR method down to just the part we're going to compile. Fix by giving OSR-exposed locals an implicit ref count. Fixes dotnet#89666.
Backport of #89743 to 7.0. The local var ref count for OSR locals can be misleading, since some of the appearances may be in the "tier0" parts of the methods and won't be visible once we trim the OSR method down to just the part we're going to compile. Fix by giving OSR-exposed locals an implicit ref count. Fixes #89666.
Description
When using Span to map a local variable to an array, after a certain number of iterations, changing the local variable does not change the bytes in the Span
Reproduction Steps
Expected behavior
all output files must be identical
Actual behavior
Regression?
No response
Known Workarounds
No response
Configuration
.net 6.0.20
.net 7.0.9
Windows Server 2022
Other information
No response
The text was updated successfully, but these errors were encountered: