Last Comment Bug 773466 - Console will stop displaying output
: Console will stop displaying output
Status: VERIFIED FIXED
:
Product: Firefox
Classification: Client Software
Component: Developer Tools: Console (show other bugs)
: Trunk
: All All
: P2 normal (vote)
: Firefox 17
Assigned To: Mihai Sucan [:msucan]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-12 15:05 PDT by Ian Bicking (:ianb)
Modified: 2012-10-16 06:25 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
fixed
+
verified
verified


Attachments
proposed patch (5.06 KB, patch)
2012-07-13 10:49 PDT, Mihai Sucan [:msucan]
rcampbell: review+
Details | Diff | Review
[in-fx-team] test fix (5.12 KB, patch)
2012-07-17 04:26 PDT, Mihai Sucan [:msucan]
akeybl: approval‑mozilla‑aurora+
lukasblakk+bugs: approval‑mozilla‑beta+
Details | Diff | Review

Description Ian Bicking (:ianb) 2012-07-12 15:05:04 PDT
I'm having a hard time figuring out when this happens exactly, but sometimes the console stops updating with new content.  Opening and closing the console (e.g., with Cmd-Alt-K) sometimes fixes it, or at least causes some output to appear that was hidden.

This seems to reproduce:

  > console.dir(function () {});
  > console.log('hey');

The "hey" won't display.  console.dir({a: 1}) won't cause this, but trying to use it on some other objects (besides simple objects) also causes problems.
Comment 1 Paul Rouget [:paul] 2012-07-12 16:25:15 PDT
I think it actually prints "hey", but doesn't scroll up the content.
So you have to scroll to reach the "hey" string. But, when the mouse
is over the dir-box, you can't scroll, for some reason.

So 2 problems here:
1) we should ensure that the second log is visible by scrolling to the end of the rhichlistbox. I think we already do that, but for some reason, it doesn't work with the dir.
2) we can't scroll the richlistbox when the mouse is over the dir-box

My STR:
> console.dir(document.body)
> console.log("foo")
Comment 2 Panos Astithas [:past] 2012-07-13 01:34:55 PDT
(In reply to Paul Rouget [:paul] from comment #1)
> 2) we can't scroll the richlistbox when the mouse is over the dir-box

IIRC that's because the dir-box can overflow and get its own scrollbars.
Comment 3 Mihai Sucan [:msucan] 2012-07-13 01:55:19 PDT
Yep, Panos is correct. The UX for console.dir() is quite poor - it causes problems.
Comment 4 Mihai Sucan [:msucan] 2012-07-13 03:08:47 PDT
Ian: this seems to be a duplicate of bug 712553. Can you confirm?
Comment 5 Ian Bicking (:ianb) 2012-07-13 09:22:20 PDT
I don't think it's a dup of bug 712553.  It doesn't seem like a scrolling issue at all.  

If I open a console on bugzilla.mozilla.org (chosen just for convenience):

[11:18:34.911] < console.log('test1')
[11:18:34.913] > undefined
[11:18:34.914]   test1 @ Web Console:1
[11:18:40.566] < console.dir(function () {})
[11:18:40.569] > undefined

At this point console.dir doesn't write anything, and it's not close to needing to scroll – there's lots of blank space left in the console.  When I enter "console.log('test2')" I don't get any output, neither "< console.log('test2')" nor "test2 @ Web Console:1".  If I close and reopen the console I see only "test1" and if I enter "console.log('test3')" I see no output or changes to the console.

This is on Nightly, 16.0a1 (2012-07-09), reproduced with two different profiles.
Comment 6 Mihai Sucan [:msucan] 2012-07-13 09:37:00 PDT
Thanks for your report. I will investigate the issue ASAP.
Comment 7 Mihai Sucan [:msucan] 2012-07-13 10:19:04 PDT
Problem identified. I have a fix ready, just need to write a test.
Comment 8 Mihai Sucan [:msucan] 2012-07-13 10:49:12 PDT
Created attachment 641954 [details] [diff] [review]
proposed patch

Proposed patch with fix and a test. Problem was that HUDService-content.js did not ensure we send arguments either as strings or as arrays - where arrays are meant to be the "remote object represenation". This broke HUDService.jsm's code which assumed that. Also, in HUDService.jsm we now only pass the remoteObject to the tree view if it is an array - making sure the bug doesn't occur in HUDService.jsm either. The test does exactly what Ian suggested we try.

Please let me know if further changes are needed. Thanks!
Comment 9 Mihai Sucan [:msucan] 2012-07-16 08:40:51 PDT
Pushed to try:
https://tbpl.mozilla.org/?tree=Try&rev=feac638f8c6c
Comment 10 Rob Campbell [:rc] (:robcee) 2012-07-16 11:34:59 PDT
Comment on attachment 641954 [details] [diff] [review]
proposed patch

nice analysis of this problem. Sneaky bug!

Thanks for working through this with us, Ian.
Comment 11 Mihai Sucan [:msucan] 2012-07-17 04:26:27 PDT
Created attachment 642910 [details] [diff] [review]
[in-fx-team] test fix

Previous try push was orange due to an error in my test. Test fixed now.

Another try push:
https://tbpl.mozilla.org/?tree=Try&rev=a2833b1a84d6

(hopefully this one will be green)


Thanks for the r+!
Comment 12 Mihai Sucan [:msucan] 2012-07-17 11:37:20 PDT
Comment on attachment 642910 [details] [diff] [review]
[in-fx-team] test fix

Landed:
https://hg.mozilla.org/integration/fx-team/rev/fdb072732814
Comment 13 Tim Taubert [:ttaubert] 2012-07-18 03:36:46 PDT
https://hg.mozilla.org/mozilla-central/rev/fdb072732814
Comment 14 Mihai Sucan [:msucan] 2012-07-18 09:26:55 PDT
Comment on attachment 642910 [details] [diff] [review]
[in-fx-team] test fix

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 673148 - I omitted special-cases like the one reported in this bug.
User impact if declined: in certain cases when the dev tries to log objects that are not inspectable, the web console output breaks.
Testing completed (on m-c, etc.): landed in fx-team, then m-c and had green try runs.
Risk to taking this patch (and alternatives if risky): no known risk.
String or UUID changes made by this patch: none.
Comment 15 Mihai Sucan [:msucan] 2012-07-18 09:32:03 PDT
Firefox 16: affected in the same way as reported.
Firefox 15: unaffected. console.dir(function(){}) still causes an error to show in the error console, but output continues to work - it does not stop displaying output. So, technically the bug still exists, but it has far less impact. It seems to me that the latest perf changes in how output works made the bug worse.

I am not sure how to proceed for the beta. If it is considered we need to fix the bug for beta (firefox 15) as well, I can do that. Please let me know. Thank you!
Comment 16 Alex Keybl [:akeybl] 2012-07-18 17:40:58 PDT
I'm assuming you meant to mark FF15 as affected from your comment. FF15 is a developer-centric release, so I think it would be fantastic to prepare a patch for that branch as well. Approving for Aurora 16 in the meantime.
Comment 17 Mihai Sucan [:msucan] 2012-07-19 03:09:40 PDT
Comment on attachment 642910 [details] [diff] [review]
[in-fx-team] test fix

Indeed, I mixed version numbers. I meant that beta wasn't affected as badly as aurora and nightlies.

Thanks for the aurora approval!

Landed in aurora:
https://hg.mozilla.org/releases/mozilla-aurora/rev/ad98fe0fb57e
Comment 18 Mihai Sucan [:msucan] 2012-07-19 03:37:40 PDT
Comment on attachment 642910 [details] [diff] [review]
[in-fx-team] test fix

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 673148 - I omitted special-cases like the one reported in this bug.
User impact if declined: in certain cases when the dev tries to log objects that are not inspectable, an exception will occur in the web console. this is visible in the error console. output continues to work after that.
Testing completed (on m-c, etc.): landed in fx-team, m-c, aurora and had green try runs.
Risk to taking this patch (and alternatives if risky): no known risk.
String or UUID changes made by this patch: none.
Comment 19 Lukas Blakk [:lsblakk] use ?needinfo 2012-07-20 15:17:43 PDT
Comment on attachment 642910 [details] [diff] [review]
[in-fx-team] test fix

Approving for Beta since we're very early in the cycle. Please land in time for beta 2 (before Tues. AM PT) and then verify with the subsequent build so we can be sure that the Beta (15) landing accomplished what was intended.
Comment 20 Mihai Sucan [:msucan] 2012-07-21 03:18:26 PDT
Comment on attachment 642910 [details] [diff] [review]
[in-fx-team] test fix

Thanks for the beta approval!

Landed:
https://hg.mozilla.org/releases/mozilla-beta/rev/952b175db4ec

Please let me know if further action is needed on my behalf.
Comment 21 Paul Silaghi, QA [:pauly] 2012-09-25 07:49:20 PDT
Reproduced the issue on Nightly 2012-07-17.

(In reply to Ian Bicking (:ianb) from comment #0)
> I'm having a hard time figuring out when this happens exactly, but sometimes
> the console stops updating with new content.  Opening and closing the
> console (e.g., with Cmd-Alt-K) sometimes fixes it, or at least causes some
> output to appear that was hidden.
> 
> This seems to reproduce:
> 
>   > console.dir(function () {});
>   > console.log('hey');
> 
> The "hey" won't display.  console.dir({a: 1}) won't cause this, but trying
> to use it on some other objects (besides simple objects) also causes
> problems.

"hey" displayed

(In reply to Paul Rouget [:paul] from comment #1)
> I think it actually prints "hey", but doesn't scroll up the content.
> So you have to scroll to reach the "hey" string. But, when the mouse
> is over the dir-box, you can't scroll, for some reason.
> 
> So 2 problems here:
> 1) we should ensure that the second log is visible by scrolling to the end
> of the rhichlistbox. I think we already do that, but for some reason, it
> doesn't work with the dir.
> 2) we can't scroll the richlistbox when the mouse is over the dir-box
> 
> My STR:
> > console.dir(document.body)
> > console.log("foo")

"foo" displayed

Verified fixed on FF 16b4 on Win 7 x64, Ubuntu 12.04 and Mac OS X 10.7.4
Comment 22 Paul Silaghi, QA [:pauly] 2012-10-16 06:25:37 PDT
Verified fixed on FF 17b1 on Win 7 x64, Ubuntu 12.04 and Mac OS X 10.6.8

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