Closed
Bug 1358937
Opened 8 years ago
Closed 8 years ago
Long error message crashes the new console frontend
Categories
(DevTools :: Console, defect, P1)
Tracking
(firefox55 verified)
Tracking | Status | |
---|---|---|
firefox55 | --- | verified |
People
(Reporter: Oriol, Assigned: nchevobbe)
References
Details
(Whiteboard: [console-html])
Attachments
(3 files)
1. Go to about:newtab
2. Open the web console
3. Enter this code:
var w = window.open(); w.close(); Reflect.apply(w);
4. The console shows no output and stops working.
This specific case was introduced by 1303795, unrelated to the console.
Reporter | ||
Updated•8 years ago
|
Summary: DeadObject and Reflect.apply crashs console → DeadObject and Reflect.apply crash the console
Comment 1•8 years ago
|
||
This is only a problem on the new frontend. I see this in the browser console:
rror: Minified React error #31; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20initial%2C%20length%2C%20actor%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Blocks: enable-new-console
Summary: DeadObject and Reflect.apply crash the console → DeadObject and Reflect.apply crash the new console frontend
Comment 2•8 years ago
|
||
Full message with dev js modules:
Error: Objects are not valid as a React child (found: object with keys {type, initial, length, actor}). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of `Message`.
Updated•8 years ago
|
Whiteboard: [console-html]
Updated•8 years ago
|
Flags: qe-verify?
Priority: -- → P2
Updated•8 years ago
|
Flags: qe-verify? → qe-verify+
Updated•8 years ago
|
QA Contact: iulia.cristescu
Reporter | ||
Comment 3•8 years ago
|
||
Yes, it seems the error contains an object instead of a message, and the console didn't expect this.
> try{var w = window.open(); w.close(); Reflect.apply(w);}catch(err){err}
TypeError: [object Object]
Stack trace:
@debugger eval code:1:39
WCA_evalWithDebugger@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/server/actors/webconsole.js:1385:16
WCA_onEvaluateJS@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/server/actors/webconsole.js:898:20
WCA_onEvaluateJSAsync@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/server/actors/webconsole.js:868:20
onPacket@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/server/main.js:1759:15
receiveMessage@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/shared/transport/transport.js:761:7
> try{var w = window.open(); w.close(); Reflect.apply(w);}catch(err){err.message}
"({InstallTrigger:null, get window() {
[native code]
}, get document() {
[native code]
}, get location() {
[native code]
}, set location() {
[native code]
}, get top() {
[native code]
}, close:function close() {
[native code]
}, stop:function stop() {
[native code]
}, focus:function focus() {
[native code]
}, blur:function blur() {
[native code]
}, open:function open() {
[native code]
}, alert:function alert() {
[native code]
}, confirm:function confirm() {
[native code]
}, prompt:function prompt() {
[native code]
}, print:function print() {
[native code]
}, showModalDialog:function showModalDialog() {
[native code]
}, postMessage:function postMessage() {
[native code]
}, captureEvents:function captureEvents() {
[native code]
}, releaseEvents:function releaseEvents() {
[native code]
}, getSelection:function getSelection() {
[native code]
}, getComputedStyle:function getComputedStyle() {
[native code]
}, matc…"
Compare with Reflect.construct:
> try{var w = window.open(); w.close(); Reflect.construct(w);}catch(err){err}
TypeError: w is not a constructor
Stack trace:
@debugger eval code:1:39
WCA_evalWithDebugger@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/server/actors/webconsole.js:1385:16
WCA_onEvaluateJS@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/server/actors/webconsole.js:898:20
WCA_onEvaluateJSAsync@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/server/actors/webconsole.js:868:20
onPacket@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/server/main.js:1759:15
receiveMessage@resource://gre/modules/commonjs/toolkit/loader.js
-> resource://devtools/shared/transport/transport.js:761:7
> try{var w = window.open(); w.close(); Reflect.construct(w);}catch(err){err.message}
"w is not a constructor"
Assignee | ||
Comment 4•8 years ago
|
||
This crash is caused because we make the assumption that the exceptionMessage of the packet is a string.
But here, we receive exceptionMessage as a longString [1], hence the error.
This should be easy to fix naively first, by getting the content of exceptionMessage.initial.
Still, it could be nice if the user could expand the message to get the whole content. We already have a bug to track this feature for logged longString (Bug 1310630), so I'll add a comment there saying we should handle long error messages too.
[1] Packet :
{
"from": "server1.conn1.child1/consoleActor2",
"input": " var w = window.open(); w.close(); Reflect.apply(w);",
"result": {
"type": "undefined"
},
"timestamp": 1493106355440,
"exception": {
"type": "object",
"actor": "server1.conn1.child1/obj35",
"class": "Error",
"extensible": true,
"frozen": false,
"sealed": false,
"ownPropertyLength": 4,
"preview": {
"kind": "Error",
"name": "TypeError",
"message": {
"type": "longString",
"initial": "({close:function close() {\n [native code]\n}, stop:function stop() {\n [native code]\n}, focus:function focus() {\n [native code]\n}, blur:function blur() {\n [native code]\n}, open:function open() {\n [native code]\n}, alert:function alert() {\n [native code]\n}, confirm:function confirm() {\n [native code]\n}, prompt:function prompt() {\n [native code]\n}, print:function print() {\n [native code]\n}, postMessage:function postMessage() {\n [native code]\n}, captureEvents:function captureEvents() {\n [native code]\n}, releaseEvents:function releaseEvents() {\n [native code]\n}, getSelection:function getSelection() {\n [native code]\n}, getComputedStyle:function getComputedStyle() {\n [native code]\n}, matchMedia:function matchMedia() {\n [native code]\n}, moveTo:function moveTo() {\n [native code]\n}, moveBy:function moveBy() {\n [native code]\n}, resizeTo:function resizeTo() {\n [native code]\n}, resizeBy:function resizeBy() {\n [native code]\n}, scroll:function sc",
"length": 13482,
"actor": "server1.conn1.child1/longString32"
},
"stack": "@debugger eval code:1:39\n",
"fileName": "debugger eval code",
"lineNumber": 1,
"columnNumber": 39
}
},
"exceptionMessage": {
"type": "longString",
"initial": "TypeError: ({close:function close() {\n [native code]\n}, stop:function stop() {\n [native code]\n}, focus:function focus() {\n [native code]\n}, blur:function blur() {\n [native code]\n}, open:function open() {\n [native code]\n}, alert:function alert() {\n [native code]\n}, confirm:function confirm() {\n [native code]\n}, prompt:function prompt() {\n [native code]\n}, print:function print() {\n [native code]\n}, postMessage:function postMessage() {\n [native code]\n}, captureEvents:function captureEvents() {\n [native code]\n}, releaseEvents:function releaseEvents() {\n [native code]\n}, getSelection:function getSelection() {\n [native code]\n}, getComputedStyle:function getComputedStyle() {\n [native code]\n}, matchMedia:function matchMedia() {\n [native code]\n}, moveTo:function moveTo() {\n [native code]\n}, moveBy:function moveBy() {\n [native code]\n}, resizeTo:function resizeTo() {\n [native code]\n}, resizeBy:function resizeBy() {\n [native code]\n}, scroll:",
"length": 13493,
"actor": "server1.conn1.child1/longString36"
},
"exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_a_function?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default",
"frame": {
"source": "debugger eval code",
"line": 1,
"column": 39
},
"helperResult": null
}
Assignee: nobody → nchevobbe
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Updated•8 years ago
|
Status: NEW → ASSIGNED
Iteration: --- → 55.4 - May 1
Priority: P2 → P1
Reporter | ||
Comment 9•8 years ago
|
||
Note that `var w = window.open(); w.close(); Reflect.apply(w);` producing that longstring seems part of bug 1358939.
The expected error should be `TypeError: w is not a function`.
So if you know some other way to get a longstring, better use that as the test.
Assignee | ||
Comment 10•8 years ago
|
||
(In reply to Oriol from comment #9)
> Note that `var w = window.open(); w.close(); Reflect.apply(w);` producing
> that longstring seems part of bug 1358939.
> The expected error should be `TypeError: w is not a function`.
> So if you know some other way to get a longstring, better use that as the
> test.
Thanks, I'll switch to something a bit more predictable then.
Comment 11•8 years ago
|
||
mozreview-review |
Comment on attachment 8861385 [details]
Bug 1358937 - Fix console crash due to longString error messages;
https://reviewboard.mozilla.org/r/133376/#review136530
Attachment #8861385 -
Flags: review?(bgrinstead) → review+
Comment 12•8 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #10)
> (In reply to Oriol from comment #9)
> > Note that `var w = window.open(); w.close(); Reflect.apply(w);` producing
> > that longstring seems part of bug 1358939.
> > The expected error should be `TypeError: w is not a function`.
> > So if you know some other way to get a longstring, better use that as the
> > test.
>
> Thanks, I'll switch to something a bit more predictable then.
What about `throw new Error("Long error".repeat(10000))`?
Comment hidden (mozreview-request) |
Assignee | ||
Comment 14•8 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #12)
> (In reply to Nicolas Chevobbe [:nchevobbe] from comment #10)
> > (In reply to Oriol from comment #9)
> > > Note that `var w = window.open(); w.close(); Reflect.apply(w);` producing
> > > that longstring seems part of bug 1358939.
> > > The expected error should be `TypeError: w is not a function`.
> > > So if you know some other way to get a longstring, better use that as the
> > > test.
> >
> > Thanks, I'll switch to something a bit more predictable then.
>
> What about `throw new Error("Long error".repeat(10000))`?
Works great, thanks.
I updated the review
Reporter | ||
Updated•8 years ago
|
Summary: DeadObject and Reflect.apply crash the new console frontend → Long error message crashes the new console frontend
Comment 15•8 years ago
|
||
mozreview-review |
Comment on attachment 8861386 [details]
Bug 1358937 - Add tests for exceptions with longString messages;
https://reviewboard.mozilla.org/r/133378/#review136872
Attachment #8861386 -
Flags: review?(bgrinstead) → review+
Comment 16•8 years ago
|
||
Looks like the stubs file needs to be updated: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f45aafda5e3a&selectedJob=94420766
Assignee | ||
Comment 17•8 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #16)
> Looks like the stubs file needs to be updated:
> https://treeherder.mozilla.org/#/
> jobs?repo=try&revision=f45aafda5e3a&selectedJob=94420766
I updated them though.
I think there might be a bug in the check_stubs_* test, I'll have a look
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 21•8 years ago
|
||
Comment 22•8 years ago
|
||
mozreview-review |
Comment on attachment 8862304 [details]
Bug 1358937 - Make getCleanedPacket function handle longString exception messages;
https://reviewboard.mozilla.org/r/134228/#review137432
Attachment #8862304 -
Flags: review?(bgrinstead) → review+
Comment 23•8 years ago
|
||
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/60b547b301b6
Fix console crash due to longString error messages; r=bgrins
https://hg.mozilla.org/integration/autoland/rev/e34af094bed2
Add tests for exceptions with longString messages; r=bgrins
https://hg.mozilla.org/integration/autoland/rev/607d5fdcc92e
Make getCleanedPacket function handle longString exception messages; r=bgrins
Comment 24•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/60b547b301b6
https://hg.mozilla.org/mozilla-central/rev/e34af094bed2
https://hg.mozilla.org/mozilla-central/rev/607d5fdcc92e
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Comment 25•8 years ago
|
||
Managed to reproduce the initial issue on 55.0a1 (2017-04-23). I can confirm that it is verified fixed on 55.0a1 (2017-05-02), using Windows 10 x64, Ubuntu 16.04 x64 and Mac OS X 10.11.6.
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•