Skip to content
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

Test failure JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype_ro/boxunboxvaluetype_ro.sh #77661

Closed
v-wenyuxu opened this issue Oct 31, 2022 · 15 comments · Fixed by #78074
Closed
Assignees
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs GCStress JitStress CLR JIT issues involving JIT internal stress modes os-mac-os-x macOS aka OSX os-windows
Milestone

Comments

@v-wenyuxu
Copy link

Run: runtime-coreclr gcstress-extra 20221029.1

Failed test:

coreclr OSX arm64 Checked gcstress0xc_jitstress2 @ OSX.1200.ARM64.Open

- JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype_ro/boxunboxvaluetype_ro.sh

coreclr windows arm64 Checked gcstress0xc_jitstress2 @ Windows.10.Arm64v8.Open

- JIT\\Directed\\nullabletypes\\Desktop\\boxunboxvaluetype_ro\\boxunboxvaluetype_ro.cmd
- JIT\\Directed\\nullabletypes\\Desktop\\boxunboxvaluetype_do\\boxunboxvaluetype_do.cmd

coreclr windows arm64 Checked gcstress0xc_zapdisable_jitstress2 @ Windows.10.Arm64v8.Open

- JIT\\Directed\\nullabletypes\\Desktop\\boxunboxvaluetype_ro\\boxunboxvaluetype_ro.cmd

Error message:

Return code:      1
Raw output file:      /tmp/helix/working/A66408B2/w/B88D09D2/uploads/Reports/JIT.Directed/nullabletypes/Desktop/boxunboxvaluetype_ro/boxunboxvaluetype_ro.output.txt
Raw output:
BEGIN EXECUTION
/tmp/helix/working/A66408B2/p/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false boxunboxvaluetype_ro.dll ''
--- char? s = Helper.Create(default(char)) ---
--- char? s = null ---
--- char u = Helper.Create(default(char)) ---
--- bool? s = Helper.Create(default(bool)) ---
--- bool? s = null ---
--- bool u = Helper.Create(default(bool)) ---
--- byte? s = Helper.Create(default(byte)) ---
--- byte? s = null ---
--- byte u = Helper.Create(default(byte)) ---
--- sbyte? s = Helper.Create(default(sbyte)) ---
--- sbyte? s = null ---
--- sbyte u = Helper.Create(default(sbyte)) ---
--- short? s = Helper.Create(default(short)) ---
--- short? s = null ---
--- short u = Helper.Create(default(short)) ---
--- ushort? s = Helper.Create(default(ushort)) ---
--- ushort? s = null ---
--- ushort u = Helper.Create(default(ushort)) ---
--- int? s = Helper.Create(default(int)) ---
--- int? s = null ---
--- int u = Helper.Create(default(int)) ---
--- uint? s = Helper.Create(default(uint)) ---
--- uint? s = null ---
--- uint u = Helper.Create(default(uint)) ---
--- long? s = Helper.Create(default(long)) ---
--- long? s = null ---
--- long u = Helper.Create(default(long)) ---
--- ulong? s = Helper.Create(default(ulong)) ---
--- ulong? s = null ---
--- ulong u = Helper.Create(default(ulong)) ---
--- float? s = Helper.Create(default(float)) ---
--- float? s = null ---
--- float u = Helper.Create(default(float)) ---
--- double? s = Helper.Create(default(double)) ---
--- double? s = null ---
--- double u = Helper.Create(default(double)) ---
--- decimal? s = Helper.Create(default(decimal)) ---
--- decimal? s = null ---
--- decimal u = Helper.Create(default(decimal)) ---
--- IntPtr? s = Helper.Create(default(IntPtr)) ---
--- IntPtr? s = null ---
--- IntPtr u = Helper.Create(default(IntPtr)) ---
--- UIntPtr? s = Helper.Create(default(UIntPtr)) ---
--- UIntPtr? s = null ---
--- UIntPtr u = Helper.Create(default(UIntPtr)) ---
--- Guid? s = Helper.Create(default(Guid)) ---
--- Guid? s = null ---
--- Guid u = Helper.Create(default(Guid)) ---
--- GCHandle? s = Helper.Create(default(GCHandle)) ---
--- GCHandle? s = null ---
--- GCHandle u = Helper.Create(default(GCHandle)) ---
--- ByteE? s = Helper.Create(default(ByteE)) ---
--- ByteE? s = null ---
--- ByteE u = Helper.Create(default(ByteE)) ---
--- IntE? s = Helper.Create(default(IntE)) ---
--- IntE? s = null ---
--- IntE u = Helper.Create(default(IntE)) ---
--- LongE? s = Helper.Create(default(LongE)) ---
--- LongE? s = null ---
--- LongE u = Helper.Create(default(LongE)) ---
--- EmptyStruct? s = Helper.Create(default(EmptyStruct)) ---
--- EmptyStruct? s = null ---
--- EmptyStruct u = Helper.Create(default(EmptyStruct)) ---
--- NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct)) ---
--- NotEmptyStruct? s = null ---
--- NotEmptyStruct u = Helper.Create(default(NotEmptyStruct)) ---
--- NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ)) ---
--- NotEmptyStructQ? s = null ---
--- NotEmptyStructQ u = Helper.Create(default(NotEmptyStructQ)) ---
--- NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA)) ---
--- NotEmptyStructA? s = null ---
--- NotEmptyStructA u = Helper.Create(default(NotEmptyStructA)) ---
--- NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA)) ---
--- NotEmptyStructQA? s = null ---
--- NotEmptyStructQA u = Helper.Create(default(NotEmptyStructQA)) ---
--- EmptyStructGen<int>? s = Helper.Create(default(EmptyStructGen<int>)) ---
--- EmptyStructGen<int>? s = null ---
--- EmptyStructGen<int> u = Helper.Create(default(EmptyStructGen<int>)) ---
--- NotEmptyStructGen<int>? s = Helper.Create(default(NotEmptyStructGen<int>)) ---
--- NotEmptyStructGen<int>? s = null ---
--- NotEmptyStructGen<int> u = Helper.Create(default(NotEmptyStructGen<int>)) ---


Stack trace
   at JIT_Directed._nullabletypes_Desktop_boxunboxvaluetype_ro_boxunboxvaluetype_ro_._nullabletypes_Desktop_boxunboxvaluetype_ro_boxunboxvaluetype_ro_sh()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Queued OS Arch Column1
2022-10-31T00:09:11.85Z osx.1200.arm64.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_jitstress2
2022-10-30T00:34:12.895Z osx.1200.arm64.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_jitstress2
2022-09-27T21:28:00.087Z osx.1015.amd64.open x64 runtime-staging Release
2022-09-23T06:53:56.591Z osx.1200.amd64.open x64 runtime-coreclr jitstress Checked-jitstress2_tiered
2022-09-21T21:30:34.502Z osx.1015.amd64.open x64 runtime-staging Release
2022-09-21T06:09:57.685Z osx.1200.amd64.open x64 runtime-coreclr jitstress Checked-jitstress1_tiered
2022-09-05T10:07:05.729Z ubuntu.1804.armarch.open arm64 runtime-extra-platforms Release
@v-wenyuxu v-wenyuxu added arch-arm64 os-mac-os-x macOS aka OSX os-windows GCStress JitStress CLR JIT issues involving JIT internal stress modes blocking-clean-ci-optional Blocking optional rolling runs labels Oct 31, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 31, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 31, 2022
@ghost
Copy link

ghost commented Oct 31, 2022

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Run: runtime-coreclr gcstress-extra 20221029.1

Failed test:

coreclr OSX arm64 Checked gcstress0xc_jitstress2 @ OSX.1200.ARM64.Open

- JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype_ro/boxunboxvaluetype_ro.sh

coreclr windows arm64 Checked gcstress0xc_jitstress2 @ Windows.10.Arm64v8.Open

- JIT\\Directed\\nullabletypes\\Desktop\\boxunboxvaluetype_ro\\boxunboxvaluetype_ro.cmd
- JIT\\Directed\\nullabletypes\\Desktop\\boxunboxvaluetype_do\\boxunboxvaluetype_do.cmd

coreclr windows arm64 Checked gcstress0xc_zapdisable_jitstress2 @ Windows.10.Arm64v8.Open

- JIT\\Directed\\nullabletypes\\Desktop\\boxunboxvaluetype_ro\\boxunboxvaluetype_ro.cmd

Error message:

Return code:      1
Raw output file:      /tmp/helix/working/A66408B2/w/B88D09D2/uploads/Reports/JIT.Directed/nullabletypes/Desktop/boxunboxvaluetype_ro/boxunboxvaluetype_ro.output.txt
Raw output:
BEGIN EXECUTION
/tmp/helix/working/A66408B2/p/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false boxunboxvaluetype_ro.dll ''
--- char? s = Helper.Create(default(char)) ---
--- char? s = null ---
--- char u = Helper.Create(default(char)) ---
--- bool? s = Helper.Create(default(bool)) ---
--- bool? s = null ---
--- bool u = Helper.Create(default(bool)) ---
--- byte? s = Helper.Create(default(byte)) ---
--- byte? s = null ---
--- byte u = Helper.Create(default(byte)) ---
--- sbyte? s = Helper.Create(default(sbyte)) ---
--- sbyte? s = null ---
--- sbyte u = Helper.Create(default(sbyte)) ---
--- short? s = Helper.Create(default(short)) ---
--- short? s = null ---
--- short u = Helper.Create(default(short)) ---
--- ushort? s = Helper.Create(default(ushort)) ---
--- ushort? s = null ---
--- ushort u = Helper.Create(default(ushort)) ---
--- int? s = Helper.Create(default(int)) ---
--- int? s = null ---
--- int u = Helper.Create(default(int)) ---
--- uint? s = Helper.Create(default(uint)) ---
--- uint? s = null ---
--- uint u = Helper.Create(default(uint)) ---
--- long? s = Helper.Create(default(long)) ---
--- long? s = null ---
--- long u = Helper.Create(default(long)) ---
--- ulong? s = Helper.Create(default(ulong)) ---
--- ulong? s = null ---
--- ulong u = Helper.Create(default(ulong)) ---
--- float? s = Helper.Create(default(float)) ---
--- float? s = null ---
--- float u = Helper.Create(default(float)) ---
--- double? s = Helper.Create(default(double)) ---
--- double? s = null ---
--- double u = Helper.Create(default(double)) ---
--- decimal? s = Helper.Create(default(decimal)) ---
--- decimal? s = null ---
--- decimal u = Helper.Create(default(decimal)) ---
--- IntPtr? s = Helper.Create(default(IntPtr)) ---
--- IntPtr? s = null ---
--- IntPtr u = Helper.Create(default(IntPtr)) ---
--- UIntPtr? s = Helper.Create(default(UIntPtr)) ---
--- UIntPtr? s = null ---
--- UIntPtr u = Helper.Create(default(UIntPtr)) ---
--- Guid? s = Helper.Create(default(Guid)) ---
--- Guid? s = null ---
--- Guid u = Helper.Create(default(Guid)) ---
--- GCHandle? s = Helper.Create(default(GCHandle)) ---
--- GCHandle? s = null ---
--- GCHandle u = Helper.Create(default(GCHandle)) ---
--- ByteE? s = Helper.Create(default(ByteE)) ---
--- ByteE? s = null ---
--- ByteE u = Helper.Create(default(ByteE)) ---
--- IntE? s = Helper.Create(default(IntE)) ---
--- IntE? s = null ---
--- IntE u = Helper.Create(default(IntE)) ---
--- LongE? s = Helper.Create(default(LongE)) ---
--- LongE? s = null ---
--- LongE u = Helper.Create(default(LongE)) ---
--- EmptyStruct? s = Helper.Create(default(EmptyStruct)) ---
--- EmptyStruct? s = null ---
--- EmptyStruct u = Helper.Create(default(EmptyStruct)) ---
--- NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct)) ---
--- NotEmptyStruct? s = null ---
--- NotEmptyStruct u = Helper.Create(default(NotEmptyStruct)) ---
--- NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ)) ---
--- NotEmptyStructQ? s = null ---
--- NotEmptyStructQ u = Helper.Create(default(NotEmptyStructQ)) ---
--- NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA)) ---
--- NotEmptyStructA? s = null ---
--- NotEmptyStructA u = Helper.Create(default(NotEmptyStructA)) ---
--- NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA)) ---
--- NotEmptyStructQA? s = null ---
--- NotEmptyStructQA u = Helper.Create(default(NotEmptyStructQA)) ---
--- EmptyStructGen<int>? s = Helper.Create(default(EmptyStructGen<int>)) ---
--- EmptyStructGen<int>? s = null ---
--- EmptyStructGen<int> u = Helper.Create(default(EmptyStructGen<int>)) ---
--- NotEmptyStructGen<int>? s = Helper.Create(default(NotEmptyStructGen<int>)) ---
--- NotEmptyStructGen<int>? s = null ---
--- NotEmptyStructGen<int> u = Helper.Create(default(NotEmptyStructGen<int>)) ---


Stack trace
   at JIT_Directed._nullabletypes_Desktop_boxunboxvaluetype_ro_boxunboxvaluetype_ro_._nullabletypes_Desktop_boxunboxvaluetype_ro_boxunboxvaluetype_ro_sh()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Queued OS Arch Column1
