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
Assert "rank < MAX_RANK" in runtime/src/coreclr/classlibnative/bcltype/arraynative.cpp Line: 812 #91349
While testing Orleans with a Checked build of the .NET 8 Preview 7 runtime, I hit the following assert while running Orleans.Serialization.UnitTests on Linux x64: Assert "rank < MAX_RANK" in runtime/src/coreclr/classlibnative/bcltype/arraynative.cpp Line: 812. To reproduce:
Replace your .NET 8 Preview 7 installation's runtime with a Checked build
Upgrade Orleans to target .NET 8 (using the .NET upgrade-assistant tool, for example)
Orleans uses some obsolete APIs, so in order to build successfully, you'll have to ignore some Roslyn errors (SYSLIB0050, SYSLIB0051, CS0672)
Set DOTNET_JitRandomEdgeCounts=1
Run dotnet test -c Release
For reference, I reproduced this running Ubuntu-22.04 in WSL2.
Also did you try a clean dotnet test with the checked jit or did you first try it with the normal jit and then retry (with presumably already built assets) with the checked jit?
I'm asking because when I try installing the checked jit first CSC is failing with exit code 134. Perhaps my jit doesn't match, will look into this too.
@AndyAyersMS I upgraded all projects to .NET 8, and only used the Checked JIT to build and run tests, so I started from a clean slate. I didn't hit the CSC error... For consistency, I copied over libclrjit.so, libcoreclr.so, and System.Private.CoreLib.dll from my Checked build to my Preview 7 install.
I've pushed my repro setup here -- setting DOTNET_JitRandomEdgeCounts=1 and running dotnet test -c Release should work out of the box (except for a few Roslyn errors thrown in unrelated tests). Please let me know if it doesn't reproduce. Thanks!
Also sorry for the red herring, but I tried reproducing this again, and I can hit the assert without DOTNET_JitRandomEdgeCounts or any other JIT env vars set.
Since the assert comes from the runtime it's likely it will repro with just a checked runtime/SPC and a release JIT. Anyways, let me get a repro and I'll dig into why this happens.
cd test/Orleans.Serialization.UnitTests
dotnet test -c Release --blame-crash
[createdump] Gathering state for process 28033 dotnet
[createdump] Crashing thread 6db4 signal 6 (0006)
[createdump] Writing full dump to file /tmp/47ee0b84-c35e-4220-968e-54b98196f229/dotnet_28033_1693953262_crashdump.dmp
[createdump] Written 2773696512 bytes (677172 pages) to core file
[createdump] Target process is alive
[createdump] Dump successfully written in 4705ms
The active test run was aborted. Reason: Test host process crashed : Assert failure(PID 28033 [0x00006d81], Thread: 28084 [0x6db4]): rank < MAX_RANK
File: /home/andy/repos/runtime0/src/coreclr/classlibnative/bcltype/arraynative.cpp Line: 812
Image: /usr/share/dotnet/dotnet
waitpid() returned successfully (wstatus 00000000) WEXITSTATUS 0 WTERMSIG 0
Activity
adityamandaleeka commentedon Aug 30, 2023
cc @AndyAyersMS since this involves the edge count randomization
adityamandaleeka commentedon Aug 30, 2023
Oh hey @amanasifkhalid, didn't notice that you were the one who filed this 😄
AndyAyersMS commentedon Sep 5, 2023
@amanasifkhalid did you upgrade all the orleans projects, or just some subset?
AndyAyersMS commentedon Sep 5, 2023
Also did you try a clean
dotnet testwith the checked jit or did you first try it with the normal jit and then retry (with presumably already built assets) with the checked jit?I'm asking because when I try installing the checked jit first CSC is failing with exit code 134. Perhaps my jit doesn't match, will look into this too.
AndyAyersMS commentedon Sep 5, 2023
If you have your changes still, can you put them on a branch of a fork of orleans that I can pull down, or else package them up as a patch?
amanasifkhalid commentedon Sep 5, 2023
@AndyAyersMS I upgraded all projects to .NET 8, and only used the Checked JIT to build and run tests, so I started from a clean slate. I didn't hit the CSC error... For consistency, I copied over
libclrjit.so,libcoreclr.so, andSystem.Private.CoreLib.dllfrom my Checked build to my Preview 7 install.I've pushed my repro setup here -- setting
DOTNET_JitRandomEdgeCounts=1and runningdotnet test -c Releaseshould work out of the box (except for a few Roslyn errors thrown in unrelated tests). Please let me know if it doesn't reproduce. Thanks!amanasifkhalid commentedon Sep 5, 2023
Also sorry for the red herring, but I tried reproducing this again, and I can hit the assert without
DOTNET_JitRandomEdgeCountsor any other JIT env vars set.AndyAyersMS commentedon Sep 5, 2023
Since the assert comes from the runtime it's likely it will repro with just a checked runtime/SPC and a release JIT. Anyways, let me get a repro and I'll dig into why this happens.
AndyAyersMS commentedon Sep 5, 2023
Ok, I can repro:
AndyAyersMS commentedon Sep 5, 2023
Stack trace:
Assert is
with
and the code is requesting a rank-32 array:
elsewhere we see 32 should be ok:
so the assert in arraynative.cpp is too aggressive, and should be
Fix overly aggressive assert
Fix overly aggressive assert (#91651)