Skip to content

[wasm-mt] AOT compilation with threading enabled results in out of bounds memory access #75474

@lambdageek

Description

@lambdageek

Compiling with dotnet publish -c Release -p:RunAOTCompilation=true -p:PublishTrimmed=true -p:WasmEnableThreads=true results in crashes at runtime

  • Install 7.0.100-rc.2.22462.1 from dotnet/installer

  • create a NuGet.config for the dotnet7 feed

     <configuration>
       <packageSources>
         <add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
       </packageSources>
     </configuration>
  • install the wasm-experimental workload using dotnet workload install wasm-experimental

  • create a new app from the wasmbrowser template: dotnet new wasmbrowser

  • Publish with threads, AOT and trimming dotnet publish -c Release -p:RunAOTCompilation=true -p:PublishTrimmed=true -p:WasmEnableThreads=true

Result:

Screen Shot 2022-09-12 at 15 17 53

dotnet.js:5 Error: [MONO] * Assertion at /__w/1/s/src/mono/mono/metadata/exception.c:64, condition `is_ok (error)' not met, function:mono_exception_new_by_name, (null) assembly:System.Private.CoreLib.dll type:ArgumentException member:(null)

    at ke (dotnet.js:5:509)
    at Object.Ne (dotnet.js:5:792)
    at _mono_wasm_trace_logger (dotnet.js:14:101296)
    at :50266/dotnet.wasm
    at :50266/dotnet.wasm
    at :50266/dotnet.wasm
    at :50266/dotnet.wasm
    at :50266/dotnet.wasm
    at :50266/dotnet.wasm
    at :50266/dotnet.wasm
Ne @ dotnet.js:5

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions