-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Referencing OpenTK.Graphics crashes the Ready2Run build. #59138
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
To reproduce this: |
@trylek could you please take a look at this? |
Sure, taking a look now. |
OK, so the proximate failure is caused by this assertion failure: case BBJ_CALLFINALLY: case BBJ_EHCATCHRET: case BBJ_RETURN: case BBJ_EHFINALLYRET: case BBJ_EHFILTERRET: case BBJ_THROW: NO_WAY("can't have 'unreached' end of BB with non-empty stack"); break; at runtime/src/coreclr/jit/importer.cpp Line 17971 in d2cef2f
due to .method /*0600661E*/ public hidebysig static void ExtGetProgramBinarySource(uint32 program, valuetype OpenTK.Graphics.ES11.ShaderType/*02000B69*/ shadertype, [out] string& source, [out] int32* length) cil managed { .custom /*0C006B31:0A00001E*/ instance void [System.Runtime/*23000001*/]System.CLSCompliantAttribute/*01000016*/::.ctor(bool) /* 0A00001E */ = ( 01 00 00 00 00 ) // .maxstack 7 .locals /*11000005*/ init (native int V_0, int32 V_1) IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: ldarg.2 IL_0003: pop IL_0004: ldarg.3 IL_0005: ldind.i4 IL_0006: ldloc.1 IL_0007: ldc.i4.1 IL_0008: add IL_0009: call native int [System.Private.CoreLib/*23000008*/]System.Runtime.InteropServices.Marshal/*0100001C*/::AllocHGlobal(native int) /* 0A000023 */ IL_000e: stloc.0 IL_000f: ldloc.0 IL_0010: ldarg.3 IL_0011: ldsfld native int[] OpenTK.Graphics.ES11.GL/*02000A4C*/::EntryPoints /* 0400B09A */ IL_0016: ldc.i4.s 102 IL_0018: ldelem.i IL_0019: calli unmanaged stdcall void(uint32,int32,native int,int32*) /*11000113*/ IL_001e: ldarg.2 IL_001f: ldloc.0 IL_0020: call string OpenTK.Graphics.BindingsBase/*0200001E*/::MarshalPtrToString(native int) /* 06000002 */ IL_0025: stind.ref IL_0026: ldloc.0 IL_0027: call void [System.Private.CoreLib/*23000008*/]System.Runtime.InteropServices.Marshal/*0100001C*/::FreeHGlobal(native int) /* 0A000024 */ IL_002c: ret } // end of method Qcom::ExtGetProgramBinarySource This is the NgenDump for the method: ****** START compiling Qcom:ExtGetProgramBinarySource(int,int,byref,long) (MethodHash=f0d1279b) Generating code for Windows x64 OPTIONS: compCodeOpt = BLENDED_CODE OPTIONS: compDbgCode = false OPTIONS: compDbgInfo = true OPTIONS: compDbgEnC = false OPTIONS: compProcedureSplitting = false OPTIONS: compProcedureSplittingEH = false OPTIONS: No PGO data OPTIONS: Jit invoked for ngen IL to import: IL_0000 02 ldarg.0 IL_0001 03 ldarg.1 IL_0002 04 ldarg.2 IL_0003 26 pop IL_0004 05 ldarg.3 IL_0005 4a ldind.i4 IL_0006 07 ldloc.1 IL_0007 17 ldc.i4.1 IL_0008 58 add IL_0009 28 23 00 00 0a call 0xA000023 IL_000e 0a stloc.0 IL_000f 06 ldloc.0 IL_0010 05 ldarg.3 IL_0011 7e 9a b0 00 04 ldsfld 0x400B09A IL_0016 1f 66 ldc.i4.s 0x66 IL_0018 97 ldelem.i IL_0019 29 13 01 00 11 calli 0x11000113 IL_001e 04 ldarg.2 IL_001f 06 ldloc.0 IL_0020 28 02 00 00 06 call 0x6000002 IL_0025 51 stind.ref IL_0026 06 ldloc.0 IL_0027 28 24 00 00 0a call 0xA000024 IL_002c 2a ret Arg #0 passed in register(s) rcx Arg #1 passed in register(s) rdx Arg #2 passed in register(s) r8 Arg #3 passed in register(s) r9 lvaGrabTemp returning 6 (V06 tmp0) (a long lifetime temp) called for OutgoingArgSpace. ; Initial local variable assignments ; ; V00 arg0 int ; V01 arg1 int ; V02 arg2 byref ; V03 arg3 long ; V04 loc0 long ; V05 loc1 int ; V06 OutArgs lclBlk "OutgoingArgSpace" *************** In compInitDebuggingInfo() for Qcom:ExtGetProgramBinarySource(int,int,byref,long) getVars() returned cVars = 0, extendOthers = true info.compVarScopesCount = 6 VarNum LVNum Name Beg End 0: 00h 00h V00 arg0 000h 02Dh 1: 01h 01h V01 arg1 000h 02Dh 2: 02h 02h V02 arg2 000h 02Dh 3: 03h 03h V03 arg3 000h 02Dh 4: 04h 04h V04 loc0 000h 02Dh 5: 05h 05h V05 loc1 000h 02Dh info.compStmtOffsetsCount = 0 info.compStmtOffsetsImplicit = 0007h ( STACK_EMPTY NOP CALL_SITE ) *************** In fgFindBasicBlocks() for Qcom:ExtGetProgramBinarySource(int,int,byref,long) weight= 10 : state 3 [ ldarg.0 ] weight= 16 : state 4 [ ldarg.1 ] weight= 35 : state 5 [ ldarg.2 ] weight=-24 : state 39 [ pop ] weight= 28 : state 6 [ ldarg.3 ] weight=-11 : state 62 [ ldind.i4 ] weight= 9 : state 8 [ ldloc.1 ] weight= 28 : state 24 [ ldc.i4.1 ] weight=-12 : state 76 [ add ] weight= 79 : state 40 [ call ] weight= 20 : state 199 [ stloc.0 -> ldloc.0 ] weight= 28 : state 6 [ ldarg.3 ] weight=159 : state 112 [ ldsfld ] weight= 41 : state 32 [ ldc.i4.s ] weight= 65 : state 128 [ ldelem.i ] weight= 65 : state 41 [ calli ] weight= 35 : state 5 [ ldarg.2 ] weight= 12 : state 7 [ ldloc.0 ] weight= 79 : state 40 [ call ] weight= 60 : state 69 [ stind.ref ] weight= 12 : state 7 [ ldloc.0 ] weight= 79 : state 40 [ call ] weight= 19 : state 42 [ ret ] Marked V04 as a single def local Marked V05 as a single def local Jump targets: none New Basic Block BB01 [0000] created. BB01 [000..02D) Inline candidate looks like a wrapper method. Multiplier increased to 1. Inline candidate callsite is hot. Multiplier increased to 4. Callsite has profile data: 1. Multiplier limited to 16.8. calleeNativeSizeEstimate=832 callsiteNativeSizeEstimate=175 benefit multiplier=16.8 threshold=2940 Native estimate for function size is within threshold for inlining 83.2 <= 294 (multiplier = 16.8) IL Code Size,Instr 45, 24, Basic Block count 1, Local Variable Num,Ref count 7, 11 for method Qcom:ExtGetProgramBinarySource(int,int,byref,long) OPTIONS: opts.MinOpts() == false Basic block list for 'Qcom:ExtGetProgramBinarySource(int,int,byref,long)' ----------------------------------------------------------------------------------------------------------------------------------------- BBnum BBid ref try hnd weight lp [IL range] [jump] [EH region] [flags] ----------------------------------------------------------------------------------------------------------------------------------------- BB01 [0000] 1 1 [000..02D) (return) ----------------------------------------------------------------------------------------------------------------------------------------- *************** Starting PHASE Pre-import *************** Finishing PHASE Pre-import *************** Starting PHASE Profile incorporation BBOPT set, but no profile data available (hr=80004001) *************** Finishing PHASE Profile incorporation [no changes] *************** Starting PHASE Importation *************** In impImport() for Qcom:ExtGetProgramBinarySource(int,int,byref,long) impImportBlockPending for BB01 Importing BB01 (PC=000) of 'Qcom:ExtGetProgramBinarySource(int,int,byref,long)' [ 0] 0 (0x000) ldarg.0 [ 1] 1 (0x001) ldarg.1 [ 2] 2 (0x002) ldarg.2 [ 3] 3 (0x003) pop [ 2] 4 (0x004) ldarg.3 [ 3] 5 (0x005) ldind.i4 [ 3] 6 (0x006) ldloc.1 [ 4] 7 (0x007) ldc.i4.1 1 [ 5] 8 (0x008) add [ 4] 9 (0x009) call 0A000023 In Compiler::impImportCall: opcode is call, kind=0, callRetType is long, structSize is 0 lvaGrabTemp returning 7 (V07 tmp1) called for non-inline candidate call. STMT00000 (IL 0x000... ???) [000011] -A-XG------- * ASG int [000010] D------N---- +--* LCL_VAR int V07 tmp1 [000004] *--XG------- \--* IND int [000003] ------------ \--* LCL_VAR long V03 arg3 [ 4] 14 (0x00e) stloc.0 STMT00001 (IL ???... ???) [000014] -AC-G------- * ASG long [000013] D------N---- +--* LCL_VAR long V04 loc0 [000008] --C-G------- \--* CALL r2r_ind long System.Runtime.InteropServices.Marshal.AllocHGlobal [000009] ------------ arg0 \--* CAST long <- int [000007] ------------ \--* ADD int [000005] ------------ +--* LCL_VAR int V05 loc1 [000006] ------------ \--* CNS_INT int 1 [ 3] 15 (0x00f) ldloc.0 [ 4] 16 (0x010) ldarg.3 [ 5] 17 (0x011) ldsfld 0400B09A [ 6] 22 (0x016) ldc.i4.s 102 [ 7] 24 (0x018) ldelem.i [ 6] 25 (0x019) calli 11000113 lvaGrabTemp returning 8 (V08 tmp2) called for impImportIndirectCall. STMT00002 (IL ???... ???) [000024] -ACXG------- * ASG long [000023] D------N---- +--* LCL_VAR long V08 tmp2 [000022] --CXG------- \--* INDEX long [000020] --CXG------- +--* IND ref [000019] --CXG------- | \--* ADD byref [000017] --CXG------- | +--* CALL help r2r_ind byref HELPER.CORINFO_HELP_READYTORUN_STATIC_BASE [000018] ------------ | \--* CNS_INT int 88 Fseq[EntryPoints] [000021] ------------ \--* CNS_INT int 102 In Compiler::impImportCall: opcode is calli, kind=0, callRetType is void, structSize is 0 Inline a CALLI PINVOKE call from method Qcom:ExtGetProgramBinarySource(int,int,byref,long)INLINER: during 'impMarkInlineCandidate' result 'failed this call site' reason 'target not direct managed' for 'Qcom:ExtGetProgramBinarySource(int,int,byref,long)' calling 'n/a' INLINER: during 'impMarkInlineCandidate' result 'failed this call site' reason 'target not direct managed' STMT00003 (IL ???... ???) [000026] --CXG------- * CALL ind unman void [000001] ------------ arg0 +--* LCL_VAR int V01 arg1 [000012] ------------ arg1 +--* LCL_VAR int V07 tmp1 [000015] ------------ arg2 +--* LCL_VAR long V04 loc0 [000016] ------------ arg3 +--* LCL_VAR long V03 arg3 [000025] ------------ calli tgt \--* LCL_VAR long V08 tmp2 [ 1] 30 (0x01e) ldarg.2 [ 2] 31 (0x01f) ldloc.0 [ 3] 32 (0x020) call 06000002 In Compiler::impImportCall: opcode is call, kind=0, callRetType is ref, structSize is 0 STMT00004 (IL 0x01E... ???) [000029] I-C-G------- * CALL r2r_ind ref OpenTK.Graphics.BindingsBase.MarshalPtrToString (exactContextHnd=0x4000000000420051) [000028] ------------ arg0 \--* LCL_VAR long V04 loc0 [ 3] 37 (0x025) stind.ref STMT00005 (IL ???... ???) [000032] -ACXG------- * ASG ref [000031] *------N---- +--* IND ref [000027] ------------ | \--* LCL_VAR byref V02 arg2 [000030] --C--------- \--* RET_EXPR ref (inl return expr [000029]) [ 1] 38 (0x026) ldloc.0 [ 2] 39 (0x027) call 0A000024 (Implicit Tail call: prefixFlags |= PREFIX_TAILCALL_IMPLICIT) In Compiler::impImportCall: opcode is call, kind=0, callRetType is void, structSize is 0 Detected unsafe code: importer.cpp:9286 : Stack should be empty after tailcall, while compiling Qcom:ExtGetProgramBinarySource(int,int,byref,long) opcode call, IL offset 27 info.compCompHnd->canTailCall returned false for call [000034] STMT00006 (IL ???... ???) [000034] --C-G------- * CALL r2r_ind void System.Runtime.InteropServices.Marshal.FreeHGlobal [000033] ------------ arg0 \--* LCL_VAR long V04 loc0 [ 1] 44 (0x02c) ret STMT00007 (IL 0x02C... ???) [000035] ------------ * RETURN void ****** START compiling Qcom:ExtGetProgramBinarySource(int,int,byref,long) (MethodHash=f0d1279b) Generating code for Windows x64 OPTIONS: compCodeOpt = BLENDED_CODE OPTIONS: compDbgCode = false OPTIONS: compDbgInfo = true OPTIONS: compDbgEnC = false OPTIONS: compProcedureSplitting = false OPTIONS: compProcedureSplittingEH = false OPTIONS: No PGO data OPTIONS: Jit invoked for ngen IL to import: IL_0000 02 ldarg.0 IL_0001 03 ldarg.1 IL_0002 04 ldarg.2 IL_0003 26 pop IL_0004 05 ldarg.3 IL_0005 4a ldind.i4 IL_0006 07 ldloc.1 IL_0007 17 ldc.i4.1 IL_0008 58 add IL_0009 28 23 00 00 0a call 0xA000023 IL_000e 0a stloc.0 IL_000f 06 ldloc.0 IL_0010 05 ldarg.3 IL_0011 7e 9a b0 00 04 ldsfld 0x400B09A IL_0016 1f 66 ldc.i4.s 0x66 IL_0018 97 ldelem.i IL_0019 29 13 01 00 11 calli 0x11000113 IL_001e 04 ldarg.2 IL_001f 06 ldloc.0 IL_0020 28 02 00 00 06 call 0x6000002 IL_0025 51 stind.ref IL_0026 06 ldloc.0 IL_0027 28 24 00 00 0a call 0xA000024 IL_002c 2a ret Arg #0 passed in register(s) rcx Arg #1 passed in register(s) rdx Arg #2 passed in register(s) r8 Arg #3 passed in register(s) r9 lvaGrabTemp returning 6 (V06 tmp0) (a long lifetime temp) called for OutgoingArgSpace. ; Initial local variable assignments ; ; V00 arg0 int ; V01 arg1 int ; V02 arg2 byref ; V03 arg3 long ; V04 loc0 long ; V05 loc1 int ; V06 OutArgs lclBlk "OutgoingArgSpace" *************** In compInitDebuggingInfo() for Qcom:ExtGetProgramBinarySource(int,int,byref,long) getVars() returned cVars = 0, extendOthers = true info.compVarScopesCount = 6 VarNum LVNum Name Beg End 0: 00h 00h V00 arg0 000h 02Dh 1: 01h 01h V01 arg1 000h 02Dh 2: 02h 02h V02 arg2 000h 02Dh 3: 03h 03h V03 arg3 000h 02Dh 4: 04h 04h V04 loc0 000h 02Dh 5: 05h 05h V05 loc1 000h 02Dh info.compStmtOffsetsCount = 0 info.compStmtOffsetsImplicit = 0007h ( STACK_EMPTY NOP CALL_SITE ) *************** In fgFindBasicBlocks() for Qcom:ExtGetProgramBinarySource(int,int,byref,long) weight= 10 : state 3 [ ldarg.0 ] weight= 16 : state 4 [ ldarg.1 ] weight= 35 : state 5 [ ldarg.2 ] weight=-24 : state 39 [ pop ] weight= 28 : state 6 [ ldarg.3 ] weight=-11 : state 62 [ ldind.i4 ] weight= 9 : state 8 [ ldloc.1 ] weight= 28 : state 24 [ ldc.i4.1 ] weight=-12 : state 76 [ add ] weight= 79 : state 40 [ call ] weight= 20 : state 199 [ stloc.0 -> ldloc.0 ] weight= 28 : state 6 [ ldarg.3 ] weight=159 : state 112 [ ldsfld ] weight= 41 : state 32 [ ldc.i4.s ] weight= 65 : state 128 [ ldelem.i ] weight= 65 : state 41 [ calli ] weight= 35 : state 5 [ ldarg.2 ] weight= 12 : state 7 [ ldloc.0 ] weight= 79 : state 40 [ call ] weight= 60 : state 69 [ stind.ref ] weight= 12 : state 7 [ ldloc.0 ] weight= 79 : state 40 [ call ] weight= 19 : state 42 [ ret ] Marked V04 as a single def local Marked V05 as a single def local Jump targets: none New Basic Block BB01 [0000] created. BB01 [000..02D) Inline candidate looks like a wrapper method. Multiplier increased to 1. Inline candidate callsite is hot. Multiplier increased to 4. Callsite has profile data: 1. Multiplier limited to 16.8. calleeNativeSizeEstimate=832 callsiteNativeSizeEstimate=175 benefit multiplier=16.8 threshold=2940 Native estimate for function size is within threshold for inlining 83.2 <= 294 (multiplier = 16.8) CLFLG_MINOPT set for method Qcom:ExtGetProgramBinarySource(int,int,byref,long) IL Code Size,Instr 45, 24, Basic Block count 1, Local Variable Num,Ref count 7, 11 for method Qcom:ExtGetProgramBinarySource(int,int,byref,long) OPTIONS: opts.MinOpts() == true Basic block list for 'Qcom:ExtGetProgramBinarySource(int,int,byref,long)' ----------------------------------------------------------------------------------------------------------------------------------------- BBnum BBid ref try hnd weight lp [IL range] [jump] [EH region] [flags] ----------------------------------------------------------------------------------------------------------------------------------------- BB01 [0000] 1 1 [000..02D) (return) ----------------------------------------------------------------------------------------------------------------------------------------- *************** Starting PHASE Pre-import *************** Finishing PHASE Pre-import *************** Starting PHASE Profile incorporation BBOPT set, but no profile data available (hr=80004001) *************** Finishing PHASE Profile incorporation [no changes] *************** Starting PHASE Importation *************** In impImport() for Qcom:ExtGetProgramBinarySource(int,int,byref,long) impImportBlockPending for BB01 Importing BB01 (PC=000) of 'Qcom:ExtGetProgramBinarySource(int,int,byref,long)' [ 0] 0 (0x000) ldarg.0 [ 1] 1 (0x001) ldarg.1 [ 2] 2 (0x002) ldarg.2 [ 3] 3 (0x003) pop [ 2] 4 (0x004) ldarg.3 [ 3] 5 (0x005) ldind.i4 [ 3] 6 (0x006) ldloc.1 [ 4] 7 (0x007) ldc.i4.1 1 [ 5] 8 (0x008) add [ 4] 9 (0x009) call 0A000023 In Compiler::impImportCall: opcode is call, kind=0, callRetType is long, structSize is 0 lvaGrabTemp returning 7 (V07 tmp1) called for non-inline candidate call. STMT00000 (IL 0x000... ???) [000011] -A-XG------- * ASG int [000010] D------N---- +--* LCL_VAR int V07 tmp1 [000004] *--XG------- \--* IND int [000003] ------------ \--* LCL_VAR long V03 arg3 [ 4] 14 (0x00e) stloc.0 STMT00001 (IL ???... ???) [000014] -AC-G------- * ASG long [000013] D------N---- +--* LCL_VAR long V04 loc0 [000008] --C-G------- \--* CALL r2r_ind long System.Runtime.InteropServices.Marshal.AllocHGlobal [000009] ------------ arg0 \--* CAST long <- int [000007] ------------ \--* ADD int [000005] ------------ +--* LCL_VAR int V05 loc1 [000006] ------------ \--* CNS_INT int 1 [ 3] 15 (0x00f) ldloc.0 [ 4] 16 (0x010) ldarg.3 [ 5] 17 (0x011) ldsfld 0400B09A [ 6] 22 (0x016) ldc.i4.s 102 [ 7] 24 (0x018) ldelem.i [ 6] 25 (0x019) calli 11000113 lvaGrabTemp returning 8 (V08 tmp2) called for impImportIndirectCall. STMT00002 (IL ???... ???) [000024] -ACXG------- * ASG long [000023] D------N---- +--* LCL_VAR long V08 tmp2 [000022] --CXG------- \--* INDEX long [000020] --CXG------- +--* IND ref [000019] --CXG------- | \--* ADD byref [000017] --CXG------- | +--* CALL help r2r_ind byref HELPER.CORINFO_HELP_READYTORUN_STATIC_BASE [000018] ------------ | \--* CNS_INT int 88 Fseq[EntryPoints] [000021] ------------ \--* CNS_INT int 102 In Compiler::impImportCall: opcode is calli, kind=0, callRetType is void, structSize is 0 Inline a CALLI PINVOKE call from method Qcom:ExtGetProgramBinarySource(int,int,byref,long) STMT00003 (IL ???... ???) [000026] --CXG------- * CALL ind unman void [000001] ------------ arg0 +--* LCL_VAR int V01 arg1 [000012] ------------ arg1 +--* LCL_VAR int V07 tmp1 [000015] ------------ arg2 +--* LCL_VAR long V04 loc0 [000016] ------------ arg3 +--* LCL_VAR long V03 arg3 [000025] ------------ calli tgt \--* LCL_VAR long V08 tmp2 [ 1] 30 (0x01e) ldarg.2 [ 2] 31 (0x01f) ldloc.0 [ 3] 32 (0x020) call 06000002 In Compiler::impImportCall: opcode is call, kind=0, callRetType is ref, structSize is 0 [ 3] 37 (0x025) stind.ref STMT00004 (IL 0x01E... ???) [000031] -ACXG------- * ASG ref [000030] *------N---- +--* IND ref [000027] ------------ | \--* LCL_VAR byref V02 arg2 [000029] --C-G------- \--* CALL r2r_ind ref OpenTK.Graphics.BindingsBase.MarshalPtrToString [000028] ------------ arg0 \--* LCL_VAR long V04 loc0 [ 1] 38 (0x026) ldloc.0 [ 2] 39 (0x027) call 0A000024 In Compiler::impImportCall: opcode is call, kind=0, callRetType is void, structSize is 0 STMT00005 (IL ???... ???) [000033] --C-G------- * CALL r2r_ind void System.Runtime.InteropServices.Marshal.FreeHGlobal [000032] ------------ arg0 \--* LCL_VAR long V04 loc0 [ 1] 44 (0x02c) ret STMT00006 (IL 0x02C... ???) [000034] ------------ * RETURN void To repro, add following arguments to the command line: --singlemethodtypename "OpenTK.Graphics.ES11.GL+Qcom,OpenTK.Graphics" --singlemethodname "ExtGetProgramBinarySource" --singlemethodindex 12 Unhandled exception. ILCompiler.CodeGenerationFailedException: Code generation failed for method '[OpenTK.Graphics]OpenTK.Graphics.ES11.GL+Qcom.ExtGetProgramBinarySource(uint32,ShaderType,string&,int32*)' @AndyAyersMS, could you please suggest someone from the JIT team to take a deeper look and help me understand whether we're doing something wrong in Crossgen2 or whether we've just started to hit a previously unseen corner case actually crashing the JIT compilation? I can confirm this trivially reproes with a freshly compiled Crossgen2 from runtime main. Thanks Tomas |
/cc @dotnet/crossgen-contrib @dotnet/jit-contrib |
This is same problem as dotnet/corert#8346 OpenTK.Graphics assembly contains invalid IL. crossgen2 does not tolerate completely invalid IL like this. The problem was fixed by opentk/opentk#1286. The latest version of the OpenTK.Graphics package should have the fix. |
Ah, yeah looks like its the same problem. @ChrisKoebke could you please try with the latest version or opentk.graphics? Will close for now. |
Thanks a lot for your help! I'm currently using the latest available version from NuGet: OpenTK.Graphics v4.6.7. What's weird about this is: I do have trimming enabled and am not using ExtGetProgramBinarySource anywhere in my project. Would it be possible to just discard this function entirely from the AOT compilation or is there some way to explicitly tell the AOT compiler to discard it? It would also be really nice to have some more descriptive error messages in the Publish window. It currently just says "We couldn't determine the cause of this issue", so I assumed it has to be a R2R error. If it would say something like "We couldn't compile ExtGetProgramBinarySource from OpenTK.Graphics.dll, as it contains invalid IL instructions" that would've been really helpful to clarify that it's a problem with OpenTK and not with R2R. Cheers, |
If you only set |
@ChrisKoebke if you would open an issue in the OpenTK repo with the issues you are currently having it would be a lot easier for us to track this issue as it seems like it's not been solved with opentk/opentk#1286 |
@jkotas Sorry for the ping. But it seems like this IL is the one that is generated after opentk/opentk#1286. Related to this topic, I've wondered if there is somewhere where one could read about what would constitute invalid IL, as from what I've seen the documentation is pretty sparse with details on what is actually allowed and what isn't. It could also be that I'm missing information and that I'm using the wrong mental model when thinking about IL stuff. Any resource you could recommend would be of help. 🙂 |
The problem is that there is extra item on the IL stack at the end of the method. Here is the IL annotated with the depth of the IL stack after each instruction:
The doc that describes rules for valid IL is ECMA-335. ECMA-335 describes the rules for verifiable IL that are superset of the rules for valid IL, but that's not relevant in this case. The rule violated in this case is "The evaluation stack for the current method shall be empty except for |
Thanks a lot for your time! Really clear explanation. Also thanks for the link where I can read more about the issues. |
Description
When referencing OpenTK.Graphics, I'm getting a an ILCompiler.CodeGenerationFailedException on a Ready2Run publish and the build fails.
Configuration
The configuration for Publish is the same as in this issue
Other information
The text was updated successfully, but these errors were encountered: