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-mt] WasmTestOnBrowser-System.Net.Http.Functional.Tests fail #74411

Closed
simonrozsival opened this issue Aug 23, 2022 · 3 comments
Closed
Assignees
Labels
arch-wasm WebAssembly architecture area-System.Net disabled-test The test is disabled in source code against the issue
Milestone

Comments

@simonrozsival
Copy link
Member

There are 287 failing tests in WasmTestOnBrowser-System.Net.Http.Functional.Tests when multi-threading is enabled:

  • 82 tests fail with the following exception stack trace:
    System.Net.WebSockets.WebSocketException : An internal WebSocket error occurred. Please see the innerException, if present, for more details. 
    ---- System.Runtime.InteropServices.JavaScript.JSException : TypeError: Failed to execute 'send' on 'WebSocket': The provided ArrayBufferView value must not be shared.
       at System.Net.WebSockets.BrowserWebSocket.SendAsyncCore(ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken)
       at System.Net.Test.Common.LoopbackServer.ListenAsync()
       at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options)
       at System.Net.Http.Functional.Tests.HttpRequestMessageTest.HttpRequest_BodylessMethod_NoContentLength(String method)
    --- End of stack trace from previous location ---
    ----- Inner Stack Trace -----
       at System.Net.WebSockets.BrowserInterop.WebSocketSend(JSObject webSocket, IntPtr bufferPtr, Int32 bufferLength, Int32 messageType, Boolean endOfMessage)
       at System.Net.WebSockets.BrowserInterop.UnsafeSendSync(JSObject jsWs, ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage)
       at System.Net.WebSockets.BrowserWebSocket.SendAsyncCore(ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken)
        at Tc (http://127.0.0.1:33027/dotnet.js:5:95034)
        at Object.Oc [as ws_wasm_send] (http://127.0.0.1:33027/dotnet.js:5:93684)
        at _bound_js_INTERNAL_ws_wasm_send (https://dotnet.generated.invalid/_bound_js_INTERNAL_ws_wasm_send:11:21)
        at Object.li (http://127.0.0.1:33027/dotnet.js:5:58079)
        at _mono_wasm_invoke_bound_function (http://127.0.0.1:33027/dotnet.js:14:121580)
        at do_icall (http://127.0.0.1:33027/dotnet.wasm:wasm-function[374]:0x27df1)
        at do_icall_wrapper (http://127.0.0.1:33027/dotnet.wasm:wasm-function[342]:0x2728f)
        at interp_exec_method (http://127.0.0.1:33027/dotnet.wasm:wasm-function[282]:0x1893e)
        at interp_entry (http://127.0.0.1:33027/dotnet.wasm:wasm-function[328]:0x26c8b)
        at interp_entry_static_0 (http://127.0.0.1:33027/dotnet.wasm:wasm-function[401]:0x2895e)
    
  • 205 tests fail with the following stack trace:
    System.Runtime.InteropServices.JavaScript.JSException : Error: Assert failed: Unknow converter for type 13 at 2 
        at ho (http://127.0.0.1:33027/dotnet.js:5:35222)
        at Object.ui (http://127.0.0.1:33027/dotnet.js:5:57096)
        at _mono_wasm_bind_js_function (http://127.0.0.1:33027/dotnet.js:14:120525)
        at do_icall (http://127.0.0.1:33027/dotnet.wasm:wasm-function[374]:0x27ee5)
        at do_icall_wrapper (http://127.0.0.1:33027/dotnet.wasm:wasm-function[342]:0x2728f)
        at interp_exec_method (http://127.0.0.1:33027/dotnet.wasm:wasm-function[282]:0x1893e)
        at interp_runtime_invoke (http://127.0.0.1:33027/dotnet.wasm:wasm-function[281]:0x177ee)
        at mono_jit_runtime_invoke (http://127.0.0.1:33027/dotnet.wasm:wasm-function[8284]:0x1affd0)
        at do_runtime_invoke (http://127.0.0.1:33027/dotnet.wasm:wasm-function[2136]:0x91c4d)
        at mono_runtime_invoke_checked (http://127.0.0.1:33027/dotnet.wasm:wasm-function[2134]:0x91bc3)
       at System.Runtime.InteropServices.JavaScript.JSFunctionBinding.BindJSFunctionImpl(String functionName, String moduleName, ReadOnlySpan`1 signatures)
       at System.Runtime.InteropServices.JavaScript.JSFunctionBinding.BindJSFunction(String functionName, String moduleName, ReadOnlySpan`1 signatures)
       at System.Net.Http.BrowserHttpInterop.AbortResponse(JSObject fetchResponse)
       at System.Net.Http.WasmFetchResponse.Dispose()
       at System.Net.Http.BrowserHttpContent.Dispose(Boolean disposing)
       at System.Net.Http.HttpContent.Dispose()
       at System.Net.Http.HttpResponseMessage.Dispose(Boolean disposing)
       at System.Net.Http.HttpResponseMessage.Dispose()
       at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
       at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
       at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Headers.SendAsync_GetWithValidHostHeader_Success(Boolean withPort)
    

Full console log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-74342-merge-b05c5a1bd5ab47119e/WasmTestOnBrowser-System.Net.Http.Functional.Tests/1/console.902416a0.log?helixlogtype=result

@simonrozsival simonrozsival added the arch-wasm WebAssembly architecture label Aug 23, 2022
@simonrozsival simonrozsival added this to the 8.0.0 milestone Aug 23, 2022
@ghost
Copy link

ghost commented Aug 23, 2022

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

Issue Details

There are 287 failing tests in WasmTestOnBrowser-System.Net.Http.Functional.Tests when multi-threading is enabled:

  • 82 tests fail with the following exception stack trace:
    System.Net.WebSockets.WebSocketException : An internal WebSocket error occurred. Please see the innerException, if present, for more details. 
    ---- System.Runtime.InteropServices.JavaScript.JSException : TypeError: Failed to execute 'send' on 'WebSocket': The provided ArrayBufferView value must not be shared.
       at System.Net.WebSockets.BrowserWebSocket.SendAsyncCore(ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken)
       at System.Net.Test.Common.LoopbackServer.ListenAsync()
       at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options)
       at System.Net.Http.Functional.Tests.HttpRequestMessageTest.HttpRequest_BodylessMethod_NoContentLength(String method)
    --- End of stack trace from previous location ---
    ----- Inner Stack Trace -----
       at System.Net.WebSockets.BrowserInterop.WebSocketSend(JSObject webSocket, IntPtr bufferPtr, Int32 bufferLength, Int32 messageType, Boolean endOfMessage)
       at System.Net.WebSockets.BrowserInterop.UnsafeSendSync(JSObject jsWs, ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage)
       at System.Net.WebSockets.BrowserWebSocket.SendAsyncCore(ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken)
        at Tc (http://127.0.0.1:33027/dotnet.js:5:95034)
        at Object.Oc [as ws_wasm_send] (http://127.0.0.1:33027/dotnet.js:5:93684)
        at _bound_js_INTERNAL_ws_wasm_send (https://dotnet.generated.invalid/_bound_js_INTERNAL_ws_wasm_send:11:21)
        at Object.li (http://127.0.0.1:33027/dotnet.js:5:58079)
        at _mono_wasm_invoke_bound_function (http://127.0.0.1:33027/dotnet.js:14:121580)
        at do_icall (http://127.0.0.1:33027/dotnet.wasm:wasm-function[374]:0x27df1)
        at do_icall_wrapper (http://127.0.0.1:33027/dotnet.wasm:wasm-function[342]:0x2728f)
        at interp_exec_method (http://127.0.0.1:33027/dotnet.wasm:wasm-function[282]:0x1893e)
        at interp_entry (http://127.0.0.1:33027/dotnet.wasm:wasm-function[328]:0x26c8b)
        at interp_entry_static_0 (http://127.0.0.1:33027/dotnet.wasm:wasm-function[401]:0x2895e)
    
  • 205 tests fail with the following stack trace:
    System.Runtime.InteropServices.JavaScript.JSException : Error: Assert failed: Unknow converter for type 13 at 2 
        at ho (http://127.0.0.1:33027/dotnet.js:5:35222)
        at Object.ui (http://127.0.0.1:33027/dotnet.js:5:57096)
        at _mono_wasm_bind_js_function (http://127.0.0.1:33027/dotnet.js:14:120525)
        at do_icall (http://127.0.0.1:33027/dotnet.wasm:wasm-function[374]:0x27ee5)
        at do_icall_wrapper (http://127.0.0.1:33027/dotnet.wasm:wasm-function[342]:0x2728f)
        at interp_exec_method (http://127.0.0.1:33027/dotnet.wasm:wasm-function[282]:0x1893e)
        at interp_runtime_invoke (http://127.0.0.1:33027/dotnet.wasm:wasm-function[281]:0x177ee)
        at mono_jit_runtime_invoke (http://127.0.0.1:33027/dotnet.wasm:wasm-function[8284]:0x1affd0)
        at do_runtime_invoke (http://127.0.0.1:33027/dotnet.wasm:wasm-function[2136]:0x91c4d)
        at mono_runtime_invoke_checked (http://127.0.0.1:33027/dotnet.wasm:wasm-function[2134]:0x91bc3)
       at System.Runtime.InteropServices.JavaScript.JSFunctionBinding.BindJSFunctionImpl(String functionName, String moduleName, ReadOnlySpan`1 signatures)
       at System.Runtime.InteropServices.JavaScript.JSFunctionBinding.BindJSFunction(String functionName, String moduleName, ReadOnlySpan`1 signatures)
       at System.Net.Http.BrowserHttpInterop.AbortResponse(JSObject fetchResponse)
       at System.Net.Http.WasmFetchResponse.Dispose()
       at System.Net.Http.BrowserHttpContent.Dispose(Boolean disposing)
       at System.Net.Http.HttpContent.Dispose()
       at System.Net.Http.HttpResponseMessage.Dispose(Boolean disposing)
       at System.Net.Http.HttpResponseMessage.Dispose()
       at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
       at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
       at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Headers.SendAsync_GetWithValidHostHeader_Success(Boolean withPort)
    

Full console log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-74342-merge-b05c5a1bd5ab47119e/WasmTestOnBrowser-System.Net.Http.Functional.Tests/1/console.902416a0.log?helixlogtype=result

Author: simonrozsival
Assignees: -
Labels:

arch-wasm

Milestone: 8.0.0

@lambdageek
Copy link
Member

Similar to #74413 (comment) we need to make a copy of the buffer before calling send on it

@pavelsavara
Copy link
Member

this is now fixed

image

@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Net disabled-test The test is disabled in source code against the issue
Projects
None yet
Development

No branches or pull requests

3 participants