2022-10-31T00:09:11.85Z osx.1200.arm64.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_jitstress2
2022-10-30T00:34:12.895Z osx.1200.arm64.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_jitstress2
2022-09-27T21:28:00.087Z osx.1015.amd64.open x64 runtime-staging Release
2022-09-23T06:53:56.591Z osx.1200.amd64.open x64 runtime-coreclr jitstress Checked-jitstress2_tiered
2022-09-21T21:30:34.502Z osx.1015.amd64.open x64 runtime-staging Release
2022-09-21T06:09:57.685Z osx.1200.amd64.open x64 runtime-coreclr jitstress Checked-jitstress1_tiered
2022-09-05T10:07:05.729Z ubuntu.1804.armarch.open arm64 runtime-extra-platforms Release
Author: v-wenyuxu
Assignees: -
Labels:

arch-arm64, os-mac-os-x, os-windows, GCStress, JitStress, area-CodeGen-coreclr, blocking-clean-ci-optional

Milestone: -

@AndyAyersMS
Copy link
Member

Trying to repro on my MacM1, no luck so far...

@AndyAyersMS
Copy link
Member

Still no luck getting a repro, either via running the test collection via xunit or running the test in isolation, and whether using runfo downloaded bits or my locally built bits, with various forms of sideload stress applied to the machine.

@AndyAyersMS
Copy link
Member

Given that I can't repro, let's see if these recur over this weekend's runs. If not, I will close.

@AndyAyersMS
Copy link
Member

AndyAyersMS commented Nov 6, 2022

Looks like it failed again, but on Linux/Windows. So will try reproing there instead of on OSX.

https://dev.azure.com/dnceng-public/public/_build/results?buildId=74352&view=ms.vss-test-web.build-test-results-tab&runId=1532982&resultId=109424&paneView=debug

@AndyAyersMS
Copy link
Member

Ok, I can readily repro on arm64 windows, and just need to run the single test case. Jit stress isolation has pinned this down to the test method itself:

JIT compiled Test_boxunboxvaluetype:Main():int [FullOpts, IL size=268, code size=6128, hash=0x015439dd JitStress]

so it fails with

set DOTNET_TieredCompilation=0
set DOTNET_GCStress=0xC
set DOTNET_JitStress=2
set DOTNET_JitStressRange=015439dd

@AndyAyersMS
Copy link
Member

Trying to further isolate with JitStressModeNamesOnly and JitStressModeNames but I get different results when I name all the stress modes that were enabled by default. So, tracking that down first.

@AndyAyersMS
Copy link
Member

I guess it's my confusion on what JitStressModeNames does -- it unconditionally enables the stress mode. So you can't use it for isolation, you need to use JitStressModeNamesNot.

@v-wenyuxu
Copy link
Author

Failed in Run: runtime-coreclr gcstress-extra 20221106.1

Failed tests:

coreclr Linux arm64 Checked gcstress0xc_zapdisable_jitstress2 @ (Ubuntu.1804.Arm64.Open)[email protected]/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8
- JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype_ro/boxunboxvaluetype_ro.sh

coreclr windows arm64 Checked gcstress0xc_zapdisable_jitstress2 @ Windows.10.Arm64v8.Open
- JIT\\Directed\\nullabletypes\\Desktop\\boxunboxvaluetype_do\\boxunboxvaluetype_do.cmd

coreclr Linux arm64 Checked gcstress0xc_jitstress2 @ (Ubuntu.1804.Arm64.Open)[email protected]/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8
- JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype_do/boxunboxvaluetype_do.sh
- JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype_ro/boxunboxvaluetype_ro.sh

coreclr windows arm64 Checked gcstress0xc_jitstress2 @ Windows.10.Arm64v8.Open
- JIT\\Directed\\nullabletypes\\Desktop\\boxunboxvaluetype_ro\\boxunboxvaluetype_ro.cmd 
JIT\\Directed\\nullabletypes\\Desktop\\boxunboxvaluetype_do\\boxunboxvaluetype_do.cmd

Error message:


