Last Comment Bug 719127 - Debugger error: jschar out of char range; high bits of data lost
: Debugger error: jschar out of char range; high bits of data lost
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Developer Tools: Debugger (show other bugs)
: Trunk
: All All
: P2 normal (vote)
: Firefox 13
Assigned To: Dave Camp (:dcamp)
:
: James Long (:jlongster)
Mentors:
: 726152 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-18 09:54 PST by Panos Astithas [:past]
Modified: 2012-02-15 02:21 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
properly encode before sending across the wire (2.96 KB, patch)
2012-02-10 15:34 PST, Dave Camp (:dcamp)
past: review+
rcampbell: feedback+
Details | Diff | Splinter Review

Description Panos Astithas [:past] 2012-01-18 09:54:06 PST
STR:

1) Visit http://www.mozilla.org/en-US/firefox/dl
2) Open the Script Debugger.

Because of the em dash (or en dash) character in the page title, the following errors appear in the console (stdout):

DBG-SERVER: Got: {
  "from": "root",
  "applicationType": "browser",
  "traits": []
}
DBG-SERVER: Got: {
  "to": "root",
  "type": "listTabs"
}
WARNING: jschar out of char range; high bits of data lost: 0x2014: file /Users/past/src/remote-debug/js/xpconnect/src/XPCConvert.cpp, line 426
DBG-SERVER: Error parsing incoming packet: {
  "from": "root",
  "selected": 2,
  "tabs": [
    {
      "actor": "conn0.tab2",
      "title": "Debugger test page",
      "url": "http://htmlpad.org/debugger/"
    },
    {
      "actor": "conn0.tab3",
      "title": "Spellchecker",
      "url": "http://astithas.com/speller/"
    },
    {
      "actor": "conn0.tab4",
      "title": "Mozilla Firefox Web Browser  Free Download",
      "url": "http://www.mozilla.org/en-US/firefox/dl"
    }
  ]
} (SyntaxError: JSON.parse: bad control character in string literal - DT_processIncoming()@chrome://global/content/devtools/dbg-transport.js:162
DT_onDataAvailable([object XPCWrappedNative_NoHelper],null,[object XPCWrappedNative_NoHelper],71,456)@chrome://global/content/devtools/dbg-transport.js:128
)
Comment 1 Rob Campbell [:rc] (:robcee) 2012-01-20 13:47:07 PST
JSON.parse strikes again!
Comment 2 Dave Camp (:dcamp) 2012-02-10 15:34:53 PST
Created attachment 596196 [details] [diff] [review]
properly encode before sending across the wire

Not json.parse, just bad use of streaming APIs.  I should know better.
Comment 3 Dave Camp (:dcamp) 2012-02-10 15:35:19 PST
*** Bug 726152 has been marked as a duplicate of this bug. ***
Comment 4 Panos Astithas [:past] 2012-02-11 03:06:02 PST
Comment on attachment 596196 [details] [diff] [review]
properly encode before sending across the wire

Review of attachment 596196 [details] [diff] [review]:
-----------------------------------------------------------------

Works as advertised.

::: toolkit/devtools/debugger/tests/unit/test_dbgsocket.js
@@ +40,4 @@
>        transport.send({to: "root",
>                        type: "echo",
> +                      reallylong: really_long(),
> +                      unicode: "(╯°□°)╯︵ ┻━┻"});

Nit: moving the Unicode string to a variable would avoid some typing and ensure we test for the same thing.
Comment 5 Rob Campbell [:rc] (:robcee) 2012-02-13 12:05:12 PST
Comment on attachment 596196 [details] [diff] [review]
properly encode before sending across the wire

f+ for using tableflip guy!
Comment 6 Tim Taubert [:ttaubert] 2012-02-15 02:21:57 PST
https://hg.mozilla.org/mozilla-central/rev/4ea8c90ff02a

Note You need to log in before you can comment on or make changes to this bug.