News for hackers. Stuff that matters.
Re:Ubuntu: “How are we improving Firefox snap performance?” by mort96 on Saturday September 03, 2022 @11:59AM (#32703143)
It unlinks the old file paths and creates new ones in their place. Files in Linux are reference counted, and they're only actually marked as deleted on disk once the reference count goes to 0; a directory entry is one reference, but the running process is also a reference, so even though the path /usr/bin/firefox has been replaced with a new file, the old file is still in use by the existing Firefox process. When you stop Firefox, the refcount for the old file will drop to 0, and when you start it again, the new /usr/bin/firefox will be launched.

The same idea applies to all libraries, where the old version of say /usr/lib/firefox/libxul.so can still be referenced by the running firefox process even after apt has replaced it with a new version.

It's not a great system honestly, Firefox will launch new processes sometimes and the IPC system kinda breaks down when the parent process and the child process are from different Firefox versions.

There are no comments on this comment yet.