kashiwazakinenji / chromedevtools

Automatically exported from code.google.com/p/chromedevtools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

UTF8 in script content causes read error in SocketConnection #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Chromium reports a byte count for Content-Length in all communication coming 
from the browser, but SocketConnection treats the count as a character count. 
This causes the ConnectionLogger.LoggableReader.read to read into the next 
header if there is any utf8 characters in the content. The result is invalid 
JSON for this message, and an invalid destination for the next message because 
the next header is incorrect.

To duplicate, put the following into your JavaScript, and then debug.
// “”

There are 5 characters in the string. Chromium will report that there are 9 (3 
for: "// " + six for: e2 80 9c e2 80 9d)

The read will then read 9 chacters, which causes the read to continue into the 
next message header.

This does not fail on Windows, because the content gets converted into the 
following:
// \u201\u201d

I have not researched where in the communication layer this happens on the 
Chromium side.

The fix is either to:
1. SocketConnection and clients need to read bytes and then convert to 
characters after all content is read. Knowing that this really isn't needed for 
the Windows version.
or
2. Chromium on Macintosh needs to escape the script content as is done on 
Windows.

Original issue reported on code.google.com by the.john...@gmail.com on 12 Nov 2010 at 10:57

GoogleCodeExporter commented 8 years ago
Google Chrome version: 7.0.530.0 (I have verified that a build from 11/11/2010 
also fails with same error.)
ChromeDevTools: just prior to 0.1.6
OS + version: Mac OS X Snow Leopard

Original comment by the.john...@gmail.com on 12 Nov 2010 at 11:02

GoogleCodeExporter commented 8 years ago

Original comment by peter.ry...@gmail.com on 17 Nov 2010 at 3:50

GoogleCodeExporter commented 8 years ago
Probably it's related to this:
http://code.google.com/p/v8/issues/detail?id=855

Original comment by peter.ry...@gmail.com on 20 Nov 2010 at 7:48

GoogleCodeExporter commented 8 years ago
The problem is probably not platform-specific. Linux beta release "8.0.552.200 
beta" has the similar problem.
Chromium has it in dev builds since 58916 (when V8 2.4.2 (r5425) was adopted).

Original comment by peter.ry...@gmail.com on 20 Nov 2010 at 8:08

GoogleCodeExporter commented 8 years ago

Original comment by peter.ry...@gmail.com on 20 Nov 2010 at 8:09

GoogleCodeExporter commented 8 years ago
More accurate edge revision is 58796, probably corresponds to 7.0.511.4.

Original comment by peter.ry...@gmail.com on 30 Nov 2010 at 11:47

GoogleCodeExporter commented 8 years ago
Fixed in 0.2.0 release

Original comment by peter.ry...@gmail.com on 22 Jan 2011 at 12:08