After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 583680 - evince should allow multiple processes
evince should allow multiple processes
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
2.24.x
Other All
: Normal enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 585403 (view as bug list)
Depends on: 586841
Blocks: 598647
 
 
Reported: 2009-05-23 20:50 UTC by snarkmaster
Modified: 2009-10-20 17:20 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description snarkmaster 2009-05-23 20:50:34 UTC
Currently, evince uses a single process to display all documents.

Unfortunately, evince still has crash bugs (which I try to report), and it probably will have them for the foreseeable future.

However, I often have 10+ documents open, collecting data from all of them. If I happen to open a bad PDF, all of them will crash. It can take a lot of time to find the documents, and the right pages again.

A different bug is also caused by the "one process, many documents" model:
https://bugzilla.redhat.com/show_bug.cgi?id=456475

The single-process model also potentially opens the door to privilege escalation bugs, where the initial instance of evince is allowed to do something that the subsequent ones would not have been.

Memory, on the other hand, is cheap, and the overhead of separate processes can be low (see, e.g. Google Chrome).

Thus, I propose that it would be a good idea to have evince (at least *optionally*), behave as a single window-single process application.
Comment 1 Carlos Garcia Campos 2009-05-25 07:59:25 UTC
Evince recovers now the previous session when it's run after a crash. See bug #578894. You can avoid single-process by building evince without DBus support. 

Thanks for reporting. 
Comment 2 snarkmaster 2009-05-25 08:34:52 UTC
Is it a lot of trouble to add make a runtime switch to disable this single-process behavior?

For example, gnome-terminal, which needs multiple processes a lot less often than does evince, has a nice "--disable-factory" option which does just that. 

I have some doubts about using a factory design for evince in the first place, but that's probably not the right forum for this discussion :)
Comment 3 Nickolay V. Shmyrev 2009-05-25 21:17:23 UTC
I think it's not about recovery indeed. It's about stability, one document shouldn't affect others. That's why browsers move for multiprocess for example. We could also do this way and benefit from memory protection and bug isolation but the issue here is cooperation with metadata storate.
Comment 4 Nickolay V. Shmyrev 2009-06-11 08:33:06 UTC
*** Bug 585403 has been marked as a duplicate of this bug. ***
Comment 5 Carlos Garcia Campos 2009-08-03 14:17:19 UTC
One of the main features that take advantage of the single instance approach is metadata, however it wouldn't be necessary if we use GIO to store the metadata (see bug #586841) instead. Is there any other feature that justifies single instance?
Comment 6 Christian Persch 2009-08-03 16:08:09 UTC
> Is there any other feature that justifies single instance?

How about the feature where we present an existing window when you open an already open file again?
Comment 7 Carlos Garcia Campos 2009-08-03 17:09:12 UTC
(In reply to comment #6)
> How about the feature where we present an existing window when you open an
> already open file again?
> 

Good point. This might be implemented with dbus, similar to gvfs approach, a general daemon that routes messages and one process per mount (per document in our case). 

Comment 8 Carlos Garcia Campos 2009-10-13 17:24:31 UTC
hmm, there's another thing we should handle in a centralized way, the crash recovery stuff. I think normal session management can be handled separately by every window/process, but the crashed session have to be handled somehow by the main daemon.
Comment 9 Carlos Garcia Campos 2009-10-13 18:50:57 UTC
wait, I guess crash recovery doesn't make sense anymore in multi-process approach ...
Comment 10 Carlos Garcia Campos 2009-10-20 17:20:57 UTC
Fixed in git master.