Skip to content

[.NET 7.0 + WASM AOT] Assembly.GetName().Name crashes the app #79814

Closed
@DierkDroth

Description

@DierkDroth

Description

@vargaz I came across another WASM AOT crash where @jeromelaban pointed me here.

I'll copy the details of my original report for your convenience ... and please believe me, for the whole weekend I (successfully) isolated the issue in my app and (unsuccessfully) tried to create a repo, but again failed ... so, again no repo :-(

I isolated an AOT crash where adding the line
var o = GetType().Assembly.GetName().Name;
... to my app's code crashes the app (screenshow and logs below).

Interestingly I have the line below right before the offending line above in my code and this itself does not cause any issues
collection-which-is-not-empty.FirstOrDefault(o => o.Name == assembly.GetName().Name && o.Version == assembly.GetName().Version.ToString(3)) == null

And it's getting even more weird: if I commented out the offending line, then the app would work as expected - of course. But if I 'commented' it out by

#if !HAS_UNO_WASM
var o = GetType().Assembly.GetName().Name;
#endif

... then the app still would crash?!? Really?!? Go figure...

Unfortunately I was unable to create a repo - although the issue itself is 100% reproducible by only adding the offending line above to my app. So, another WASM AOT mystery ... :-(

Would you have any idea idea what might be causing the issue?

1671438561270.zip

dotnet.js:1149 2022-12-19 08:27:21:693 (df574c21-3788-4807-9e52-2d6a793ca322) Common.Session.ConnectDbAsync: useLocalDb=False
dotnet.js:5 Error: [MONO] * Assertion at D:/a/Uno.DotnetRuntime.WebAssembly/Uno.DotnetRuntime.WebAssembly/runtime/src/mono/mono/mini/interp/interp.c:2557, condition `is_ok (error)' not met, function:init_jit_call_info, Attempting to JIT compile method '(wrapper other) void modreq(System.Runtime.CompilerServices.IsExternalInit) object:gsharedvt_out_sig (object&,intptr)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
 assembly:<unknown assembly> type:<unknown type> member:(null)

    at mono_wasm_stringify_as_error_with_stack (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.js:5:620)
    at Object.mono_wasm_trace_logger (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.js:5:985)
    at _mono_wasm_trace_logger (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.js:5034:66)
    at wasm_trace_logger (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.wasm)
    at eglib_log_adapter (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.wasm)
    at monoeg_g_logv_nofree (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.wasm)
    at monoeg_assertion_message (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.wasm)
    at do_jit_call (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.wasm)
    at interp_exec_method (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.wasm)
    at interp_runtime_invoke (Latest/package_34f078c37648e985421d5e6a0dc211630a4e3da0/dotnet.wasm)
mono_wasm_trace_logger @ dotnet.js:5

Reproduction Steps

Please see above

Expected behavior

Please see above

Actual behavior

Please see above

Regression?

No response

Known Workarounds

None

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions