Closed
Bug 931304
Opened 11 years ago
Closed 7 years ago
console API should toString() arguments synchronously
Categories
(DevTools :: Console, defect, P3)
DevTools
Console
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 30
People
(Reporter: jruderman, Assigned: baku)
References
Details
(Keywords: testcase)
Attachments
(1 file)
468 bytes,
text/html
|
Details |
************************************************************
* Call to xpconnect wrapped JSObject produced this error: *
[Exception... "'[JavaScript Error: "can't access dead object" {file: "resource://gre/components/ConsoleAPI.js" line: 369}]' when calling method: [nsITimerCallback::notify]" nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0" data: yes]
************************************************************
I think console.log should toString its arguments synchronously.
Yes. Asynchronous argument conversion is not compatible with WebIDL either. Do we have a bug on file for WebIDLifying the console object?
Comment 2•11 years ago
|
||
Nope.
Furthermore, the async behavior here is somewhat on purpose, last I checked: it's a performance optimization since in common cases console stuff is never looked at....
Hmm, that's going to be tricky ...
Comment 4•11 years ago
|
||
We can add a Cu.isDeadObject() check and put a '[object DeadObject]' placeholder for the arguments that point to dead objects. Would this be fine?
Reporter | ||
Comment 5•11 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #2)
> Furthermore, the async behavior here is somewhat on purpose, last I checked:
> it's a performance optimization since in common cases console stuff is never
> looked at....
Is the performance benefit primarily from delaying the toString, or from delaying notifying the web console and browser console?
Reporter | ||
Comment 6•11 years ago
|
||
(In reply to Mihai Sucan [:msucan] from comment #4)
> We can add a Cu.isDeadObject() check and put a '[object DeadObject]'
> placeholder for the arguments that point to dead objects. Would this be fine?
Can a GC happen between the call to Cu.isDeadWrapper() and the call to toString?
(In reply to Jesse Ruderman from comment #6)
> (In reply to Mihai Sucan [:msucan] from comment #4)
> > We can add a Cu.isDeadObject() check and put a '[object DeadObject]'
> > placeholder for the arguments that point to dead objects. Would this be fine?
>
> Can a GC happen between the call to Cu.isDeadWrapper() and the call to
> toString?
Wrapper cutting isn't based on the GC. It's based on deterministic points where we "know" a window should die. Modulo existing violations of run to completion semantics like nested event loops the wrapper cannot get cut during script execution.
Reporter | ||
Comment 8•11 years ago
|
||
Oh, right.
console.log({toString: function() { window.close(); }});
Comment 9•11 years ago
|
||
(In reply to Jesse Ruderman from comment #5)
> (In reply to Boris Zbarsky [:bz] from comment #2)
> > Furthermore, the async behavior here is somewhat on purpose, last I checked:
> > it's a performance optimization since in common cases console stuff is never
> > looked at....
>
> Is the performance benefit primarily from delaying the toString, or from
> delaying notifying the web console and browser console?
The primary reason was to delay notification of the web/browser console. We were blocking the content script execution.
Comment 10•11 years ago
|
||
Sounds like we should do the toString synchronously and see whether that negatively impacts the perf metrics we care about?
Updated•11 years ago
|
OS: Mac OS X → All
Priority: -- → P3
Hardware: x86_64 → All
Summary: console.log tries to access dead object (due to toString()ing arguments asynchronously) → console API should toString() arguments synchronously
Comment 11•7 years ago
|
||
This testcase stopped reproducing in the pushlog range below:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=58eca03214a6&tochange=8abc76dedec2
Calling this fixed by bug 965860.
Assignee: nobody → amarchesini
Status: NEW → RESOLVED
Closed: 7 years ago
Depends on: 965860
Resolution: --- → FIXED
Target Milestone: --- → Firefox 30
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•