You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/10/07 18:36:31 UTC

[Bug 55638] New: [websocket] Tomcat corrupts binary websocket messages when using the NIO connector

https://issues.apache.org/bugzilla/show_bug.cgi?id=55638

            Bug ID: 55638
           Summary: [websocket] Tomcat corrupts binary websocket messages
                    when using the NIO connector
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebSocket
          Assignee: dev@tomcat.apache.org
          Reporter: kpreisser@apache.org

Created attachment 30907
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30907&action=edit
Test case

When writing a binary websocket message with about 25 KB, the client will get
corrupted data starting on Offset 0x2000 when running Tomcat with the NIO
connector.


To reproduce:

1) Checkout current trunk (r1529816) and apply the attached patch locally. This
will modify the Echo example so that the JavaScript sends a Base64-encoded
String to Tomcat, and Tomcat will decode it as byte[] array and send it back
using a binary websocket message. The JavaScript will then compare each byte
and report if differences are found.

2) Start Tomcat using the NIO connector on 64-Bit Windows with a 64-bit JVM.

3) Open the Echo example (http://localhost:8080/examples/websocket/echo.xhtml)
with Firefox or Chrome.

4) The page will print lines such as the following:
Offset 0x2000: Excepted [0x80] but got [0x89]
Offset 0x2001: Excepted [0xE4] but got [0x50]
Offset 0x2002: Excepted [0x69] but got [0x4E]
Offset 0x2003: Excepted [0xDD] but got [0x47]
Offset 0x2004: Excepted [0x8F] but got [0x0D]
Offset 0x2005: Excepted [0x9A] but got [0x0A]
[...]

This indicates that there were differences between the sent and the received
message.


5) If you try this with the APR connector, the page will print: "No errors
found."
so with APR the problems don't occur.

If you try this with the BIO connector (and repeatedly press F5 in Firefox),
the page will sometimes print "No errors found", but sometimes it will print
nothing as then Tomcat did not call the EchoAnnotation#echoMessage method.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55638] [websocket] Tomcat corrupts binary websocket messages when using the NIO connector

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55638

Konstantin Preißer <kp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30907|0                           |1
           is patch|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55638] [websocket] Tomcat corrupts binary websocket messages when using the NIO connector

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55638

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
All fixed in trunk. Need to test a little more before back-porting.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55638] [websocket] Tomcat corrupts binary websocket messages when using the NIO connector

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55638

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Autobahn tests pass. CI system looks OK. Changes have been back-ported to 7.0.x

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org