You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
linux ARM64 dotnet7 regression preview 4 to preview 5, 6 and 7 #72645
When I attempt to build my application, there is an error coming from crossgen2. I get a different error with dotnet7 preview 5 vs preview 6. Both errors smell like SIGSEGV, and both smell of a corrupted heap. Perhaps other dotnet7 previews have this corruption, but it isn't noticed.
/home/msft/dotnet_all/dotnet7.0/sdk/7.0.100-preview.5.22307.18/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(464,5): error : Process terminated. Access Violation: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The application will be terminated since this platform does not support throwing an AccessViolationException. [/mnt/msft/dotnet_techempower/aspnet/benchmarks/src/BenchmarksApps/Kestrel/PlatformBenchmarks/PlatformBenchmarks.csproj]
Reproduction Steps
Linux jammy on ARM64, using dotnet7 preview 5 or 6
Running under gdb, the top few stack frame looks like:
Switching to Thread 0xfffff7ff36a0 (LWP 2813)]
0x0000aaaaaae57160 in ILCompiler_TypeSystem_Internal_NativeFormat_TypeHashingAlgorithms__ComputeNameHashCode ()
(gdb) where
#0 0x0000aaaaaae57160 in ILCompiler_TypeSystem_Internal_NativeFormat_TypeHashingAlgorithms__ComputeNameHashCode ()
#1 0x0000aaaaaae5b214 in ILCompiler_TypeSystem_Internal_TypeSystem_InstantiatedType__GetMethod ()
#2 0x0000aaaaaae757e4 in ILCompiler_TypeSystem_Internal_TypeSystem_Ecma_EcmaModule__ResolveMemberReference ()
Expected behavior
no internal errors
Actual behavior
heap corruption
Regression?
No response
Known Workarounds
No response
Configuration
linux (ubuntu jammy 22.04) arm64 dotnet7 preview 4, 5 and 6 (4 OK[sic])
The error's presence and location seem to move around depending on the number of cores available for the job. 3 cores seemed to tickle this problem.
On ARM64 Linux ubuntu 22.04 with dotnet7 preview5, I set environment variables
COMPlus_EnableCrashReport=1
COMPlus_DbgEnableMiniDump=1
COMPlus_CreateDumpDiagnostics=1
I set ulimit -c unlimited
I set kernel config /proc/sys/kernel/core_pattern to /tmp/cores/core.%e.%p.%h.%t
I ran my build script to build my dotnet world.
I got 4 messages like:
/home/robhenry/dotnet_all/dotnet7.0/sdk/7.0.100-preview.5.22307.18/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(464,5): error : Process terminated. Access Violation: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The application will be terminated since this platform does not support throwing an AccessViolationException. [/mnt/robhenry/dotnet_techempower/aspnet/benchmarks/src/BenchmarksApps/Kestrel/PlatformBenchmarks/PlatformBenchmarks.csproj]
I got 4 core dump files.
I am unable to attach a zip of the corefile, since that is too large. The zip has been transmitted to agocke out-of-band.
I'm trying to build and run a dotnet runtime using gcc with the -fsanitize=thread (tsan), but I'm getting dynamic linking failures preventing me from making more progress
Yes, you can hit an intermittent failure building the repo like the one below:
ILCompiler.RyuJit -> /runtime/artifacts/bin/ILCompiler.RyuJit/arm64/Release/ILCompiler.RyuJit.dll
ILCompiler -> /runtime/artifacts/bin/coreclr/Linux.arm64.Release/ilc/ilc.dll
Optimizing assemblies for size. This process might take a while.
/runtime/.dotnet/sdk/7.0.100-preview.7.22377.5/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error : Process terminated. Access Violation: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The application will be terminated since this platform does not support throwing an AccessViolationException. [/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj]
/runtime/.dotnet/sdk/7.0.100-preview.7.22377.5/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(353,5): error NETSDK1096: Optimizing assemblies for performance failed. You can either exclude the failing assemblies from being optimized, or set the PublishReadyToRun property to false. [/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj]
The issue is that we are using the non-fixed crossgen2 binary from the Preview 7 NuGet package instead of the live one, which is fixed.
I do not think reverting back and forth the way crossgen2 is published has any effect on the crossgen that is actually in use, which is from Prevew 7 Nuget package.
Replacing the binaries in the nuget cache with a locally built copy might work, but is a fragile solution.
I can't think of a better workaround.
(I am also annoyed by the failures, my solution is basically try again, sometimes a few times)
Guess we should revert #74617 till we update the repo to use RC1.
Note that we actually need to check whether the host architecture is ARM64 instead of checking whether the target architecture is ARM64. If you target ARM64 on an x64 machine, you don't need that workaround.
Yep, and you can disable it in the config file just for this binary (e.g., /home/username/.nuget/packages/microsoft.netcore.app.crossgen2.linux-arm64/7.0.0-preview.7.22375.6/tools/crossgen2.runtimeconfig.json).
Otherwise should we just be manually reverting #74617 for now?
I don't think reverting that one has a connection to the crossgen2 crash while crossgenning ILC that Anton described (#72645 (comment)). That pull request doesn't affect the crossgen that is in use to crossgen ILC. It affects future crossgen in a future SDK.
Yep, and you can disable it in the config file just for this binary (e.g., /home/username/.nuget/packages/microsoft.netcore.app.crossgen2.linux-arm64/7.0.0-preview.7.22375.6/tools/crossgen2.runtimeconfig.json).
NativeAOT doesn't read runtimeconfig.json so this is likely just placebo effect. We were generating unused runtimeconfig and deps json files with NativeAOT in the past but that has been fixed.
NativeAOT doesn't read runtimeconfig.json so this is likely just placebo effect.
Thank you for the corrections. I have never actually tried that, just assumed that if we produce a file, it should probably work. :) Setting DOTNET_gcServer=0 certainly works for me.
ghost locked as resolved and limited conversation to collaborators on Sep 30, 2022
Activity
RobertHenry6bev commentedon Jul 21, 2022
area-crossgen2-coreclr
agocke commentedon Jul 22, 2022
This might be a NativeAOT bug. @RobertHenry6bev any chance you could get a dump file for the crash?
RobertHenry6bev commentedon Jul 25, 2022
On ARM64 Linux ubuntu 22.04 with dotnet7 preview5, I set environment variables
COMPlus_EnableCrashReport=1
COMPlus_DbgEnableMiniDump=1
COMPlus_CreateDumpDiagnostics=1
I set ulimit -c unlimited
I set kernel config /proc/sys/kernel/core_pattern to /tmp/cores/core.%e.%p.%h.%t
I ran my build script to build my dotnet world.
I got 4 messages like:
/home/robhenry/dotnet_all/dotnet7.0/sdk/7.0.100-preview.5.22307.18/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(464,5): error : Process terminated. Access Violation: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The application will be terminated since this platform does not support throwing an AccessViolationException. [/mnt/robhenry/dotnet_techempower/aspnet/benchmarks/src/BenchmarksApps/Kestrel/PlatformBenchmarks/PlatformBenchmarks.csproj]
I got 4 core dump files.
I am unable to attach a zip of the corefile, since that is too large. The zip has been transmitted to agocke out-of-band.
RobertHenry6bev commentedon Jul 27, 2022
I'm trying to build and run a dotnet runtime using gcc with the -fsanitize=thread (tsan), but I'm getting dynamic linking failures preventing me from making more progress
29 remaining items
a74nh commentedon Aug 30, 2022
I'm seeing this failure on latest HEAD of runtime building on Arm64 Linux.
I see that it fixes when applying #74211, but that PR was removed with #74617
How should I be doing my Arm64 Linux builds?
(edit: fix link)
kunalspathak commentedon Aug 30, 2022
What are the errors?
AntonLapounov commentedon Aug 30, 2022
Yes, you can hit an intermittent failure building the repo like the one below:
The issue is that we are using the non-fixed
crossgen2binary from the Preview 7 NuGet package instead of the live one, which is fixed.a74nh commentedon Aug 30, 2022
That's the one I'm hitting, but it's every time (HiSilicon D05 with Ubuntu 18.04)
Is there an easy workaround to force the build to use the live version?
Otherwise should we just be manually reverting #74617 for now?
Do you know roughly when this will be fixed properly?
AntonLapounov commentedon Aug 30, 2022
Either that or disable using server GC (
DOTNET_gcServer=0).VSadov commentedon Aug 30, 2022
I am not sure that will work. The choice of GC mode is a compile-time thing in NativeAOT.
mangod9 commentedon Aug 30, 2022
Guess we should revert #74617 till we update the repo to use RC1.
VSadov commentedon Aug 30, 2022
I do not think reverting back and forth the way crossgen2 is published has any effect on the crossgen that is actually in use, which is from Prevew 7 Nuget package.
Replacing the binaries in the nuget cache with a locally built copy might work, but is a fragile solution.
I can't think of a better workaround.
(I am also annoyed by the failures, my solution is basically try again, sometimes a few times)
AntonLapounov commentedon Aug 30, 2022
Yes, it works:
runtime/src/coreclr/nativeaot/Runtime/gcrhenv.cpp
Line 175 in 1d27c3d
AntonLapounov commentedon Aug 30, 2022
Note that we actually need to check whether the host architecture is ARM64 instead of checking whether the target architecture is ARM64. If you target ARM64 on an x64 machine, you don't need that workaround.
VSadov commentedon Aug 30, 2022
Ah, I see, SVR build is a superset of WKS, so it is possible to force crossgen2 into WKS mode.
This would be a nice workaround!
AntonLapounov commentedon Aug 30, 2022
Yep, and you can disable it in the config file just for this binary (e.g.,
/home/username/.nuget/packages/microsoft.netcore.app.crossgen2.linux-arm64/7.0.0-preview.7.22375.6/tools/crossgen2.runtimeconfig.json).MichalStrehovsky commentedon Aug 31, 2022
I don't think reverting that one has a connection to the crossgen2 crash while crossgenning ILC that Anton described (#72645 (comment)). That pull request doesn't affect the crossgen that is in use to crossgen ILC. It affects future crossgen in a future SDK.
I've submitted #74856 to work around.
NativeAOT doesn't read runtimeconfig.json so this is likely just placebo effect. We were generating unused runtimeconfig and deps json files with NativeAOT in the past but that has been fixed.
AntonLapounov commentedon Aug 31, 2022
Thank you for the corrections. I have never actually tried that, just assumed that if we produce a file, it should probably work. :) Setting
DOTNET_gcServer=0certainly works for me.