-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Assertion failed 'retExpr->gtOper == GT_RETURN' caused by SuppressGCTransition #13654
Comments
@AaronRobinsonMSFT We should hold off adding SuppressGCTransition in any more places until this is fixed. (I expect that the problem is affecting all platforms. We just got lucky to not hit it anywhere else yet.) |
@jkotas Agreed. |
* Update dependencies from https://github.com/dotnet/corefx build 20191024.13 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.13 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.13 * Update dependencies from https://github.com/dotnet/corefx build 20191024.14 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.14 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.14 * Update dependencies from https://github.com/dotnet/corefx build 20191025.6 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19525.6 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19525.6 * Workaround https://github.com/dotnet/coreclr/issues/27465
* Update dependencies from https://github.com/dotnet/corefx build 20191024.13 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.13 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.13 * Update dependencies from https://github.com/dotnet/corefx build 20191024.14 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.14 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.14 * Update dependencies from https://github.com/dotnet/corefx build 20191025.6 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19525.6 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19525.6 * Workaround https://github.com/dotnet/coreclr/issues/27465 Signed-off-by: dotnet-bot <[email protected]>
* Update dependencies from https://github.com/dotnet/corefx build 20191024.13 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.13 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.13 * Update dependencies from https://github.com/dotnet/corefx build 20191024.14 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.14 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.14 * Update dependencies from https://github.com/dotnet/corefx build 20191025.6 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19525.6 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19525.6 * Workaround https://github.com/dotnet/coreclr/issues/27465 Signed-off-by: dotnet-bot <[email protected]>
Issue doesn't repro on Windows x64. I am using the following code and setting Managed using System;
using System.Threading;
using System.Runtime.InteropServices;
namespace System.Runtime.InteropServices
{
public class SuppressGCTransitionAttribute : Attribute
{
public SuppressGCTransitionAttribute() { }
}
}
partial class SW
{
public static long GetTimestamp()
{
return QueryPerformanceCounter();
}
}
partial class SW
{
private static long QueryPerformanceCounter()
{
return (long)NativeLib.GetTimestamp();
}
static class NativeLib
{
public const string Path = @"NativeLib.dll";
[DllImport(Path, EntryPoint = "SystemNative_GetTimestamp", ExactSpelling = true)]
[SuppressGCTransition]
internal static extern ulong GetTimestamp();
}
}
namespace PInvokeTesting
{
public unsafe class Program
{
private static readonly ManualResetEvent s_sleepEvent = new ManualResetEvent(false);
static void Main(string[] args)
{
long ts1 = SW.GetTimestamp();
Sleep();
long ts2 = SW.GetTimestamp();
Assert.NotEqual(ts1, ts2);
}
private static void Sleep(int milliseconds = 1)
{
s_sleepEvent.WaitOne(milliseconds);
}
}
public static class Assert
{
static public void NotEqual(long a, long b)
{
if (a == b)
{
throw new Exception("Bad");
}
}
}
} Native #include <cstdint>
#define EXPORT extern "C" __declspec(dllexport)
#define CALLCONV __stdcall
namespace
{
std::atomic<uint64_t> _n{ 0 };
}
EXPORT
uint64_t CALLCONV SystemNative_GetTimestamp()
{
return (++_n);
} |
* Update dependencies from https://github.com/dotnet/corefx build 20191024.13 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.13 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.13 * Update dependencies from https://github.com/dotnet/corefx build 20191024.14 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.14 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.14 * Update dependencies from https://github.com/dotnet/corefx build 20191025.6 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19525.6 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19525.6 * Workaround https://github.com/dotnet/coreclr/issues/27465 Signed-off-by: dotnet-bot <[email protected]>
* Update dependencies from https://github.com/dotnet/corefx build 20191024.13 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.13 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.13 * Update dependencies from https://github.com/dotnet/corefx build 20191024.14 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.14 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.14 * Update dependencies from https://github.com/dotnet/corefx build 20191025.6 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19525.6 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19525.6 * Workaround https://github.com/dotnet/coreclr/issues/27465 Signed-off-by: dotnet-bot <[email protected]>
* Update dependencies from https://github.com/dotnet/corefx build 20191024.13 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.13 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.13 * Update dependencies from https://github.com/dotnet/corefx build 20191024.14 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.14 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.14 * Update dependencies from https://github.com/dotnet/corefx build 20191025.6 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19525.6 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19525.6 * Workaround https://github.com/dotnet/coreclr/issues/27465 Signed-off-by: dotnet-bot <[email protected]>
Also unable to reproduce this on macOS using the above source. I am going to try Linux, but getting less optimistic the code above represents the issue or this is a targeted issue on the Linux platform. |
You may need to disable tiered compilation to reproduce this. |
@jkotas I have been passing |
I had repro'd locally on linux via the CoreFX test directly. It required a checked CoreCLR and a Release build of CoreFX. I disabled tiered compilation by exporting an environment variable in bash. |
@tannergooding Yeah. That is what I am doing now. I'm not that competent with CoreFX testing and find it incredibly hard to do quickly so alas am building the world. If you still have a local repo is there any way you could provide the JIT dump for the test? (e.g. |
I wont be able to tonight, but can tomorrow morning. |
I just don't understand how CoreFX tests work. I am following the directions here with very little luck or progress. I built from the root first with
|
I just manually invoke the |
(Paths are from memory, as I dont have my computer handy, but they should be roughly correct). Also worth noting that the failure log gives a full command line for running all tests for a given test.dll (should be something like |
|
* Update dependencies from https://github.com/dotnet/corefx build 20191024.13 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.13 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.13 * Update dependencies from https://github.com/dotnet/corefx build 20191024.14 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.14 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.14 * Update dependencies from https://github.com/dotnet/corefx build 20191025.6 - Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19525.6 - Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19525.6 * Workaround https://github.com/dotnet/coreclr/issues/27465 Signed-off-by: dotnet-bot <[email protected]>
[EDIT] Now have a repro on Windows x64 This is an interesting issue that I am going to need some help from @dotnet/jit-contrib to help out with. If I remove the using System;
using System.Diagnostics;
using System.Threading;
public class Program
{
static void Main(string[] args)
{
RunTest();
}
static void RunTest()
{
long ts1 = Stopwatch.GetTimestamp();
long ts2 = Stopwatch.GetTimestamp();
NotEqual(ts1, ts2);
}
static public void NotEqual(long a, long b)
{
Console.WriteLine("NotEqual");
}
} Windows repro using System;
using System.Diagnostics;
using System.Threading;
using System.Runtime.InteropServices;
namespace System.Runtime.InteropServices
{
public class SuppressGCTransitionAttribute : Attribute
{
public SuppressGCTransitionAttribute() { }
}
}
static class NativeLib
{
public const string Path = @"NativeLib.dll";
[DllImport(Path, EntryPoint = "SystemNative_GetTimestamp")]
[SuppressGCTransition]
internal static extern ulong GetTimestamp();
}
namespace PInvokeTesting
{
public unsafe class Program
{
static void Main(string[] args)
{
RunTest();
}
static void RunTest()
{
long ts1 = (long)NativeLib.GetTimestamp();
long ts2 = (long)NativeLib.GetTimestamp();
NotEqual(ts1, ts2);
}
static public void NotEqual(long a, long b)
{
Console.WriteLine("NotEqual");
}
}
} |
I think I see what is going on here and it is not great. The issue here is /cc @jkotas @dotnet/jit-contrib @briansull |
The text was updated successfully, but these errors were encountered: