Closed
Bug 1280446
Opened 8 years ago
Closed 8 years ago
Fennec crashes when launching as the result of a push message
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox47 unaffected, firefox48 fixed, firefox49 fixed, fennec48+, firefox50 fixed)
RESOLVED
FIXED
Firefox 50
Tracking | Status | |
---|---|---|
firefox47 | --- | unaffected |
firefox48 | --- | fixed |
firefox49 | --- | fixed |
fennec | 48+ | --- |
firefox50 | --- | fixed |
People
(Reporter: catalinb, Assigned: jchen)
References
Details
Attachments
(2 files)
(deleted),
patch
|
snorp
:
review+
gchang
:
approval-mozilla-aurora+
gchang
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jchen
:
review+
|
Details | Diff | Splinter Review |
When receiving a push message while fennec is not running, android will launch fennec which will immediately crash.
Steps to reproduce:
1. Register for push messages on https://people.mozilla.org/~ewong2/push-notification-test/
2. close fennec
3. send a push message using curl
4. fennec launches and crashes with the following stack trace:
06-16 14:14:26.083 3499 3514 E AndroidRuntime: FATAL EXCEPTION: GeckoBackgroundThread
06-16 14:14:26.083 3499 3514 E AndroidRuntime: Process: org.mozilla.fennec_catalin, PID: 3499
06-16 14:14:26.083 3499 3514 E AndroidRuntime: java.lang.IllegalStateException: PushService not yet created!
06-16 14:14:26.083 3499 3514 E AndroidRuntime: at org.mozilla.gecko.push.PushService.getInstance(PushService.java:71)
06-16 14:14:26.083 3499 3514 E AndroidRuntime: at org.mozilla.gecko.gcm.GcmMessageListenerService$1.run(GcmMessageListenerService.java:33)
06-16 14:14:26.083 3499 3514 E AndroidRuntime: at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:39)
https://pastebin.mozilla.org/8877558
Reporter | ||
Updated•8 years ago
|
Blocks: android-push
Comment 1•8 years ago
|
||
Ah, I think I see the race -- right where I said there wouldn't be a race!
https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java#188
I think what is happening is that the Application startup and the message listener startup are happening more or less at the same time. We will need to wait for the PushService to be initialized in the message listener, in some way, shape, or form.
Updated•8 years ago
|
tracking-fennec: --- → ?
48 is probably affected, right?
tracking-fennec: ? → 48+
status-firefox47:
--- → unaffected
status-firefox48:
--- → affected
status-firefox49:
--- → affected
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•8 years ago
|
||
If PushService has not been created when getInstance is called, create
the PushService instead of throwing an error. This fixes a possible race
condition between initializing PushService and receiving a push message,
where we can receive a push message first.
Attachment #8766445 -
Flags: review?(snorp)
Comment on attachment 8766445 [details] [diff] [review]
Create PushService if needed (v1)
Review of attachment 8766445 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/java/org/mozilla/gecko/push/PushService.java
@@ +73,5 @@
> return sInstance;
> }
>
> @ReflectionTarget
> public static synchronized void onCreate(Context context) {
I guess I never noticed this before, but this method name should probably be changed. It conflicts with the non-static one from Service (or Context, maybe, wherever it comes from). I think 'create', 'createInstance', or 'initialize' would be better choices.
Attachment #8766445 -
Flags: review?(snorp) → review+
Pushed by nchen@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/29386385b953
Create PushService if needed; r=snorp
Comment 6•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
Assignee | ||
Comment 7•8 years ago
|
||
Comment on attachment 8766445 [details] [diff] [review]
Create PushService if needed (v1)
Approval Request Comment
[Feature/regressing bug #]: Bug 1272557
[User impact if declined]: Possible crash when receiving push notifications
[Describe test coverage new/current, TreeHerder]: Locally, m-c
[Risks and why]: Small; patch only addresses the crash
[String/UUID change made/needed]: None
Attachment #8766445 -
Flags: approval-mozilla-beta?
Attachment #8766445 -
Flags: approval-mozilla-aurora?
Comment 8•8 years ago
|
||
Comment on attachment 8766445 [details] [diff] [review]
Create PushService if needed (v1)
Review of attachment 8766445 [details] [diff] [review]:
-----------------------------------------------------------------
This patch fixes a possible crash when receiving push notifications. Take it in 48 beta 7 and aurora. The fix should be in fennec 48 beta 8.
Attachment #8766445 -
Flags: approval-mozilla-beta?
Attachment #8766445 -
Flags: approval-mozilla-beta+
Attachment #8766445 -
Flags: approval-mozilla-aurora?
Attachment #8766445 -
Flags: approval-mozilla-aurora+
Updated•8 years ago
|
Flags: qe-verify+
Comment 9•8 years ago
|
||
bugherder uplift |
Comment 10•8 years ago
|
||
bugherder uplift |
Assignee | ||
Comment 11•8 years ago
|
||
This is a follow-up to fix another possible crash when using push. r=me for trivial patch.
Attachment #8769883 -
Flags: review+
Comment 12•8 years ago
|
||
Pushed by nchen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/749004283a01
Follow-up to fix another possible crash; r=me
Assignee | ||
Comment 13•8 years ago
|
||
Comment 14•8 years ago
|
||
bugherder |
Comment 15•6 years ago
|
||
Hi Cătălin,
Is the qe-verify+ flag still valid?
Thank you!
Flags: needinfo?(catalin.badea392)
Comment 16•6 years ago
|
||
It isn't
(as a general rule, if the flag is older than 6 months, there is no point in checking it...)
Flags: needinfo?(catalin.badea392)
Comment 17•6 years ago
|
||
Hi Sylvestre,
Thanks for the tip!
Taking into consideration Comment 16, I will remove the qe-verify+ flag.
Have a good day!
Flags: qe-verify+
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•