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

Assert in aot compiler: mono/mini/calls.c:337, condition `!rgctx_arg || !imt_arg' not met #21733

Open
rolfbjarne opened this issue Dec 13, 2023 · 0 comments

Comments

@rolfbjarne
Copy link
Member

The AOT compiler crashes with:

  • Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mono/mini/calls.c:337, condition `!rgctx_arg || !imt_arg' not met

with this test case (unzip & execute repro.sh):

repro-7e947a4.zip

Note: needs Xamarin.iOS 16.4.0.23 - will probaby repro on earlier versions of Xamarin.iOS as well, but the script would need to be updated.

Running the AOT compiler with a bunch of -v's, reveals:

converting gsharedvt method bool Jakar.Extensions.LockerEnumerator`3<TValue_GSHAREDVT, TCloser_GSHAREDVT, TList_GSHAREDVT>:MoveNext ()
created temp 0 (R32) of type System.Byte
creating vars
created temp 1 (R33) of type System.IntPtr
	return :  arg R32 <-
	this:  arg R33 <-
creating locals
	local [0]: created temp 2 (R34) of type System.Byte
	local [1]: created temp 3 (R35) of type System.Byte
	local [2]: created temp 4 (R36) of type System.Byte
	local [3]: created temp 5 (R37) of type TList_GSHAREDVT
	local [4]: created temp 6 (R38) of type System.ReadOnlySpan<TValue_GSHAREDVT>
	local [5]: created temp 7 (R39) of type System.Byte
	local [6]: created temp 8 (R40) of type System.Byte
locals done
created temp 9 (R41) of type System.IntPtr
created temp 10 (R42) of type System.IntPtr
created temp 11 (R43) of type System.IntPtr
method to IR Jakar.Extensions.LockerEnumerator`3<TValue_GSHAREDVT, TCloser_GSHAREDVT, TList_GSHAREDVT>:MoveNext ()
created temp 12 (R44) of type System.IntPtr
created temp 13 (R45) of type System.IntPtr
created temp 14 (R49) of type System.IntPtr
converting (in B2: stack: 0) IL_0000: nop       
converting (in B2: stack: 0) IL_0001: ldarg.0   
converting (in B2: stack: 1) IL_0002: ldfld     0x0a000aa3
converting (in B2: stack: 1) IL_0007: box       0x1b00011e
created temp 15 (R54) of type TList_GSHAREDVT
converting (in B13: stack: 1) IL_000c: ldnull    
converting (in B13: stack: 2) IL_000d: ceq       
converting (in B13: stack: 1) IL_000f: stloc.1   
converting (in B13: stack: 0) IL_0010: ldloc.1   
converting (in B13: stack: 1) IL_0011: brfalse.s IL_001f
converting (in B5: stack: 0) IL_0013: nop       
converting (in B5: stack: 0) IL_0014: ldstr     "LockerEnumerator"
converting (in B5: stack: 1) IL_0019: newobj    0x0a000857
converting (in B5: stack: 1) IL_001e: throw     
converting (in B4: stack: 0) IL_001f: ldarg.0   
converting (in B4: stack: 1) IL_0020: ldflda    0x0a000aa2
converting (in B4: stack: 1) IL_0025: call      0x0a000aa4
cmethod = bool System.ReadOnlyMemory`1<TValue_GSHAREDVT>:get_IsEmpty ()
converting (in B4: stack: 1) IL_002a: stloc.2   
converting (in B4: stack: 0) IL_002b: ldloc.2   
converting (in B4: stack: 1) IL_002c: brfalse.s IL_0051
converting (in B7: stack: 0) IL_002e: nop       
converting (in B7: stack: 0) IL_002f: ldarg.0   
converting (in B7: stack: 1) IL_0030: ldc.i4.m1 
converting (in B7: stack: 2) IL_0031: stfld     0x0a000aa1
converting (in B7: stack: 0) IL_0036: ldarg.0   
converting (in B7: stack: 1) IL_0037: ldarg.0   
converting (in B7: stack: 2) IL_0038: ldfld     0x0a000aa3
converting (in B7: stack: 2) IL_003d: stloc.3   
converting (in B7: stack: 1) IL_003e: ldloca.s  3
converting (in B7: stack: 2) IL_0040: constrained.0x1b00011e
converting (in B7: stack: 2) IL_0046: callvirt  0x0a000aa5
cmethod = System.ReadOnlyMemory`1<TValue_GSHAREDVT> Jakar.Extensions.ILockedCollection`2<TCloser_GSHAREDVT, TValue_GSHAREDVT>:Copy ()
Constrained call to TList_GSHAREDVT
created temp 16 (R123) of type System.ReadOnlyMemory<TValue_GSHAREDVT>
created temp 17 (R126) of type System.ReadOnlyMemory<TValue_GSHAREDVT>
converting (in B21: stack: 2) IL_004b: stfld     0x0a000aa2
converting (in B21: stack: 0) IL_0050: nop       
converting (in B6: stack: 0) IL_0051: ldarg.0   
converting (in B6: stack: 1) IL_0052: ldflda    0x0a000aa1
converting (in B6: stack: 1) IL_0057: ldarg.0   
converting (in B6: stack: 2) IL_0058: ldflda    0x0a000aa2
converting (in B6: stack: 2) IL_005d: call      0x0a000913
cmethod = System.ReadOnlySpan`1<TValue_GSHAREDVT> System.ReadOnlyMemory`1<TValue_GSHAREDVT>:get_Span ()
created temp 18 (R147) of type System.ReadOnlySpan<TValue_GSHAREDVT>
converting (in B6: stack: 2) IL_0062: stloc.s   4
converting (in B6: stack: 1) IL_0064: ldloca.s  4
converting (in B6: stack: 2) IL_0066: ldarg.0   
converting (in B6: stack: 3) IL_0067: ldflda    0x0a000a9f
converting (in B6: stack: 3) IL_006c: call      0x0a000aa6
cmethod = bool Jakar.Extensions.ILockedCollection`2<TCloser_GSHAREDVT, TValue_GSHAREDVT>:MoveNext (int&,System.ReadOnlySpan`1<TValue_GSHAREDVT>&,TValue_GSHAREDVT&)
* Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mono/mini/calls.c:337, condition `!rgctx_arg || !imt_arg' not met

which seems to be this method: https://github.com/Jakar510/Jakar.Extensions/blob/5e60cc3cec27e13eae54ca49aa80d7a8c0e4741c/Jakar.Extensions/Models/LockerEnumerator.cs#L27-L42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant