Skip to content

[wasm][debugger] - RuntimeError: memory access out of bounds #51276

@pavelsavara

Description

@pavelsavara

Description

When debugging method which contains StringBuilder, the Mono SDB throws memory access exception.

RuntimeError: memory access out of bounds
    at describe_value (http://localhost:8004/dotnet.wasm:wasm-function[7095]:0x1c5eb7)
    at describe_variable (http://localhost:8004/dotnet.wasm:wasm-function[7104]:0x1c7242)
    at describe_variables_on_frame (http://localhost:8004/dotnet.wasm:wasm-function[7103]:0x1c6fd2)
    at mono_walk_stack_full (http://localhost:8004/dotnet.wasm:wasm-function[6414]:0x1a3f20)
    at mono_walk_stack_with_ctx (http://localhost:8004/dotnet.wasm:wasm-function[6412]:0x1a3aec)
    at mono_wasm_get_local_vars (http://localhost:8004/dotnet.wasm:wasm-function[7102]:0x1c6e05)
    at http://localhost:8004/dotnet.js:1431:22
    at ccall (http://localhost:8004/dotnet.js:645:18)
    at Object.<anonymous> (http://localhost:8004/dotnet.js:657:12)
    at Object.value (http://localhost:8004/dotnet.js:7346:60)

Configuration

Steps to reproduce via small code change this branch
main...pavelsavara:wasm_debugger_crash

  1. build mono runtime in Debug mode
  2. sample code
        [MethodImpl(MethodImplOptions.NoInlining)]
        public static int TestMeaning()
        {
            return 42 + TestMeaningSB(); // place breakpoint here and then step in.
        }

        [MethodImpl(MethodImplOptions.NoInlining)]
        public static int TestMeaningSB()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append('a');
            return sb.Length;
        }
  1. put breakpoint into TestMeaning() and step into TestMeaningSB()
  2. Look into the log of BrowserDebugHost

Regression?

Don't know.

Other information

It's actually able to kill the browser tab 'aw, snap!'
Ubuntu in WSL2, X11
Chmore version 89.0.4389.114 (Official Build) (64-bit)

image

Enabling browser crash dump prevents the reproduction of the crash for me.

Metadata

Metadata

Assignees

Labels

arch-wasmWebAssembly architecturearea-Debugger-monountriagedNew issue has not been triaged by the area owner

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions