Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Assertion failure in DebuggerTests.HotReloadTests on main - src/mono/mono/component/debugger-engine.c:176 #88528

Closed
radical opened this issue Jul 7, 2023 · 14 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Debugger-mono Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@radical
Copy link
Member

radical commented Jul 7, 2023

Build Information

Build error leg or test failing: chrome-DebuggerTests.HotReloadTests.WorkItemExecution
Hit on rolling build, and log.

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "",
  "ErrorPattern": "console.warning:.* /__w/1/s/src/mono/mono/component/debugger-engine.c:176",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

cc @lambdageek

Update: changes since last passing build: cd9d541...4285e43

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=331668
Error message validated: console.warning:.* /__w/1/s/src/mono/mono/component/debugger-engine.c:176
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/7/2023 4:55:55 PM UTC

Report

Build Definition Test Pull Request
334343 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88627
334246 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution
334152 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88345
334155 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #79856
334095 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88052
334078 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88619
334024 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88612
332745 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #87768
333945 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #86982
333869 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88387
333883 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88606
333866 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88387
333768 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88268
333750 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88245
333566 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88387
333481 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88595
333453 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88594
333375 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #87260
333354 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #86787
333355 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #86787
333367 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution
333168 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88543
333161 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution
332991 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution
332945 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88543
332898 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88543
332849 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution
332766 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88245
332625 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution
332455 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #87768
332443 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #87161
332439 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #87990
332380 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution
332270 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88245
331603 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #86875
332057 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88387
331953 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #87959
331893 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88523
331739 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #87959
331668 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution
331629 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88466
331455 dotnet/runtime chrome-DebuggerTests.HotReloadTests.WorkItemExecution #88505

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 42
@radical radical added arch-wasm WebAssembly architecture blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' area-Debugger-mono Known Build Error Use this to report build issues in the .NET Helix tab labels Jul 7, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 7, 2023
@ghost
Copy link

ghost commented Jul 7, 2023

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

Issue Details

Build Information

Build:
Build error leg or test failing: chrome-DebuggerTests.HotReloadTests.WorkItemExecution
Hit on rolling build, and log.

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "",
  "ErrorPattern": "console.warning:.* /__w/1/s/src/mono/mono/component/debugger-engine.c:176",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

cc @lambdageek

Author: radical
Assignees: -
Labels:

arch-wasm, blocking-clean-ci, area-Debugger-mono, Known Build Error

Milestone: -

@radical radical added this to the 8.0.0 milestone Jul 7, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 7, 2023
@radical radical changed the title [wasm] DebuggerTests.HotReloadTests failing on main [wasm] Assertion failure in DebuggerTests.HotReloadTests on main - src/mono/mono/component/debugger-engine.c:176 Jul 7, 2023
@radical
Copy link
Member Author

radical commented Jul 7, 2023

Changes since the last failing build: cd9d541...609b863

@lambdageek
Copy link
Member

None of the changes seem related. I wonder if it's some kind of race condition between applying the update and the chrome devtools

@radical
Copy link
Member Author

radical commented Jul 10, 2023

Noticed this in the proxy log:

{
   "id" : 100,
   "result" : {
      "exceptionDetails" : {
         "columnNumber" : 21914,
         "exceptionId" : 2,
         "lineNumber" : 2,
         "scriptId" : "8",
         "stackTrace" : {
            "callFrames" : [
               {
                  "columnNumber" : 21914,
                  "functionName" : "Ft",
                  "lineNumber" : 2,
                  "scriptId" : "8",
                  "url" : "http://localhost:9400/_framework/dotnet.runtime.js"
               },
               {
                  "columnNumber" : 29,
                  "functionName" : "",
                  "lineNumber" : 0,
                  "scriptId" : "103",
                  "url" : ""
               },
               {
                  "columnNumber" : 20961,
                  "functionName" : "mono_wasm_fire_debugger_agent_message_with_data_to_pause",
                  "lineNumber" : 2,
                  "scriptId" : "8",
                  "url" : "http://localhost:9400/_framework/dotnet.runtime.js"
               },
               {
                  "columnNumber" : 21032,
                  "functionName" : "mono_wasm_fire_debugger_agent_message_with_data",
                  "lineNumber" : 2,
                  "scriptId" : "8",
                  "url" : "http://localhost:9400/_framework/dotnet.runtime.js"
               },
               {
                  "columnNumber" : 457628,
                  "functionName" : "$func1608",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 487646,
                  "functionName" : "$func1716",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 486081,
                  "functionName" : "$func1715",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 466849,
                  "functionName" : "$func1641",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 457235,
                  "functionName" : "$func1605",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 112544,
                  "functionName" : "$func236",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 101851,
                  "functionName" : "$func233",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 118256,
                  "functionName" : "$func267",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 950720,
                  "functionName" : "$func3408",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 781957,
                  "functionName" : "$func2737",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 781845,
                  "functionName" : "$func2736",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 635819,
                  "functionName" : "$func2115",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 128364,
                  "functionName" : "$func343",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 113811,
                  "functionName" : "$func240",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 61275,
                  "functionName" : "$func233",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 118256,
                  "functionName" : "$func267",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 950720,
                  "functionName" : "$func3408",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 781957,
                  "functionName" : "$func2737",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 783940,
                  "functionName" : "$func2743",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 793765,
                  "functionName" : "$func2767",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 41846,
                  "functionName" : "$mono_wasm_invoke_method_ref",
                  "lineNumber" : 0,
                  "scriptId" : "10",
                  "url" : "http://localhost:9400/_framework/dotnet.native.wasm"
               },
               {
                  "columnNumber" : 122834,
                  "functionName" : "Module._mono_wasm_invoke_method_ref",
                  "lineNumber" : 7,
                  "scriptId" : "9",
                  "url" : "http://localhost:9400/_framework/dotnet.native.js"
               },
               {
                  "columnNumber" : 4,
                  "functionName" : "_debugger_test__TestHotReloadUsingSDB_RunMethod",
                  "lineNumber" : 26,
                  "scriptId" : "102",
                  "url" : "https://dotnet.generated.invalid/_debugger_test__TestHotReloadUsingSDB_RunMethod"
               },
               {
                  "columnNumber" : 10,
                  "functionName" : "invoke_static_method",
                  "lineNumber" : 27,
                  "scriptId" : "3",
                  "url" : "http://localhost:9400/debugger-driver.html"
               },
               {
                  "columnNumber" : 31,
                  "functionName" : "",
                  "lineNumber" : 0,
                  "scriptId" : "101",
                  "url" : ""
               }
            ],
            "exception" : {
               "className" : "TypeError",
               "description" : "TypeError: Cannot destructure property 'res_ok' of 'jt.remove(...)' as it is undefined.\n    at Object.Ft [as mono_wasm_get_dbg_command_info] (http://localhost:9400/_framework/dotnet.runtime.js:3:21915)\n    at <anonymous>:1:30\n    at mono_wasm_fire_debugger_agent_message_with_data_to_pause (http://localhost:9400/_framework/dotnet.runtime.js:3:20962)\n    at mono_wasm_fire_debugger_agent_message_with_data (http://localhost:9400/_framework/dotnet.runtime.js:3:21033)\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1608]:0x6fb9c\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1716]:0x770de\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1715]:0x76ac1\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1641]:0x71fa1\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1605]:0x6fa13\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[236]:0x1b7a0",
               "objectId" : "7846654860270616121.1.109",
               "subtype" : "error",
               "type" : "object"
            },
            "parent" : {
               "callFrames" : [
                  {
                     "columnNumber" : 7,
                     "functionName" : "",
                     "lineNumber" : 0,
                     "scriptId" : "101",
                     "url" : ""
                  }
               ],
               "description" : "setTimeout"
            }
         },
         "text" : "Uncaught"
      },
      "result" : {
         "className" : "TypeError",
         "description" : "TypeError: Cannot destructure property 'res_ok' of 'jt.remove(...)' as it is undefined.\n    at Object.Ft [as mono_wasm_get_dbg_command_info] (http://localhost:9400/_framework/dotnet.runtime.js:3:21915)\n    at <anonymous>:1:30\n    at mono_wasm_fire_debugger_agent_message_with_data_to_pause (http://localhost:9400/_framework/dotnet.runtime.js:3:20962)\n    at mono_wasm_fire_debugger_agent_message_with_data (http://localhost:9400/_framework/dotnet.runtime.js:3:21033)\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1608]:0x6fb9c\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1716]:0x770de\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1715]:0x76ac1\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1641]:0x71fa1\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1605]:0x6fa13\n    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[236]:0x1b7a0",
         "objectId" : "7846654860270616121.1.108",
         "subtype" : "error",
         "type" : "object"
      }
   }
}
TypeError: Cannot destructure property 'res_ok' of 'jt.remove(...)' as it is undefined.
    at Object.Ft [as mono_wasm_get_dbg_command_info] (http://localhost:9400/_framework/dotnet.runtime.js:3:21915)
    at <anonymous>:1:30
    at mono_wasm_fire_debugger_agent_message_with_data_to_pause (http://localhost:9400/_framework/dotnet.runtime.js:3:20962)
    at mono_wasm_fire_debugger_agent_message_with_data (http://localhost:9400/_framework/dotnet.runtime.js:3:21033)
    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1608]:0x6fb9c
    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1716]:0x770de
    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1715]:0x76ac1
    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1641]:0x71fa1
    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1605]:0x6fa13
    at http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[236]:0x1b7a0

@radical
Copy link
Member Author

radical commented Jul 10, 2023

IIUC, this uncaught exception should have been caught by the test harness.

@radical
Copy link
Member Author

radical commented Jul 10, 2023

symbolicated:

TypeError: Cannot destructure property 'res_ok' of 'jt.remove(...)' as it is undefined.
    at Object.Ft [as mono_wasm_get_dbg_command_info] (http://localhost:9400/_framework/dotnet.runtime.js:3:21915)
    at <anonymous>:1:30
    at mono_wasm_fire_debugger_agent_message_with_data_to_pause (http://localhost:9400/_framework/dotnet.runtime.js:3:20962)
    at mono_wasm_fire_debugger_agent_message_with_data (http://localhost:9400/_framework/dotnet.runtime.js:3:21033)
    at receive_debugger_agent_message (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1608]:0x6fb9c)
    at process_event (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1716]:0x770de)
    at mono_dbg_process_breakpoint_events (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1715]:0x76ac1)
    at mono_de_process_breakpoint (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1641]:0x71fa1)
    at mono_wasm_breakpoint_hit (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1605]:0x6fa13)
    at do_debugger_tramp (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[236]:0x1b7a0)

radical added a commit to radical/runtime that referenced this issue Jul 10, 2023
@radical radical removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jul 10, 2023
@radical radical assigned radical and unassigned thaystg Jul 11, 2023
@radical
Copy link
Member Author

radical commented Jul 11, 2023

symbolicated:

TypeError: Cannot destructure property 'res_ok' of 'jt.remove(...)' as it is undefined.
    at Object.Ft [as mono_wasm_get_dbg_command_info] (http://localhost:9400/_framework/dotnet.runtime.js:3:21915)
    at <anonymous>:1:30
    at mono_wasm_fire_debugger_agent_message_with_data_to_pause (http://localhost:9400/_framework/dotnet.runtime.js:3:20962)
    at mono_wasm_fire_debugger_agent_message_with_data (http://localhost:9400/_framework/dotnet.runtime.js:3:21033)
    at receive_debugger_agent_message (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1608]:0x6fb9c)
    at process_event (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1716]:0x770de)
    at mono_dbg_process_breakpoint_events (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1715]:0x76ac1)
    at mono_de_process_breakpoint (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1641]:0x71fa1)
    at mono_wasm_breakpoint_hit (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[1605]:0x6fa13)
    at do_debugger_tramp (http://localhost:9400/_framework/dotnet.native.wasm:wasm-function[236]:0x1b7a0)

This is because of

var debuggerAgentBufferTask = SendMonoCommand(sessionId, MonoCommands.GetDebuggerAgentBufferReceived(RuntimeId), token);
SaveLastDebuggerAgentBufferReceivedToContext(sessionId, debuggerAgentBufferTask);

IIUC, this is needed, and correct only for the firefox case. If so, then command should be sent only in case of mono.
If it is indeed correct in it's current location, then we should check for the result of that command.

@radical
Copy link
Member Author

radical commented Jul 11, 2023

The other issue is the exception BadImageFormatException thrown in https://github.com/dotnet/runtime/blob/main/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs#L942 .

2023-07-11T02:08:52.1908480+00:00 [DBG] DevToolsProxy-0: OnReceiveDebuggerAgentEvent failed: System.BadImageFormatException: Read out of bounds.
   at System.Reflection.Throw.OutOfBounds()
   at System.Reflection.Metadata.MemberReference.get_Parent()
   at Microsoft.WebAssembly.Diagnostics.AssemblyInfo.TryGetCustomAttributeName(CustomAttributeHandle customAttribute, MetadataReader metadataReader, String& name) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 953
   at Microsoft.WebAssembly.Diagnostics.MethodInfo..ctor(AssemblyInfo assembly, MethodDefinitionHandle methodDefHandle, Int32 token, SourceFile source, TypeInfo type, MetadataReader asmMetadataReader, MetadataReader pdbMetadataReader) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 394
   at Microsoft.WebAssembly.Diagnostics.AssemblyInfo.PopulateEnC(MonoSDBHelper sdbAgent, MetadataReader asmMetadataReaderParm, MetadataReader pdbMetadataReaderParm) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 1090
   at Microsoft.WebAssembly.Diagnostics.AssemblyInfo.EnC(MonoSDBHelper sdbAgent, Byte[] meta, Byte[] pdb) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 1000
   at Microsoft.WebAssembly.Diagnostics.DebugStore.EnC(MonoSDBHelper sdbAgent, AssemblyInfo asm, Byte[] meta_data, Byte[] pdb_data) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 1522
   at Microsoft.WebAssembly.Diagnostics.MonoProxy.ProcessEnC(SessionId sessionId, ExecutionContext context, MonoBinaryReader retDebuggerCmdReader, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 923
   at Microsoft.WebAssembly.Diagnostics.MonoProxy.OnReceiveDebuggerAgentEvent(SessionId sessionId, JObject args, Result debuggerAgentBuffer, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 1191
   at Microsoft.WebAssembly.Diagnostics.MonoProxy.OnDebuggerPaused(SessionId sessionId, JObject args, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 222

This is being called with the assembly bytes for EnC . Should it be throwing like this, or did we get some corrupted data?

@radical
Copy link
Member Author

radical commented Jul 11, 2023

cc @thaystg @lambdageek

@lewing
Copy link
Member

lewing commented Jul 11, 2023

The other issue is the exception BadImageFormatException thrown in https://github.com/dotnet/runtime/blob/main/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs#L942 .

2023-07-11T02:08:52.1908480+00:00 [DBG] DevToolsProxy-0: OnReceiveDebuggerAgentEvent failed: System.BadImageFormatException: Read out of bounds.
   at System.Reflection.Throw.OutOfBounds()
   at System.Reflection.Metadata.MemberReference.get_Parent()
   at Microsoft.WebAssembly.Diagnostics.AssemblyInfo.TryGetCustomAttributeName(CustomAttributeHandle customAttribute, MetadataReader metadataReader, String& name) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 953
   at Microsoft.WebAssembly.Diagnostics.MethodInfo..ctor(AssemblyInfo assembly, MethodDefinitionHandle methodDefHandle, Int32 token, SourceFile source, TypeInfo type, MetadataReader asmMetadataReader, MetadataReader pdbMetadataReader) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 394
   at Microsoft.WebAssembly.Diagnostics.AssemblyInfo.PopulateEnC(MonoSDBHelper sdbAgent, MetadataReader asmMetadataReaderParm, MetadataReader pdbMetadataReaderParm) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 1090
   at Microsoft.WebAssembly.Diagnostics.AssemblyInfo.EnC(MonoSDBHelper sdbAgent, Byte[] meta, Byte[] pdb) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 1000
   at Microsoft.WebAssembly.Diagnostics.DebugStore.EnC(MonoSDBHelper sdbAgent, AssemblyInfo asm, Byte[] meta_data, Byte[] pdb_data) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs:line 1522
   at Microsoft.WebAssembly.Diagnostics.MonoProxy.ProcessEnC(SessionId sessionId, ExecutionContext context, MonoBinaryReader retDebuggerCmdReader, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 923
   at Microsoft.WebAssembly.Diagnostics.MonoProxy.OnReceiveDebuggerAgentEvent(SessionId sessionId, JObject args, Result debuggerAgentBuffer, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 1191
   at Microsoft.WebAssembly.Diagnostics.MonoProxy.OnDebuggerPaused(SessionId sessionId, JObject args, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 222

This is being called with the assembly bytes for EnC . Should it be throwing like this, or did we get some corrupted data?

this should be trapped with the hotreload pr

@lewing lewing assigned thaystg and unassigned radical Jul 11, 2023
@thaystg
Copy link
Member

thaystg commented Jul 11, 2023

This is fixed in this PR:
#88635

We were trying to set a breakpoint in an invalid IL because the symbols weren't update on browserdebugproxy side because of that exception while reading custom attributes.

@radical
Copy link
Member Author

radical commented Jul 11, 2023

This is fixed in this PR:
#88635

True. But I was asking about the underlying exception.

@thaystg
Copy link
Member

thaystg commented Jul 11, 2023

This is fixed in this PR:
#88635

True. But I was asking about the underlying exception.

I understood, I will answer you tomorrow morning. :)

@thaystg
Copy link
Member

thaystg commented Jul 11, 2023

Answer: #88685

@lewing lewing closed this as completed Jul 24, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Debugger-mono Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
Development

No branches or pull requests

4 participants