From 5266d23df3e92edadbea9fcaeb5509152033cc16 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 2 Aug 2023 21:18:31 -0400 Subject: [PATCH 1/2] [wasm] runtime: Fix creating the stack trace for a ManagedError With the latest chrome (`115.*`) the following code in `runtime/marshal.ts` fails because `this.superStack.value` is no longer available: ```js getSuperStack() { if (this.superStack) { return this.superStack.value; } return super.stack; // this works on FF } ``` This causes the final error to not have the original managed error message, and also have a `"undefined"` at the end of the string. Truncated error missing the native part of the stack, and the message: ``` at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.ThrowFromJSExport(String message) at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.__Wrapper_ThrowFromJSExport_271731536(JSMarshalerArgument* __arguments_buffer) undefined ``` With the fix: ``` at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.ThrowFromJSExport(String message) at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.__Wrapper_ThrowFromJSExport_817705034(JSMarshalerArgument* __arguments_buffer) Error: -t-e-s-t- at sr (http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:33284) at Br (http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:42679) at http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:40825 at Module.catch1stack (http://127.0.0.1:60345/JavaScriptTestHelper.mjs:132:9) at http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:36627 at mr (http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:37821) at do_icall (http://127.0.0.1:60345/_framework/dotnet.native.wasm:wasm-function[221]:0x19711) at do_icall_wrapper (http://127.0.0.1:60345/_framework/dotnet.native.wasm:wasm-function[108]:0x157bc) at mono_interp_exec_method (http://127.0.0.1:60345/_framework/dotnet.native.wasm:wasm-function[101]:0x9c92) at interp_runtime_invoke (http://127.0.0.1:60345/_framework/dotnet.native.wasm:wasm-function[141]:0x16cd7) ``` Thanks to @kg for the fix. (cherry picked from commit 89f6429fcf8a065971dd1a0646c4a8b98d0d2116) --- src/mono/wasm/runtime/marshal.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/runtime/marshal.ts b/src/mono/wasm/runtime/marshal.ts index c03ef13aea778c..380abf5f385599 100644 --- a/src/mono/wasm/runtime/marshal.ts +++ b/src/mono/wasm/runtime/marshal.ts @@ -327,7 +327,10 @@ export class ManagedError extends Error implements IDisposable { getSuperStack() { if (this.superStack) { - return this.superStack.value; + if (this.superStack.value !== undefined) + return this.superStack.value; + if (this.superStack.get !== undefined) + return this.superStack.get.call(this); } return super.stack; // this works on FF } From 0360142a73ff832ff925dd139fc3e5651847d379 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 2 Aug 2023 22:12:11 -0400 Subject: [PATCH 2/2] [wasm] Bump chrome used for testing to 115.0.5790.171 --- eng/testing/ProvisioningVersions.props | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/eng/testing/ProvisioningVersions.props b/eng/testing/ProvisioningVersions.props index 63fc5a13c7e77c..2c46975d7660af 100644 --- a/eng/testing/ProvisioningVersions.props +++ b/eng/testing/ProvisioningVersions.props @@ -9,9 +9,10 @@ the same snapshot might not be available in both of them. --> - 972765 - https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chrome-linux.zip - https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chromedriver_linux64.zip + 1148114 + + https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1148123/chrome-linux.zip + https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1148123/chromedriver_linux64.zip chrome-linux chromedriver_linux64 chrome @@ -21,9 +22,10 @@ - 972766 - https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/$(ChromiumRevision)/chrome-win.zip - https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/$(ChromiumRevision)/chromedriver_win32.zip + 1148114 + + https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1148119/chrome-win.zip + https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1148119/chromedriver_win32.zip chrome-win chromedriver_win32 chrome.exe