Return code:      1
Raw output file:      /root/helix/work/workitem/uploads/Reports/JIT.Directed/nullabletypes/Desktop/boxunboxvaluetype_ro/boxunboxvaluetype_ro.output.txt
Raw output:
BEGIN EXECUTION
/root/helix/work/correlation/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false boxunboxvaluetype_ro.dll ''
--- char? s = Helper.Create(default(char)) ---
--- char? s = null ---
--- char u = Helper.Create(default(char)) ---
--- bool? s = Helper.Create(default(bool)) ---
--- bool? s = null ---
--- bool u = Helper.Create(default(bool)) ---
--- byte? s = Helper.Create(default(byte)) ---
--- byte? s = null ---
--- byte u = Helper.Create(default(byte)) ---
--- sbyte? s = Helper.Create(default(sbyte)) ---
--- sbyte? s = null ---
--- sbyte u = Helper.Create(default(sbyte)) ---
--- short? s = Helper.Create(default(short)) ---
--- short? s = null ---
--- short u = Helper.Create(default(short)) ---
--- ushort? s = Helper.Create(default(ushort)) ---
--- ushort? s = null ---
--- ushort u = Helper.Create(default(ushort)) ---
--- int? s = Helper.Create(default(int)) ---
--- int? s = null ---
--- int u = Helper.Create(default(int)) ---
--- uint? s = Helper.Create(default(uint)) ---
--- uint? s = null ---
--- uint u = Helper.Create(default(uint)) ---
--- long? s = Helper.Create(default(long)) ---
--- long? s = null ---
--- long u = Helper.Create(default(long)) ---
--- ulong? s = Helper.Create(default(ulong)) ---
--- ulong? s = null ---
--- ulong u = Helper.Create(default(ulong)) ---
--- float? s = Helper.Create(default(float)) ---
--- float? s = null ---
--- float u = Helper.Create(default(float)) ---
--- double? s = Helper.Create(default(double)) ---
--- double? s = null ---
--- double u = Helper.Create(default(double)) ---
--- decimal? s = Helper.Create(default(decimal)) ---
--- decimal? s = null ---
--- decimal u = Helper.Create(default(decimal)) ---
--- IntPtr? s = Helper.Create(default(IntPtr)) ---
--- IntPtr? s = null ---
--- IntPtr u = Helper.Create(default(IntPtr)) ---
--- UIntPtr? s = Helper.Create(default(UIntPtr)) ---
--- UIntPtr? s = null ---
--- UIntPtr u = Helper.Create(default(UIntPtr)) ---
--- Guid? s = Helper.Create(default(Guid)) ---
--- Guid? s = null ---
--- Guid u = Helper.Create(default(Guid)) ---
--- GCHandle? s = Helper.Create(default(GCHandle)) ---
--- GCHandle? s = null ---
--- GCHandle u = Helper.Create(default(GCHandle)) ---
--- ByteE? s = Helper.Create(default(ByteE)) ---
--- ByteE? s = null ---
--- ByteE u = Helper.Create(default(ByteE)) ---
--- IntE? s = Helper.Create(default(IntE)) ---
--- IntE? s = null ---
--- IntE u = Helper.Create(default(IntE)) ---
--- LongE? s = Helper.Create(default(LongE)) ---
--- LongE? s = null ---
--- LongE u = Helper.Create(default(LongE)) ---
--- EmptyStruct? s = Helper.Create(default(EmptyStruct)) ---
--- EmptyStruct? s = null ---
--- EmptyStruct u = Helper.Create(default(EmptyStruct)) ---
--- NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct)) ---
--- NotEmptyStruct? s = null ---
--- NotEmptyStruct u = Helper.Create(default(NotEmptyStruct)) ---
--- NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ)) ---
--- NotEmptyStructQ? s = null ---
--- NotEmptyStructQ u = Helper.Create(default(NotEmptyStructQ)) ---
--- NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA)) ---
--- NotEmptyStructA? s = null ---
--- NotEmptyStructA u = Helper.Create(default(NotEmptyStructA)) ---
--- NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA)) ---
--- NotEmptyStructQA? s = null ---
--- NotEmptyStructQA u = Helper.Create(default(NotEmptyStructQA)) ---
--- EmptyStructGen<int>? s = Helper.Create(default(EmptyStructGen<int>)) ---
--- EmptyStructGen<int>? s = null ---
--- EmptyStructGen<int> u = Helper.Create(default(EmptyStructGen<int>)) ---
--- NotEmptyStructGen<int>? s = Helper.Create(default(NotEmptyStructGen<int>)) ---
--- NotEmptyStructGen<int>? s = null ---
--- NotEmptyStructGen<int> u = Helper.Create(default(NotEmptyStructGen<int>)) ---
--- NotEmptyS

Stack trace:

   at JIT_Directed._nullabletypes_Desktop_boxunboxvaluetype_ro_boxunboxvaluetype_ro_._nullabletypes_Desktop_boxunboxvaluetype_ro_boxunboxvaluetype_ro_sh()
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
  at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Queued OS Arch Column1
2022-11-07T08:16:33.778Z ubuntu.1804.armarch.open arm64 runtime-coreclr crossgen2-composite gcstress Checked-gcstress0xc_zapdisable_jitstress2
2022-11-07T00:01:34.18Z ubuntu.1804.armarch.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_jitstress2
2022-11-06T22:54:30.293Z ubuntu.1804.armarch.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_zapdisable_jitstress2
2022-11-05T23:48:42.81Z ubuntu.1804.armarch.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_jitstress2
2022-10-31T08:17:03.923Z ubuntu.1804.armarch.open arm64 runtime-coreclr crossgen2-composite gcstress Checked-gcstress0xc_zapdisable_jitstress2
2022-10-31T00:45:49.601Z ubuntu.1804.armarch.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_jitstress2
2022-10-31T00:09:11.85Z osx.1200.arm64.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_jitstress2
2022-10-30T00:34:12.895Z osx.1200.arm64.open arm64 runtime-coreclr gcstress-extra Checked-gcstress0xc_jitstress2
2022-09-27T21:28:00.087Z osx.1015.amd64.open x64 runtime-staging Release
2022-09-23T06:53:56.591Z osx.1200.amd64.open x64 runtime-coreclr jitstress Checked-jitstress2_tiered
2022-09-21T21:30:34.502Z osx.1015.amd64.open x64 runtime-staging Release
2022-09-21T06:09:57.685Z osx.1200.amd64.open x64 runtime-coreclr jitstress Checked-jitstress1_tiered

@AndyAyersMS
Copy link
Member

Key stress modes are

STRESS_RANDOM_INLINE, STRESS_PROMOTE_FEWER_STRUCTS 

Was going to use the inliner's ReplayPolicy to try and whittle down the set of inlines needed to repro the failure, but inline replay from files is broken because we're seemingly not propagating the IL offsets for nested inlines:

    [ 1] 458 (0x1ca) call 060000E2
In Compiler::impImportCall: opcode is call, kind=0, callRetType is bool, structSize is 0
INLINER: during 'impMarkInlineCandidate' result 'CheckCanInline Success' reason 'CheckCanInline Success' for 'NullableTest23:Run()' calling 'NullableTest23:BoxUnboxToQV(System.ValueType):bool'
INLINER: during 'impMarkInlineCandidate' result 'CheckCanInline Success' reason 'CheckCanInline Success'


STMT00098 ( ??? ... ??? ) <- INLRT @ 0x06E[E-]
               [000295] I-C-G------                         *  CALL      int    NullableTest23.BoxUnboxToQV (exactContextHnd=0x00007FF92D5E70E9)
               [000294] ----------- arg0                    \--*  BOX       ref   
               [000293] -----------                            \--*  LCL_VAR   ref    V11 tmp9 

Fragment of the saved inline XML:

<Method>
  <Token>060001b1</Token>
  <Hash>015439dd</Hash>
  <InlineCount>72</InlineCount>
  <HotSize>6112</HotSize>
  <ColdSize>0</ColdSize>
  <JitTime>25693</JitTime>
  <SizeEstimate>624</SizeEstimate>
  <TimeEstimate>4396</TimeEstimate>
  <Name>Test_boxunboxvaluetype:Main():int</Name>
  <Inlines>
    <Inline>
      <Token>060000e7</Token>
      <Hash>818cf211</Hash>
      <Offset>110</Offset>
      <Reason>random accept</Reason>
      <Name>NullableTest23:Run()</Name>
      <ILSize>553</ILSize>
      <Devirtualized>False</Devirtualized>
      <Guarded>False</Guarded>
      <Unboxed>False</Unboxed>
      <Inlines>
        <Inline>
          <Token>060001e6</Token>
          <Hash>52c23d26</Hash>
          <Offset>4294967295</Offset>
          <Reason>random accept</Reason>
          <Name>Helper:Create(NotEmptyStructQ):NotEmptyStructQ</Name>
          <ILSize>24</ILSize>
          <Devirtualized>False</Devirtualized>
          <Guarded>False</Guarded>
          <Unboxed>False</Unboxed>

The offset in that last child shouldn't be 11. not -1.

Inline trees of base run and log replay:

;; original

  [INL01 IL=0110 TR=000024 060000E7] [INLINED: call site: random accept] NullableTest23:Run()
    [INL02 IL=0011 TR=000073 060001E6] [INLINED: call site: random accept] Helper:Create(NotEmptyStructQ):NotEmptyStructQ

;; replay

  [INL01 IL=0110 TR=000024 060000E7] [INLINED: call site: accepted by log replay] NullableTest23:Run()
    [INL00 IL=0011 TR=000073 060001E6] [FAILED: call site: rejected by log replay] Helper:Create(NotEmptyStructQ):NotEmptyStructQ

@AndyAyersMS
Copy link
Member

Managed to hack things so that the right IL offset is emitted in the XML and used during lookup. But inline reduction didn't prove all that helpful -- at least the first few top levels of the tree for Main are needed and I recall I never wrote any sort of "bisection" utility to help with trimming down these XML files.

So, moving on to debugging the failure.

@AndyAyersMS
Copy link
Member

AndyAyersMS commented Nov 8, 2022

The bug is here: we have a copy that sets up a no-gc region, but right afterwards we refer to the register used in the copy:

G_M50722_IG23:        ; offs=001050H, size=0008H, bbWeight=1    PerfScore 3.00, gcrefRegs=1F700000 {x20 x21 x22 x24 x25 x26 x27 x28}, byrefRegs=0000 {}, BB33 [0106], byref, nogc

IN03ff: 001050                    ldr     x0, [fp, #0x60]
IN0400: 001054                    str     x0, [fp, #0x48]

G_M50722_IG24:        ; offs=001058H, size=0054H, bbWeight=1    PerfScore 28.50, BB33 [0106], isz, extend

IN0401: 001058                    ldr     w1, [x0, #0x08]8]

we should establish that x0 is a gc ref.

This comes from a peephole opt where we suppress a load because the register already has the right value.

Generating: N2803 ( 19, 14) [001799] sA---------                         *  STORE_BLK struct<NotEmptyStructConstrainedGenQA`1[System.Int32], 8> (copy) (Unroll) REG NA
Disable GC
IN03ff:                           ldr     x0, [fp, #0x60]
IN0400:                           str     x0, [fp, #0x48]
Enable GC
genIPmappingAdd: ignoring duplicate IL offset 0x96
Generating: N2805 (???,???) [002895] -----------                            IL_OFFSET void   INL57 @ ??? <- INL55 @ ??? <- INL51 @ 0x088[E-] <- INLRT @ 0x096[E-] REG NA
genIPmappingAdd: ignoring duplicate IL offset 0x96
Generating: N2807 (???,???) [002896] -----------                            IL_OFFSET void   INL62 @ 0x000[E-] <- INL57 @ ??? <- INL55 @ ??? <- INL51 @ 0x088[E-] <- INLRT @ 0x096[E-] REG NA
Generating: N2809 (  3,  4) [001752] -----------                 t1752 =    LCL_FLD   ref    V129 tmp127      u:2[+0] x0 (last use) REG x0 <l:$1d2, c:$1d3>

 -- suppressing 'ldr reg0 [reg29, #9]' as previous 'str reg0 [reg29, #9]' was from same location.
							GC regs: 1F700000 {x20 x21 x22 x24 x25 x26 x27 x28} => 1F700001 {x0 x20 x21 x22 x24 x25 x26 x27 x28}
                                                                        /--*  t1752  ref    
Generating: N2811 (  3,  4) [002231] DA---------                         *  STORE_LCL_VAR ref    V212 tmp210      d:2 x0 REG x0
							GC regs: 1F700001 {x0 x20 x21 x22 x24 x25 x26 x27 x28} => 1F700000 {x20 x21 x22 x24 x25 x26 x27 x28}
							V212 in reg x0 is becoming live  [002231]
							Live regs: 1F780000 {x19 x20 x21 x22 x24 x25 x26 x27 x28} => 1F780001 {x0 x19 x20 x21 x22 x24 x25 x26 x27 x28}
							Live vars: {V125 V239 V241 V242 V243 V244 V245 V246 V247 V248} => {V125 V212 V239 V241 V242 V243 V244 V245 V246 V247 V248}
							GC regs: 1F700000 {x20 x21 x22 x24 x25 x26 x27 x28} => 1F700001 {x0 x20 x21 x22 x24 x25 x26 x27 x28}
Generating: N2813 (  1,  2) [001753] -c---------                 t1753 =    CNS_INT   int    0 REG NA $40
Generating: N2815 (  1,  1) [002232] -----------                 t2232 =    LCL_VAR   ref    V212 tmp210      u:2 x0 REG x0 <l:$1d2, c:$1d3>
                                                                        /--*  t2232  ref    
Generating: N2817 (???,???) [002976] -c---------                 t2976 = *  LEA(b+8)  byref  REG NA
                                                                        /--*  t2976  byref  
Generating: N2819 (  3,  3) [002235] ---X-------                 t2235 = *  IND       int    REG x1 <l:$4d6, c:$4d5>

      G_M50722_IG23:        ; offs=001024H, funclet=00, bbWeight=1   , byref, nogc
IN0401:                           ldr     w1, [x0, #0x08]                                                 

So seems like we should make sure the previous IG has the same gc properties as the current one.

@BruceForstall
Copy link
Member

I thought we didn't do peeps across two IGs except when the current IG is an "extend" IG. And I didn't think "extend" IGs could have different GC properties.

@AndyAyersMS
Copy link
Member

I thought we didn't do peeps across two IGs except when the current IG is an "extend" IG. And I didn't think "extend" IGs could have different GC properties.

Proably so, but emitEnableGC does not create a new IG. Instead it sets emitForceNewIG to indicate that the next time an instruction is added it must go in a new IG. And so when we are considering the peephole we still think we're in the same IG.

@AndyAyersMS
Copy link
Member

AndyAyersMS commented Nov 8, 2022

My prospective fix is firing in one PMI case on arm64:

;; Microsoft.CodeAnalysis.Diagnostics.AnalysisScope:ShouldInclude(Microsoft.CodeAnalysis.Diagnostic):bool:this

;; before

G_M26361_IG17:        ; , nogc, extend
            ldp     x0, x1, [x21]
            stp     x0, x1, [fp, #0x48]
            ldr     x0, [x21, #0x10]
            str     x0, [fp, #0x58]
						;; size=16 bbWeight=0.50 PerfScore 4.50
G_M26361_IG18:        ; , isz, extend
            ldr     x1, [x0]
            ldr     x1, [x1, #0x48]

;; after

G_M26361_IG17:        ; , nogc, extend
            ldp     x0, x1, [x21]
            stp     x0, x1, [fp, #0x48]
            ldr     x0, [x21, #0x10]
            str     x0, [fp, #0x58]
						;; size=16 bbWeight=0.50 PerfScore 4.50
G_M26361_IG18:        ; , isz, extend
            ldr     x0, [fp, #0x58]
            ; gcrRegs +[x0]
            ldr     x1, [x0]

So we might want to consider backporting a fix.

AndyAyersMS added a commit to AndyAyersMS/runtime that referenced this issue Nov 8, 2022
We cannot safely peephole instructions that straddle a gc enable boundary.
Detecting when this might happen is a bit subtle; currently we rely on
`emitForceNewIG` to be set.

Add a new utility 'emitCanPeepholeLastIns` to centralize the logic that
decides whether basing current emission on `emitLastIns` is safe.

Closed dotnet#77661.
AndyAyersMS added a commit that referenced this issue Nov 9, 2022
We cannot safely peephole instructions that straddle a gc enable boundary.
Detecting when this might happen is a bit subtle; currently we rely on
`emitForceNewIG` to be set.

Add a new utility 'emitCanPeepholeLastIns` to centralize the logic that
decides whether basing current emission on `emitLastIns` is safe.

Closes #77661.
github-actions bot pushed a commit that referenced this issue Nov 9, 2022
We cannot safely peephole instructions that straddle a gc enable boundary.
Detecting when this might happen is a bit subtle; currently we rely on
`emitForceNewIG` to be set.

Add a new utility 'emitCanPeepholeLastIns` to centralize the logic that
decides whether basing current emission on `emitLastIns` is safe.

Closed #77661.
carlossanlop pushed a commit that referenced this issue Nov 10, 2022
* JIT: fix gc hole in peephole optimizations

We cannot safely peephole instructions that straddle a gc enable boundary.
Detecting when this might happen is a bit subtle; currently we rely on
`emitForceNewIG` to be set.

Add a new utility 'emitCanPeepholeLastIns` to centralize the logic that
decides whether basing current emission on `emitLastIns` is safe.

Closed #77661.

* revise per feedback

Co-authored-by: Andy Ayers <[email protected]>
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs GCStress JitStress CLR JIT issues involving JIT internal stress modes os-mac-os-x macOS aka OSX os-windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants