Skip to content

[wasm][coreclr] TypeLoadException during type loading #127426

Description

@radekdoulik

@davidwrighton this is the regression in priority1 test from #126901

Few tests in Methodical_*.csproj priority1 are failing with:

Unhandled exception. System.TypeLoadException: Could not load type 'JitTest_call_cs.VT' from assembly 'Methodical_d2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at Program.<Main>$(String[] args) in /Users/rodo/git/runtime-r2r-pe/artifacts/tests/coreclr/obj/browser.wasm.Debug/Managed/JIT/Methodical/Methodical_d2/generated/XUnitWrapperGenerator/XUnitWrapperGenerator.XUnitWrapperGenerator/FullRunner.g.cs:line 319
   at System.Environment.CallEntryPoint(IntPtr entryPoint, String[]* pArgument, Int32* pReturnValue, Boolean captureException, Exception* pException)
Aborted(native code called abort())

Standalone repro: https://gist.github.com/radekdoulik/b12c12fb2327ff56b839a9f0ba752724

Temporary workaround:

diff --git a/src/coreclr/vm/wasm/helpers.cpp b/src/coreclr/vm/wasm/helpers.cpp
index bcc93890591..f25dd7a83ba 100644
--- a/src/coreclr/vm/wasm/helpers.cpp
+++ b/src/coreclr/vm/wasm/helpers.cpp
@@ -1146,6 +1146,12 @@ void* GetPortableEntryPointToInterpreterThunk(MethodDesc *pMD)
         return NULL;
     }
 
+    MethodTable* pMT = pMD->GetMethodTable();
+    if (pMT != NULL && !pMT->IsFullyLoaded())
+    {
+        return NULL;
+    }
+

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmWebAssembly architecturearea-VM-coreclrdisabled-testThe test is disabled in source code against the issue

    Type

    No type

    Projects

    • Status
      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions