Skip to content

WASM AOT fails with regex in .NET 9 #109862

Open

Description

@voroninp

Description

I am playing with Blazor and discovered that for some reason publishing application as WASM AOT breaks it one way or another.

Here is the repo

If I use regular (not source generated regex with NonBacktracing option, application fails at startup.

Here is an example of the log I see in browser console. (including debug logs from Mono):
voroninp.github.io-1731573811462.log

If I remove NonBacktracking application start without any issue.

When I switch to source generated regex, I have another error:

ManagedError: AggregateException_ctor_DefaultMessage (NoMetadataForType, System.Object, DutchVerbs.Spa.Infrastructure.SourceGenerationContext Path: $ | LineNumber: 0 | BytePositionInLine: 1.)
    at sn (dotnet.runtime.o8gq1i8bk6.js:3:26894)
    at Kt.resolve_or_reject (dotnet.runtime.o8gq1i8bk6.js:3:26449)
    at dotnet.runtime.o8gq1i8bk6.js:3:172526
    at dotnet.runtime.o8gq1i8bk6.js:3:172590
    at fr (dotnet.runtime.o8gq1i8bk6.js:3:35046)
    at Fc (dotnet.runtime.o8gq1i8bk6.js:3:172173)
    at dotnet.native.sn79jhuo16.wasm:0x360233
    at dotnet.native.sn79jhuo16.wasm:0x36c10f
    at dotnet.native.sn79jhuo16.wasm:0x64a937
    at dotnet.native.sn79jhuo16.wasm:0x91fccc

P.S. I was asked to create a new issue by @vitek-karas here

Reproduction Steps

Visit this url to see the error, or play with the repository https://github.com/voroninp/DutchVerbs

Expected behavior

It should not fail.

Actual behavior

It fails.

Regression?

I did not have the problem with .NET 8

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. ghost added
    needs-area-label
    on Nov 15, 2024
  2. added
    untriaged
    on Nov 15, 2024
  3. added
    arch-wasm
    os-browser
    and removed
    untriaged
    needs-area-label
    on Nov 15, 2024
  4. added this to the 9.0.x milestone on Nov 15, 2024
  5. dotnet-policy-service commented on Nov 15, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-wasm': @lewing
    See info in area-owners.md if you want to be subscribed.

  6. modified the milestones: 9.0.x, 9.0.0 on Nov 15, 2024
  7. pavelsavara commented on Nov 18, 2024

    @pavelsavara
    Member

    I think that the interesting part of the log is

    dotnet.runtime.o8gq1i8bk6.js:3 [MONO] AOT NOT FOUND: (wrapper other) object:gsharedvt_out_sig (intptr,System.Text.RegularExpressions.Symbolic.SymbolicRegexBuilder`1/NodeCacheKey<object>&,intptr).
    dotnet.runtime.o8gq1i8bk6.js:3 [MONO] * Assertion at /__w/1/s/src/mono/mono/mini/interp/interp.c:2667, condition `<disabled>' not met
    

    which is pointing to

    MonoMethod *wrapper = mini_get_gsharedvt_out_sig_wrapper (sig);
    jit_wrapper = mono_jit_compile_method_jit_only (wrapper, error);
    mono_error_assert_ok (error);

  8. vitek-karas commented on Nov 18, 2024

    @vitek-karas
    Member

    @BrzVlad - this is probably the interpreter problem from #99030 (comment). There seems to be a repro (I didn't try it).

  9. voroninp commented on Feb 20, 2025

    @voroninp
    Author

    So, gentlemen? How is it going with this issue?

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

Metadata

Metadata

Assignees

Labels

arch-wasmarea-Codegen-AOT-monoos-browser

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions