sta / sta/websocket-sharp

Crash-on-connect with latest versions of both Chrome and Firefox

Open
#158 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Using the git head version of websocket-sharp running on Mono 4.1, attempting to connect with Chrome 45 or Firefox 40 crashes the server with:

9/13/2015 11:54:49 AM|Fatal|WebSocket.processException|System.IO.IOException: Internal error (no progress possible) ReadInternal
                          at System.IO.Compression.DeflateStreamNative.CheckResult (Int32 result, System.String where) [0x000a5] in /home/jbabcock/src/mono/mcs/class/System/System.IO.Compression/DeflateStream.cs:475
                          at System.IO.Compression.DeflateStreamNative.ReadZStream (IntPtr buffer, Int32 length) [0x0000e] in /home/jbabcock/src/mono/mcs/class/System/System.IO.Compression/DeflateStream.cs:373
                          at System.IO.Compression.DeflateStream.ReadInternal (System.Byte[] array, Int32 offset, Int32 count) [0x0002f] in /home/jbabcock/src/mono/mcs/class/System/System.IO.Compression/DeflateStream.cs:123
                          at System.IO.Compression.DeflateStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00086] in /home/jbabcock/src/mono/mcs/class/System/System.IO.Compression/DeflateStream.cs:143
                          at System.IO.Stream.InternalCopyTo (System.IO.Stream destination, Int32 bufferSize) [0x00015] in /home/jbabcock/src/mono/external/referencesource/mscorlib/system/io/stream.cs:227
                          at System.IO.Stream.CopyTo (System.IO.Stream destination) [0x00099] in /home/jbabcock/src/mono/external/referencesource/mscorlib/system/io/stream.cs:195
                          at (wrapper remoting-invoke-with-check) System.IO.Stream:CopyTo (System.IO.Stream)
                          at WebSocketSharp.Ext.decompress (System.IO.Stream stream) [0x0002f] in /home/jbabcock/repositories/ncl/lib/websocket-sharp/websocket-sharp/Ext.cs:128
                          at WebSocketSharp.Ext.decompressToArray (System.IO.Stream stream) [0x00002] in /home/jbabcock/repositories/ncl/lib/websocket-sharp/websocket-sharp/Ext.cs:137
                          at WebSocketSharp.Ext.decompress (System.Byte[] data) [0x0001d] in /home/jbabcock/repositories/ncl/lib/websocket-sharp/websocket-sharp/Ext.cs:117
                          at WebSocketSharp.Ext.Decompress (System.Byte[] data, CompressionMethod method) [0x00009] in /home/jbabcock/repositories/ncl/lib/websocket-sharp/websocketsharp/Ext.cs:373
                          at WebSocketSharp.WebSocket.processDataFrame (WebSocketSharp.WebSocketFrame frame) [0x00024] in /home/jbabcock/repositories/ncl/lib/websocket-sharp/websocket-sharp/WebSocket.cs:1008
                          at WebSocketSharp.WebSocket.processReceivedFrame (WebSocketSharp.WebSocketFrame frame) [0x0004c] in /home/jbabcock/repositories/ncl/lib/websocket-sharp/websocket-sharp/WebSocket.cs:1096
                          at WebSocketSharp.WebSocket+<startReceiving>c__AnonStorey3.<>m__1 (WebSocketSharp.WebSocketFrame frame) [0x00008] in /home/jbabcock/repositories/ncl/lib/websocket-sharp/websocket-sharp/WebSocket.cs:1470
                          at WebSocketSharp.WebSocketFrame+<ReadAsync>c__AnonStorey3.<>m__0 (System.Byte[] header) [0x0003a] in /home/jbabcock/repositories/ncl/lib/websocketsharp/websocket-sharp/WebSocketFrame.cs:568
                          at WebSocketSharp.Ext+<ReadBytesAsync>c__AnonStorey3.<>m__0 (IAsyncResult ar) [0x0007b] in /home/jbabcock/repositories/ncl/lib/websocket-sharp/websocketsharp/Ext.cs:655

Setting WebSocketBehavior.IgnoreExtensions=true seems to prevent the error, but (I presume) at the expense of not having compression.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the connection with websocket-sharp on Mono 4.1 using Chrome 45 or Firefox 40, then compare it with WebSocketBehavior.IgnoreExtensions=true. Start in Ext.cs around decompression and trace the calls through WebSocket.cs and WebSocketFrame.cs. Done means the server no longer crashes during the connection while the reported extension behavior is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.