Skip to content

[wasm-mt] WasmTestOnBrowser-System.Net.WebSockets.Client.Tests fails #74413

Closed

Description

@simonrozsival

There are 123 failing tests in WasmTestOnBrowser-System.Net.WebSockets.Client.Tests when multi-threading is enabled.

  • 42 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 'decode' on 'TextDecoder': 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.WebSockets.Client.Tests.CloseTest.CloseOutputAsync_ClientInitiated_CanReceive_CanClose(Uri server)
    --- 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 jc (http://127.0.0.1:42359/dotnet.js:5:96779)
        at Object.Oc [as ws_wasm_send] (http://127.0.0.1:42359/dotnet.js:5:93626)
        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:42359/dotnet.js:5:58079)
        at _mono_wasm_invoke_bound_function (http://127.0.0.1:42359/dotnet.js:14:121580)
        at do_icall (http://127.0.0.1:42359/dotnet.wasm:wasm-function[374]:0x27df1)
        at do_icall_wrapper (http://127.0.0.1:42359/dotnet.wasm:wasm-function[342]:0x2728f)
        at interp_exec_method (http://127.0.0.1:42359/dotnet.wasm:wasm-function[282]:0x1893e)
        at interp_entry (http://127.0.0.1:42359/dotnet.wasm:wasm-function[328]:0x26c8b)
        at interp_entry_static_0 (http://127.0.0.1:42359/dotnet.wasm:wasm-function[401]:0x2895e)
    
  • 39 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.WebSockets.Client.Tests.SendReceiveTest.SendReceive_VaryingLengthBuffers_Success(Uri server)
    --- 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:42359/dotnet.js:5:95034)
        at Object.Oc [as ws_wasm_send] (http://127.0.0.1:42359/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:42359/dotnet.js:5:58079)
        at _mono_wasm_invoke_bound_function (http://127.0.0.1:42359/dotnet.js:14:121580)
        at do_icall (http://127.0.0.1:42359/dotnet.wasm:wasm-function[374]:0x27df1)
        at do_icall_wrapper (http://127.0.0.1:42359/dotnet.wasm:wasm-function[342]:0x2728f)
        at interp_exec_method (http://127.0.0.1:42359/dotnet.wasm:wasm-function[282]:0x1893e)
        at interp_entry (http://127.0.0.1:42359/dotnet.wasm:wasm-function[328]:0x26c8b)
        at interp_entry_static_0 (http://127.0.0.1:42359/dotnet.wasm:wasm-function[401]:0x2895e)
    
  • 42 tests fail with:
    Actual WebSocketErrorCode NativeError when System.Net.WebSockets.WebSocketException (0x80004005): An internal WebSocket error occurred. Please see the innerException, if present, for more details. 
    ---> TypeError: Failed to execute 'decode' on 'TextDecoder': 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.WebSockets.Client.Tests.CancelTest.<>c.<<CloseOutputAsync_Cancel_Success>b__5_0>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.Net.WebSockets.Client.Tests.ClientWebSocketTestBase.TestCancellation(Func`2 action, Uri server)
    Expected: True
    Actual:   False
    at System.Net.WebSockets.Client.Tests.ClientWebSocketTestBase.TestCancellation(Func`2 action, Uri server)
    at System.Net.WebSockets.Client.Tests.CancelTest.CloseOutputAsync_Cancel_Success(Uri server)
    --- End of stack trace from previous location ---
    

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

Activity

  1. ghost added
    untriaged
    on Aug 23, 2022
  2. added
    arch-wasm
    and removed
    untriaged
    on Aug 23, 2022
  3. added this to the 8.0.0 milestone on Aug 23, 2022
  4. lambdageek commented on Aug 23, 2022

    @lambdageek
    Member

    We had a similar Failed to execute 'decode' on 'TextDecoder': The provided ArrayBufferView value must not be shared. with some crypto APIs. you end up having to make a JS wrapper that duplicates the data into a private buffer.

  5. added
    disabled-test
    on Sep 8, 2022
  6. carlossanlop commented on Oct 5, 2022

    @carlossanlop
    Contributor

    I am seeing a very similar error message:

    Failed to execute 'send' on 'WebSocket': The provided ArrayBufferView value must not be shared.
    

    Example callstack:

    [21:32:50] fail: [FAIL] System.Net.WebSockets.Client.Tests.InvokerConnectTest.EchoTextMessage_Success(server: ws://127.0.0.1:33775/WebSocket/EchoWebSocket.ashx)
    [21:32:50] info: System.Net.WebSockets.WebSocketException : An internal WebSocket error occurred. Please see the innerException, if present, for more details. 
    [21:32:50] info: ---- System.Runtime.InteropServices.JavaScript.JSException : TypeError: Failed to execute 'decode' on 'TextDecoder': The provided ArrayBufferView value must not be shared.
    [21:32:50] info:    at System.Net.WebSockets.BrowserWebSocket.SendAsyncCore(ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken)
    [21:32:50] info:    at System.Net.WebSockets.Client.Tests.WebSocketHelper.TestEcho(Uri server, WebSocketMessageType type, Int32 timeOutMilliseconds, ITestOutputHelper output, HttpMessageInvoker invoker)
    [21:32:50] info:    at System.Net.WebSockets.Client.Tests.ConnectTest.EchoTextMessage_Success(Uri server)
    [21:32:50] info: --- End of stack trace from previous location ---
    [21:32:50] info: ----- Inner Stack Trace -----
    [21:32:50] info:    at System.Net.WebSockets.BrowserInterop.WebSocketSend(JSObject webSocket, IntPtr bufferPtr, Int32 bufferLength, Int32 messageType, Boolean endOfMessage)
    [21:32:50] info:    at System.Net.WebSockets.BrowserInterop.UnsafeSendSync(JSObject jsWs, ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage)
    [21:32:50] info:    at System.Net.WebSockets.BrowserWebSocket.SendAsyncCore(ArraySegment`1 buffer, WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken cancellationToken)
    [21:32:50] info:     at $c (http://127.0.0.1:33775/dotnet.js:5:97364)
    [21:32:50] info:     at Object.Oc [as ws_wasm_send] (http://127.0.0.1:33775/dotnet.js:5:94211)
    [21:32:50] info:     at _bound_js_INTERNAL_ws_wasm_send (https://dotnet.generated.invalid/_bound_js_INTERNAL_ws_wasm_send:11:21)
    [21:32:50] info:     at Object.li (http://127.0.0.1:33775/dotnet.js:5:58352)
    [21:32:50] info:     at _mono_wasm_invoke_bound_function (http://127.0.0.1:33775/dotnet.js:14:121580)
    [21:32:50] info:     at do_icall (http://127.0.0.1:33775/dotnet.wasm:wasm-function[339]:0x226a1)
    [21:32:50] info:     at do_icall_wrapper (http://127.0.0.1:33775/dotnet.wasm:wasm-function[307]:0x21b3f)
    [21:32:50] info:     at interp_exec_method (http://127.0.0.1:33775/dotnet.wasm:wasm-function[243]:0x131c2)
    [21:32:50] info:     at interp_entry (http://127.0.0.1:33775/dotnet.wasm:wasm-function[291]:0x2151f)
    [21:32:50] info:     at interp_entry_static_0 (http://127.0.0.1:33775/dotnet.wasm:wasm-function[366]:0x2320e)
    
  7. lambdageek commented on Oct 5, 2022

    @lambdageek
    Member

    I am seeing a very similar error message:

    That's kind of unexpected, we shouldn't be using a shared array buffer on single-threaded wasm.

    @lewing I think we may need a separate issue

  8. pavelsavara commented on Jul 12, 2023

    @pavelsavara
    Member

    I am seeing a very similar error message:

    That's kind of unexpected, we shouldn't be using a shared array buffer on single-threaded wasm.

    This log is MT build.

  9. pavelsavara commented on Jul 12, 2023

    @pavelsavara
    Member

    This is now fixed.

    image

  10. ghost locked as resolved and limited conversation to collaborators on Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmarea-System.Netdisabled-test

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions