-
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
OSR stress failure in System.Diagnostics.DiagnosticsSource.Tests #67078
Comments
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti Issue DetailsFrom libraries pgo CI job: https://dev.azure.com/dnceng/public/_test/analytics?definitionId=1002&contextType=build
Have isolated this via
|
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsFrom libraries pgo CI job: https://dev.azure.com/dnceng/public/_test/analytics?definitionId=1002&contextType=build
Have isolated this via
|
The problem is that we're too aggressive with struct promotion (likely a result of #65903). Relatively simple repro case using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
interface IFoo
{
public Span<object> AsSpan();
}
public struct ObjectSequence1 : IFoo
{
public object Value1;
public Span<object> AsSpan()
{
return MemoryMarshal.CreateSpan(ref Value1, 1);
}
}
public struct ObjectSequenceMany : IFoo
{
public object[] _values;
public Span<object> AsSpan()
{
return _values.AsSpan();
}
public ObjectSequenceMany(object[] x)
{
_values = x;
}
}
public class InvalidOSRPromotion
{
[MethodImpl(MethodImplOptions.NoInlining)]
static bool G<T>(int n) where T : IFoo
{
T values = default;
if (values is ObjectSequenceMany)
{
values = (T)(object)new ObjectSequenceMany(new object[5]);
}
Span<object> indexedValues = values.AsSpan();
for (int i = 0; i < n; i++)
{
indexedValues[i] = "foo";
}
if (values is ObjectSequence1)
{
return (indexedValues[0] == ((ObjectSequence1)(object)values).Value1);
}
return false;
}
public static int Main()
{
return G<ObjectSequence1>(1) ? 100 : -1;
}
} run this with
The OSR method will unsoundly promote the |
From libraries pgo CI job: https://dev.azure.com/dnceng/public/_test/analytics?definitionId=1002&contextType=build
Have isolated this via
COMPlus_JitEnablePatchpointRange
to this method:The text was updated successfully, but these errors were encountered: