Debugger error: jschar out of char range; high bits of data lost

RESOLVED FIXED in Firefox 13

Status

()

Firefox
Developer Tools: Debugger
P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: past, Assigned: dcamp)

Tracking

Trunk
Firefox 13
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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
)
JSON.parse strikes again!
(Assignee)

Comment 2

5 years ago
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.
Assignee: nobody → dcamp
Attachment #596196 - Flags: review?(past)
(Assignee)

Updated

5 years ago
Duplicate of this bug: 726152
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.
Attachment #596196 - Flags: review?(past) → review+
Comment on attachment 596196 [details] [diff] [review]
properly encode before sending across the wire

f+ for using tableflip guy!
Attachment #596196 - Flags: feedback+
https://hg.mozilla.org/mozilla-central/rev/4ea8c90ff02a
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
You need to log in before you can comment on or make changes to this bug.