Skip to content

WebSocketSharp unit test failure due to StackOverflow #91

@yallie

Description

@yallie

Describe the bug
WebSocketSharp channel unit tests occasionally fail due to stack overflows (quite rare actually).

To Reproduce
Run WebSocketSharp unit tests until they fail. Not guaranteed!

Expected behavior
The unit tests should not produce stack overflow.

Additional notes

========== Starting test run ==========
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.5.1.1+5fe7eebc65 (64-bit .NET 6.0.36)
[xUnit.net 00:00:00.08]   Starting:    CoreRemoting.Tests
Stack overflow.
   at WebSocketSharp.WebSocketFrame.readExtendedPayloadLengthAsync(System.IO.Stream, WebSocketSharp.WebSocketFrame, System.Action`1<WebSocketSharp.WebSocketFrame>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.WebSocket+<>c__DisplayClass170_0.<startReceiving>b__1(WebSocketSharp.WebSocketFrame)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.WebSocket+<>c__DisplayClass170_0.<startReceiving>b__1(WebSocketSharp.WebSocketFrame)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.WebSocket+<>c__DisplayClass170_0.<startReceiving>b__1(WebSocketSharp.WebSocketFrame)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.WebSocket+<>c__DisplayClass170_0.<startReceiving>b__1(WebSocketSharp.WebSocketFrame)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.WebSocket+<>c__DisplayClass170_0.<startReceiving>b__1(WebSocketSharp.WebSocketFrame)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.WebSocket+<>c__DisplayClass170_0.<startReceiving>b__1(WebSocketSharp.WebSocketFrame)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.Ext+<>c__DisplayClass58_0.<ReadBytesAsync>b__0(System.IAsyncResult)
   at System.Threading.Tasks.TaskToApm+TaskAsyncResult..ctor(System.Threading.Tasks.Task, System.Object, System.AsyncCallback)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[], Int32, Int32, System.AsyncCallback, System.Object)
   at WebSocketSharp.Ext.ReadBytesAsync(System.IO.Stream, Int32, System.Action`1<Byte[]>, System.Action`1<System.Exception>)
   at WebSocketSharp.WebSocket+<>c__DisplayClass170_0.<startReceiving>b__1(WebSocketSharp.WebSocketFrame)
...
(dosens of pages of the same call stack frames omitted)

PS. Disabled WebSocketSharp tests for now (this channel is going to be superseded by new HttpListener-based websocket channel) — see commit f8abb35.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions