Closed Bug 1550074 Opened 6 years ago Closed 4 years ago

Firefox doesn't restart after being updated via package manager on Linux

Categories

(Core :: Widget: Gtk, defect, P3)

66 Branch
defect

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: mathieu.tarral, Assigned: zawertun)

Details

Attachments

(4 files, 3 obsolete files)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

I updated Firefox on Fedora using my package manager dnf.
I was aked to restart Firefox, and clicked "restart" button.

I was running Firefox 66.0.x, and I updated to the latest version available: 66.0.4

Actual results:

Firefox process terminated, but didn't retarted

Expected results:

Firefox should have restarted

Hi Mathieu, I've tested this on Ubuntu 16.04 with FF release 66.0.4 and I was able to update the version to FF release 66.0.5. Please try to update to FF release 66.0.5.

Flags: needinfo?(mathieu.tarral)

Hi,

thanks for the reply.

I just upgraded to Firefox 66.0.5 this evening, and i started a desktop capture to show you that Firefox doesn't restart.

Please look at the next attachment.

Thanks !

Flags: needinfo?(mathieu.tarral)
Attached video firefox_no_restart.mp4

Video demonstrating a Firefox 66.0.4, running on Fedora 29.

I started a DNF system upgrade, and Firefox has already been upgraded in the background to 66.0.5.

I'm waiting for Firefox to detect it, and then to click on restart, only to see that Firefox doesn't restart as expected.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Priority: -- → P3

I can confirm the same thing is happening on Ubuntu 18.04.2 LTS
just upgrade to FF 67.0.1 (64-bit)

I’m seeing the same thing on two different computers using Ubuntu Mate. This has been happening for at least the last 10 updates.

Hi,

I'm the bug reporter, 5 months ago, and this is still happening today (Firefox 69.0.1).

Other people confirmed it, so what's the status of this bug ?
Have you been investigating ?

Hi,

This happened again, with Firefox 68.0.2

I can confirm this issue on Ubuntu 16.04/18.04 & Mint 19.2 with FF 70 We also have the tabs not reloading after manually starting the browser.

Especially the last part is quite disruptive for our users.

I can also confirm this to be the case on Ubuntu 20.04.1 LTS when I clicked restart after Firefox was updated to v80.0.

Attached image Selection_00760.png

There is bug when Firefox tries to restart itself with call to the "execve".
If I run Firefox under the strace I'll see this output while clicking "Restart Firefox" button:

readlink("/proc/self/exe", "/usr/lib64/firefox/firefox (dele"..., 4095) = 36
execve("/usr/lib64/firefox/firefox (deleted)", ["/usr/lib64/firefox/firefox"], 0x7f0aad04f000 /* 112 vars */) = -1 ENOENT (No such file or directory)

To fix this bug call to the "execve" must be replaced with something like "fexecve", see this stackoverflow question: https://stackoverflow.com/questions/28953307/how-to-handle-readlink-of-proc-self-exe-when-executable-is-replaced-during.

Similar bugs in the Fedora bugtracker (I'm using Firefox on the Fedora x86_64).

  1. https://bugzilla.redhat.com/show_bug.cgi?id=1876214
  2. https://bugzilla.redhat.com/show_bug.cgi?id=1804293.

The code I'm talking about is placed in the file "ipc/chromium/src/base/process_util_linux.cc", function bool LaunchApp(argv, options, process_handle).

Firefox code that was calling readlink is not taking into account that returned path on Linux can include postfix " (deleted)".
(see: https://stackoverflow.com/a/58105245).

And because returned path ends with "firefox (deleted)" - we got ENOENT later, when calling execve.

Attached patch firefox-fix-restart.patch (obsolete) — Splinter Review

This small patch removes postfix " (deleted)" from the exe path, so issue with restart will be fixed.

Bug can be simply reproduced with this steps:

  1. Start Firefox;
  2. Run those commands in terminal:
sudo mv /usr/lib64/firefox/firefox /usr/lib64/firefox/firefox.new`;
sudo cp -v /usr/lib64/firefox/firefox.new /usr/lib64/firefox/firefox
  1. Open page about:restartrequired in the Firefox and click button "Restart Firefox".

Before patch Firefox won't restart.
After patch applied Firefox restarts as expected.

Great! Please submit the patch via phabricator so we can check it into mozilla tree (https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html).
Thanks.

Just submitted patch on phabricator + there is fixed version of test plan in the comments.

Assignee: nobody → zawertun
Status: UNCONFIRMED → NEW
Ever confirmed: true

ZaWertun, can you please regenerate the patch? it must be without the "firefox" prefix in filename path, i.e. "xpcom/build/BinaryPath.h" instead of "firefox/xpcom/build/BinaryPath.h".
Thanks.

Flags: needinfo?(zawertun)
Attached patch firefox-fix-restart.patch (obsolete) — Splinter Review
Attachment #9175171 - Attachment is obsolete: true
Flags: needinfo?(zawertun)
Attachment #9180647 - Attachment is obsolete: true

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:zawertun, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(zawertun)

ZaWertun, please update the patch in Phabricator. It can't be landed from Bugzilla.
Thanks.

I regenerated the patch as a new one to allow check-in.

Flags: needinfo?(zawertun)
Attachment #9175230 - Attachment is obsolete: true
Pushed by malexandru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f903eb4c6a07 Firefox doesn't restart after being updated via package manager on Linux, r=jhorak
Attachment #9175230 - Attachment is obsolete: false
Pushed by cbrindusan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a888688ae24e Firefox doesn't restart after being updated via package manager on Linux, r=jhorak
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
Attachment #9175230 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: