Closed Bug 1014794 Opened 6 years ago Closed 6 years ago

console.log messages no longer appear in logcat output

Categories

(Firefox for Android :: General, defect)

ARM
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 32
Tracking Status
firefox29 --- unaffected
firefox30 --- affected
firefox31 --- fixed
firefox32 --- fixed
fennec 30+ ---

People

(Reporter: myk, Assigned: snorp)

References

Details

(Keywords: regression)

Attachments

(1 file)

console.log messages used to appear in logcat output, but they no longer do.  A course bisection of nightly builds shows that the problem happened sometime between February 1 and March 1, as the former build shows such messages, while the latter build doesn't.

For example, loading https://marketplace.firefox.com/, which uses console.log extensively, used to pour messages like these into logcat:

  4647           GeckoConsole  E  [user] Saving settings to localStorage
  4647           GeckoConsole  E  [urls] Using settings.media_url: https://marketplace.cdn.mozilla.net/media/
  4647           GeckoConsole  E  [urls] Changed settings.cdn_url: https://marketplace.cdn.mozilla.net
  4647           GeckoConsole  E  [cache] Persisting request cache
  4647           GeckoConsole  E  Templates loaded
  4647           GeckoConsole  E  [tracking] Setting up UA tracking without Potatolytics
  4647           GeckoConsole  E  [tracking] Tracking initialized
  4647           GeckoConsole  E  Loading nunjucks compat...
  4647           GeckoConsole  E  [model] Stored all as category


Note that calls to  nsIConsoleService.logStringMessage calls (from both C++ and chrome JavaScript code) do write output to logcat, f.e.:

  5344           GeckoConsole  E  OpenGL compositor Initialized Succesfully.
  5344           GeckoConsole  E  Version: OpenGL ES 2.0 build 1.8.GOOGLENEXUS.ED945322@2198402
  5344           GeckoConsole  E  Vendor: Imagination Technologies
  5344           GeckoConsole  E  Renderer: PowerVR SGX 540
  5344           GeckoConsole  E  FBO Texture Target: TEXTURE_2D


So this problem seems specific the `console` DOM API.
Note that printf_stderr calls in gecko C++ code also seem to be affected. At least, on recent m-c adding printf_stderr calls didn't produce any output. It makes debugging somewhat harder because gdb doesn't always produce reliable value inspection.
Keywords: regression
This is a result of https://hg.mozilla.org/integration/mozilla-inbound/rev/f75676ac4f7d

This has also broken the AWSY mobile harness, because console.log output that is used to detect the end of the run is no longer getting dumped to logcat.
Blocks: 908503
Actually, that can't be right, since that just landed today. But that landing definitely seems to have broken the AWSY mobile harness somehow. I'll file a separate bug for that.
No longer blocks: 908503
Andrea, would console.log breakage in Fennec be a result of bug 965860?
Blocks: 965860
tracking-fennec: --- → ?
Flags: needinfo?(amarchesini)
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #6)
> Andrea, would console.log breakage in Fennec be a result of bug 965860?

I don't know yet. I don't have the environment to compile fennec at the moment, but console API works on b2g and logcat. Console API doesn't write messages directly, but I don't see any other reason for this bug in the pushlog range.

Is b2g using the same logcat of fennec?
Flags: needinfo?(amarchesini)
Fennec and b2g both use the android logcat, which is written to using __android_log_print APIs in the android NDK. However, I think Fennec has some more JS goop in mobile/android/chrome/content/ConsoleAPI.js that might need updating to go along with your changes.
Yeah, the change here[1] (and associated removal from jar.mn) caused the regression.

https://hg.mozilla.org/mozilla-central/diff/3f528e61aacf/mobile/android/chrome/content/browser.js
Assignee: nobody → snorp
Attachment #8427915 - Flags: review?(mark.finkle)
Attachment #8427915 - Flags: review?(amarchesini)
Comment on attachment 8427915 [details] [diff] [review]
Fix console.log output on Android

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

I was actually looking for how ConsoleAPI.js was used.
Attachment #8427915 - Flags: review?(amarchesini) → review+
(In reply to Andrea Marchesini (:baku) from comment #11)
> Comment on attachment 8427915 [details] [diff] [review]
> Fix console.log output on Android
> 
> Review of attachment 8427915 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I was actually looking for how ConsoleAPI.js was used.

Yeah, appears to be badly named. ConsoleObserver or ConsoleLogger maybe.
I think there is the same bug on B2G as well: I don't see anything from Gecko in logcat since a couple of days.
Andrea, I cannot get Gecko output back in logcat on B2G even after reverting the change on b2g/installer/package-manifest.in. Not having any output in logcat is quite severe :(
Flags: needinfo?(amarchesini)
blocking-b2g: --- → 2.0?
:gerard_majax, I think the bug you want is bug 1014814, not this one.
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #16)
> :gerard_majax, I think the bug you want is bug 1014814, not this one.

Looks like you are right.
blocking-b2g: 2.0? → ---
Flags: needinfo?(amarchesini)
https://hg.mozilla.org/mozilla-central/rev/ac405c3ba590
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 32
Attachment #8427915 - Flags: review?(mark.finkle) → review+
tracking-fennec: ? → 30+
Comment on attachment 8427915 [details] [diff] [review]
Fix console.log output on Android

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 965860
User impact if declined: No console messages on logcat
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): Low
String or IDL/UUID changes made by this patch: None
Attachment #8427915 - Flags: approval-mozilla-aurora?
Comment on attachment 8427915 [details] [diff] [review]
Fix console.log output on Android

Aurora approval granted.
Attachment #8427915 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.