Closed Bug 901426 Opened 7 years ago Closed 7 years ago

Web Apps can not be opened from Firefox for Android notification and crashes Firefox

Categories

(Firefox for Android :: Web Apps (PWAs), defect, P1)

25 Branch
ARM
Android
defect

Tracking

()

VERIFIED FIXED
Firefox 26
Tracking Status
firefox24 --- unaffected
firefox25 + verified
firefox26 + verified
relnote-firefox --- -
fennec 25+ ---

People

(Reporter: u421692, Assigned: wesj)

References

(Blocks 1 open bug)

Details

(Keywords: crash, reproducible, Whiteboard: [native-crash][startupcrash][A4A])

Crash Data

Attachments

(3 files)

Attached file webapps_crash Logs
Environment:
Device: LG Nexus 4 (Android 4.2.2)
Build: Nightly 25.0a1 (2013-08-04)

Steps to reproduce:
1. Open Firefox
2. Open Firefox Marketplace
3. Tap on "Free" button next to any web app to install it
4. After installation, tap on "Launch" button
5. Minimize Firefox and start the web app from home-screen shortcut(only on second try, the app will start)
6. Open Firefox.

Expected results:
At Step 4: Web app is opened without any issues.
At Step 6: Firefox is opened without any issues. 

Actual results:
At Step 4: Web app is started and you can see the splash screen but it fails to load and user is taken back to Firefox.
At Step 6: Firefox crashes. See Bug 805754
Blocks: 805754
Severity: normal → critical
Crash Signature: [@ mozalloc_abort(char const*) | NS_DebugBreak | mozilla::Logger::~Logger() ]
Keywords: crash
Summary: Web Apps can not be opened from Firefox or Android notification and crashes Firefox → Web Apps can not be opened from Firefox for Android notification and crashes Firefox
Whiteboard: [native-crash]
Priority: -- → P1
Whiteboard: [native-crash] → [native-crash][A4A]
Wes - Can you help diagnose this?
Assignee: nobody → wjohnston
Webapps start for me on nightly (i.e. I can't reproduce step 4), but I can reproduce the crashes. Also, Firefox tries to start using the webapp url for some reason. Looking....
Whiteboard: [native-crash][A4A] → [native-crash][startupcrash][A4A]
Attaching a debugger doesn't seem to find anything useful here either. I'm down to bisecting this.
It's likely #2 top crasher in Fennec 26.0a1 (topcrash keyword for bug 805754).
tracking-fennec: --- → ?
Keywords: reproducible
So, I can reproduce this pretty well by launching a web app, then pressing the home button, and launching Nightly.
Me, too... The Kitchen Sink App is a good one to try with.
Yes, anytime you launch an app while Fennec is running (or vice versa), you'll see this.
tracking-fennec: ? → 25+
Attached file crash.txt
I see a crash in Gecko when trying to open an app from another APK.  I'm building Fennec from a branch with a few changes, so it may not be the same issue; but I haven't made any changes to Gecko.

Here's a logcat.
Attached patch PatchSplinter Review
Finally managed to track this down. James was right, we're using the wrong profile. I forgot to check out that hunch. Fallout from Guest mode patches. :(
Attachment #798008 - Flags: review?(mark.finkle)
Status: NEW → ASSIGNED
Comment on attachment 798008 [details] [diff] [review]
Patch

This seems wrong. It seems like we won't handle the sIsUsingCustomProfile case at all anymore.

Also, Gecko should not need the -P param to use the default profile.
Attachment #798008 - Flags: review?(mark.finkle) → review-
(In reply to Mark Finkle (:mfinkle) from comment #10)
> Comment on attachment 798008 [details] [diff] [review]
> Patch
> 
> This seems wrong. It seems like we won't handle the sIsUsingCustomProfile
> case at all anymore.
> 
> Also, Gecko should not need the -P param to use the default profile.

We didn't handle the sIsUsingCUstomProfile case before either (here). sIsUsingCustomProfile meant that the intent had passed a profile to us in the args. i.e. We didn't need to handle it (here). The user already had.

Remembering back, I think once Java started reading profiles.ini, we just decided it was safest if Java always told Gecko what to load. Why we did that using -P instead of --profile, I can't remember. We'll be doing something similar in bug 886925.
Sorry, I didn't make this clear before. This is a regression from:

https://bug871863.bugzilla.mozilla.org/attachment.cgi?id=773746

which is changed from (expanding the ternary):

if (GeckoAppShell.getGeckoInterface() == null || GeckoApp.sIsUsingCustomProfile) {
  profile = "";
} else {
  profile = " -P " + GeckoAppShell.getGeckoInterface().getProfile().getName();
}

to

if (GeckoAppShell.getGeckoInterface() == null || GeckoApp.sIsUsingCustomProfile) {
  profile = " -P " + GeckoAppShell.getGeckoInterface().getProfile().getName();
}

i.e. Brad screwed this up. Also, the try run looks ok.
Comment on attachment 798008 [details] [diff] [review]
Patch

Brad screwed this up? Why didn't you say so! :)
Attachment #798008 - Flags: review- → review+
https://hg.mozilla.org/mozilla-central/rev/4f076c424cd9
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
This has practically disappeared from 26 Nightly now, but 25 Aurora still has this signature in high volume. wesj, are you nominating this for uplift?
Flags: needinfo?(wjohnston)
Comment on attachment 798008 [details] [diff] [review]
Patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Guest mode
User impact if declined: Webapps crash on launch
Testing completed (on m-c, etc.): Landed on mc this week. Sounds like its working.
Risk to taking this patch (and alternatives if risky): Low risk. Reverting to old behavior.
String or IDL/UUID changes made by this patch: None.
Attachment #798008 - Flags: approval-mozilla-aurora?
Attachment #798008 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified fixed on:
Build: Firefox for Android 25.0a2 (2013-09-16) and Firefox for Android 26.0a1 (2013-09-16)
Device: LG Nexus 4
OS: Android 4.2.2
Status: RESOLVED → VERIFIED
Erin this got fixed on 25 when still on Aurora and won't ship to Beta users (also was not in the 25.0a2 auroranotes) so I don't think there's anything to note here - please renom if you think I've missed something.
Flags: needinfo?(elancaster)
Flags: needinfo?(elancaster)
You need to log in before you can comment on or make changes to this bug.