News for hackers. Stuff that matters.
Re:Ubuntu Snap update spoiled my World Cup Final by franga2000 on Sunday December 18, 2022 @06:41PM (#34045776)
This is a consequence of most Linux package managers not caring if apps are running and updating their files anyways. Firefox does this because it would crash otherwise (as most other software does when you pull its files from underneath it). If it happens frequently, you must have automatic live updates enabled - maybe you don't on Fedora and that's why you don't see that happen?

On Windows, where no standard update mechanism exists, Firefox updates itself, so it does it only when it knows it's fully shut down (before it opens or after you close all windows).

Re:Ubuntu Snap update spoiled my World Cup Final by reisse on Sunday December 18, 2022 @06:50PM (#34045916)
No, Fedora package manager (dnf) does the sane thing and not replaces app files from under the running apps by default - google "dnf offline upgrades".

And for Windows there is standard update mechanism - Microsoft Store - which also does the same sane thing.

So it's Ubuntu implementation problem, and not a Firefox one.

Re:Ubuntu Snap update spoiled my World Cup Final by noisem4ker on Sunday December 18, 2022 @07:40PM (#34046532)
>dnf offline upgrades

Do I understand correctly that it is based on systemd's offline upgrade mode, i.e. installation is done at the following boot? If so, you can do that on Ubuntu too. I'm not sure how (perhaps by invoking apt-offline?), but at least KDE Discover does it on Kubuntu.

Re:Ubuntu Snap update spoiled my World Cup Final by toast0 on Sunday December 18, 2022 @10:24PM (#34048029)
> Firefox does this because it would crash otherwise (as most other software does when you pull its files from underneath it).

Most software does fine, as long as it has already mapped in all of its libraries, those files can be unlinked in the filesystem, but will remain on disk in their current form. You do run into trouble if the software is part way through starting up and hasn't mapped all the libraries, or if you update the files rather than unlinking and copying new ones (at least, FreeBSD lets you update mmaped files and all processes will see the updates, which is usually not what you actually want when the files are code).

Windows makes it very hard to update program files while programs are running, so it's not surprising Firefox endeavors to do updates while it's not running.

Re:Ubuntu Snap update spoiled my World Cup Final by iggldiggl on Monday December 19, 2022 @07:07AM (#34051155)
Due to the way multi-process browsing works, Firefox at any time still needs to be able to launch new processes in order to accommodate new tabs, or thanks to site-isolation possibly even browsing to a different origin within the same tab. Once the old binaries have been unlinked, I assume there is no longer a sane way of launching a new process using the old binaries?
Re:Ubuntu Snap update spoiled my World Cup Final by toast0 on Monday December 19, 2022 @11:35AM (#34054073)
At start, you could start a new seed process, map all the libraries and what not, but don't do any browsing work... When it's time to launch an isolated process, fork the seed process and use the child.

This doesn't seem insane to me, but might not be an easy thing to fit in to the large body of code that's already there.

You still have issues if you're starting up during an upgrade, but that's a problem with anything dynamically linked.

Re:Ubuntu Snap update spoiled my World Cup Final by iggldiggl on Tuesday December 20, 2022 @04:53AM (#34063800)
Doesn't using fork make it more difficult to cleanly separate the various child processes from each other? It also makes address space layout randomisation less effective, because every forked process starts out with the same base memory layout, doesn't it?
Re:Ubuntu Snap update spoiled my World Cup Final by toast0 on Wednesday December 21, 2022 @09:05PM (#34088839)
> Doesn't using fork make it more difficult to cleanly separate the various child processes from each other?

I don't think so? As long as the main process is separate from the seed process, and the seed process is forked before specialization.

> It also makes address space layout randomisation less effective, because every forked process starts out with the same base memory layout, doesn't it?

Yeah, I think you're right. Not sure if you could maybe do some randomization post fork, but you're probably right.