Closed Bug 1581805 Opened 7 years ago Closed 6 years ago

"Quit" does not quit and close firefox browser (android)

Categories

(Firefox for Android Graveyard :: General, defect, P1)

Firefox 68
ARM
Android
defect

Tracking

(firefox-esr6871+ verified)

RESOLVED FIXED
Tracking Status
firefox-esr68 71+ verified

People

(Reporter: rave25, Assigned: petru)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 external file)

User Agent: Mozilla/5.0 (Android 9; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0

Steps to reproduce:

  1. open firefox on android mobile
  2. open any website/tab
  3. Touch the three dots on upper right to pop up the tool bar
  4. select Quit to close the browser

Actual results:

Selecting Quit does not close the firefox browser.

i do notice that there was a bug reported for this long back, but it is closed.

refer bug id=1468346

Expected results:

it should have closed the firefox browser

[Tracking Requested - why for this release]: Asking QA for verification.

Priority: -- → P1

Hi, I checked your issue with Google Pixel 3 XL (Android 9) and Sony Xperia Z5 (Android 7.0) on Firefox RC 68.1.1, Firefox Beta 68.2b3 and Firefox Nightly 68.2a1 but I did not reproduce.
After tapping on Quit, the application is closed, it stays in task switcher but the process for it closes. Checked in Developer Options/Running Processes/Show cached processes and after quitting the application is not present.

When you say that it does not close the browser do you mean that after exiting/quit the browser, the app remains in task switcher/recent apps? If this is your case please view Comment 2 and Comment 4 from Bug1468346.

Flags: needinfo?(rave25)

Thanks Diana for your reply and question.

What I meant by does not close when quitting, is the browser is still open and on screen; I had to presss home button and then close all to minimize and then close the app.

I will try to make a video today. also it happened at random times, sometime quit closed the browser but at times, it did not do anything.

Flags: needinfo?(rave25)

Hi, when posting the video could you please provide the device and firmware are you using?
I will also investigate by closing the browser multiple times and see whether I reproduce it, with different devices as well.
Thanks

I am using Samsung Note 10+ and its on Android 9.

I have managed to reproduce your issue on Release 68.1.1 and Beta 68.2b3 using a Samsung Galaxy S8+ (Android 8.0.0) using the following steps:

  1. Launch Fennec and go to Settings -> Privacy -> Clear on exit and select all;
  2. Tap the 3 dot menu and select Quit;
  3. Repeat step 2 several times.

Actual results:

The "Clearing private data..." message is displayed but Firefox does not shut down.

Expected results:

The browser should be minimized.

Based on my investigation I will set this issue as new.

Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → Android
Hardware: Unspecified → ARM

Thank you for replicating the issue. And yes, I think I missed one important point on the privacy setting; it is set to clear on exit. Thank you for pointing that out.

screen capture video of the issue.

here's the video for the reported issue.

Sounds like QA was able to reproduce this. Petru, can your team please take a look?

Flags: needinfo?(petru.lingurar)

I can also replicate this.

Assignee: nobody → petru.lingurar
Status: NEW → ASSIGNED
Flags: needinfo?(petru.lingurar)
Keywords: regression

I have retested the issue on Release 68.2.0 and Beta 68.3b2 on several devices following the steps in comment 6 but managed to reproduce the issue only on 2 devices: Samsung Galaxy S9 and Samsung Galaxy S8+ both running Android 8.0.0, the issue seems to be device specific.

Thank you for the check Laurentiu. Ok let's do a quick engineering investigation of the code to see if there is anything special about these Samsung devices.

It is possible that as an edgecase we would try to shutdown PushService before
it was fully initialized.
In this case, based on the normal shutdown flow we would try to remove various
observers, which may have possibly never been registered and as such a js error
would be thrown which prevent the execution of other code and so leave this
entire object in a bad state, because of which other method calls may fail,
including ours for clearing site settings.

Don't have clear steps to reproduce for this but I managed to get some intermittent occurences.
What I can definetly say is that from all the options in the Clear private data menu only the Site Settings option, when checked would cause this issue.
The intermittent occurences refer to the cases when the app is left in a bad state and all attempts to clear Site Settings will fail, be it from the Quit menu or from the settings directly.

Regarding my suspicion of the ap being left in a bad state I found an interesting js error posted when the app first starts (making it hard to bebug):

D/GeckoPushService: Registered Gecko event listener.
I/GeckoPushService: Starting up.
I/GeckoPushService: FxA account not in Married state, not proceeding with registration renewal
I/Gecko: console.error: PushService:
I/Gecko: console.error: PushService:
I/Gecko: Message: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIObserverService.removeObserver]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: resource://gre/modules/PushService.jsm :: _stopObservers :: line 642" data: no]
Stack:
_stopObservers@resource://gre/modules/PushService.jsm:642:18
_stopService@resource://gre/modules/PushService.jsm:602:10
_changeServerURL@resource://gre/modules/PushService.jsm:444:21
_shutdownService@resource://gre/modules/PushService.jsm:649:33
_stateChangeProcessEnqueue/this._stateChangeProcessQueue<@resource://gre/modules/PushService.jsm:148:21

Which if followed tells the story of having the push messages state changed
(before our service is fully initialized)
followed by an operation which errors and as result we shutdown.
Shutdown process which wants to remove some observers,
observers which were not yet registered so a js exception gets thrown
and so the rest of the code in the _shutdownService is not executed
leaving us with the state from before the shutdown - PUSH_SERVICE_ACTIVATING

Then when we try to clear siteInfo we first check the state
and because that is PUSH_SERVICE_ACTIVATING we return a Promise which because of the above error will never resolve
and so the entire quit process will wait indefinetly.

For the above scenario, the simple but efficient solution I went with was to just wrap those calls in the _stopObservers in a try-catch
so that even if somehow we would try to unregister erroneously, this would not break the code that follows.

Try build with my changes applied on top of latest esr68 - https://treeherder.mozilla.org/#/jobs?repo=try&revision=18c86ea18328eddb23ee7205150e1796cd1d8253

Please help test if the issue is reproducing anymore.

Flags: qe-verify+

I have tested the try build on a Samsung Galaxy S9 (Android 8.0.0) and a Samsung Galaxy S8+ (Android 8.0.0) and the issue no longer occurs. I will leave the qe-verify+ flag until the fix is uplifted to Beta and the issue will be retested.

Comment on attachment 9107526 [details]
Bug 1581805 - Prevent unregistering observers from leaving PushService in a bad state; r?VladBaicu

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Simple fix for an intermittent issue: trying to clear Site settings from the Quit option would not work.
  • User impact if declined: Intermittent failure of clearing private data - Site Settings.
    Intermittent failure to close app from the Quit menu option
  • Fix Landed on Version:
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Simple fix - a try-catch, verified by QA.
  • String or UUID changes made by this patch:
Attachment #9107526 - Flags: approval-mozilla-release? → approval-mozilla-esr68?

Comment on attachment 9107526 [details]
Bug 1581805 - Prevent unregistering observers from leaving PushService in a bad state; r?VladBaicu

Fixes Fennec getting into a state of being unable to quit from the menu in some cases. Approved for Fennec 68.3b4.

Attachment #9107526 - Flags: approval-mozilla-esr68? → approval-mozilla-esr68+
QA Whiteboard: [qa-triaged]

I have tested the issue on Beta 68.3b4 using a Samsung Galaxy S9 (Android 8.0.0) and a Samsung Galaxy S8+ (Android 8.0.0) and the issue no longer occurs. I will mark the issue accordingly.

Flags: qe-verify+

I have retested the issue on RC 68.2.1 using a Samsung Galaxy S9 (Android 8.0.0) and a Samsung Galaxy S8+ (Android 8.0.0) and the issue reoccurs following the steps from comment 6.

This fix wasn't included in 68.2.1 (nor is it planned to go out in a 68.2.x release). Verifying on 68.3 is sufficient.

Hi, I have retested the issue on Firefox Release 68.3.0 based on steps from Comment 6 with

  • Samsung Galaxy S8+ (Android 8.0.0) - the issue still reproduces
  • Samsung Galaxy S9 (Android 8.0.0) - the issue does not reproduce
  • Sony Xperia Z5 (Android 7.0)- the issue does not reproduce

Note:

  • For the device on which the issue reproduces - i did encounter as outcome, when the application did not closed after a couple of minutes and when it closed after an average of 1 minute.

I'm confused because comment 22 said that the problem was no longer reproducible on the Samsung Galaxy S8+ (Android 8.0.0) with 68.3b4?

I'm confused because comment 22 said that the problem was no longer reproducible on the Samsung Galaxy S8+ (Android 8.0.0) with 68.3b4?

I retested the issue on Beta 68.4b1 and Release 68.3.0 on the Samsung Galaxy S8+ (Android 8.0.0) and was only able to reproduce the issue on the Release. I don't know why I am only able to reproduce it only on 68.3.0, the only difference I noticed when performing the steps is that Beta has and extra option when tapping the 3 dots menu: "Report site issue".
Another thing I would like to point out is that now the issue happens very rarely, about once in 20-30 tries compared to 2-3 tries when the issue was initially reported and while Firefox seems to not close, it will after 1-2 minutes.

Given that the patch from this bug clearly improved the situation, I'm going to propose that we track the remaining issues in a new bug so we can better track the state of things. Does that work for you?

Flags: needinfo?(laurentiu.apahidean)

Yes, I have submitted bug 1604214 with the updated behavior. I will set this issue as RESOLVED FIXED.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(laurentiu.apahidean)
Resolution: --- → FIXED

Thanks!

Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: