Evince snap does not open comic book file (cbr) while deb does so

I can confirm the issue.
When I try to open a cbr file, evince displays a ribbon that reads:

Unable to open document “file:///home/foobar/Documents/comicbook.cbr”.
File type RAR archive (application/vnd.rar) is not supported

And on the terminal I’m seeing:

(evince:28354): EvinceDocument-WARNING **: libarchive.so.13: cannot open shared object file: No such file or directory

This merge request should fix the issue.

Thanks. That was quick.

Regards

Prashant L Rao

I’ve just published the fix to the stable channel, thanks for the report!

I updated the snap and now it crashes when I attempt to open a CBR file
with the following displayed in the terminal:
(evince:16087): Gtk-WARNING **: Error loading theme icon ‘dialog-password’
for stock: Icon ‘dialog-password’ not present in theme Papirus

(evince:16087): GLib-GIO-WARNING **: Error creating IO channel for
/proc/self/mountinfo: Permission denied (g-file-error-quark, 2)
Error registering document:
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy
prevents this sender from sending this message to this recipient;
type=“method_call”, sender=":1.257" (uid=1000 pid=16087 comm=“evince “)
interface=“org.gnome.evince.Daemon” member=“RegisterDocument” error
name=”(unset)” requested_reply=“0” destination=“org.gnome.evince.Daemon”
(uid=1000 pid=4510 comm="/usr/lib/evince/evinced ")

I’m seeing those same warnings (except for the theme one) when opening a cbr file with the snap from the stable channel, but the file is open and rendered correctly, no crash here.

Can you confirm this is really a crash? i.e., does the evince window abruptly close when opening the file, without feedback?

Does this happen with other files (other CBRs, PDFs, …)?

It’s a crash all right. The evince window disappears. What’s worse is that subsequent attempts to run evince result in a straight crash without the evince window ever appearing and the following terminal output.
(evince:19034): Gtk-WARNING **: Error loading theme icon ‘dialog-password’ for stock: Icon ‘dialog-password’ not present in theme Papirus
**
Gtk:ERROR:/build/gtk+3.0-24RAPQ/gtk+3.0-3.22.24/./gtk/gtkrecentmanager.c:1999:get_icon_fallback: assertion failed: (retval != NULL)
Aborted

I am able to get the snap running again by doing an rm -rf on the snap/evince folder.

I’m facing the same issue with a CBZ file. Ditto for PDF.

I am running Ubuntu 16.04 with the backported gnome-3-26-1604 platform stack. Perhaps that has something to do with it?

I don’t have a .cbr file, but I installed evince and gnome-3-26-1604 on xenial, and I was able to view PDFs just fine.

I removed the stable snap and installed the candidate and everything (PDF, CBR) opens fine in that one. However, the same errors are still output to the terminal so that does not seem to be the reason for the stable version crashing.

Another thing, when I remove the stable snap and re-install it does not seem to download a fresh copy. Is there a way to remove the cache? I think something might be corrupted there.

I did a refresh this morning and am running evince stable (24).

On the first run, evince opens all files perfectly (PDF, CBR etc). On the second run it crashes and continues to crash till I rm -rf the snap/evince folder and force a first run situation again. Please see the terminal output below.

BTW, this was the case with the candidate as well as the previous stable too. I just hadn’t realized it till I tried using it in earnest.

–First run–
[prashant@prashant-Vostro-3558 ~ ]$ snap run evince

(evince:18177): Gtk-WARNING **: Error loading theme icon ‘dialog-password’ for stock: Icon ‘dialog-password’ not present in theme Papirus

(evince:18177): GLib-GIO-WARNING **: Error creating IO channel for /proc/self/mountinfo: Permission denied (g-file-error-quark, 2)
Error registering document: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=":1.289" (uid=1000 pid=18177 comm=“evince “) interface=“org.gnome.evince.Daemon” member=“RegisterDocument” error name=”(unset)” requested_reply=“0” destination=“org.gnome.evince.Daemon” (uid=1000 pid=14668 comm="/usr/lib/evince/evinced ")
Entity: line 1: parser error : Start tag expected, ‘<’ not found
�l7L�����
^

(evince:18177): GLib-GIO-WARNING **: Error creating IO channel for /proc/self/mountinfo: Permission denied (g-file-error-quark, 2)
Error registering document: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=":1.290" (uid=1000 pid=18319 comm="/snap/evince/current/usr/bin/evince /home/prashant") interface=“org.gnome.evince.Daemon” member=“RegisterDocument” error name="(unset)" requested_reply=“0” destination=“org.gnome.evince.Daemon” (uid=1000 pid=14668 comm="/usr/lib/evince/evinced ")

(evince:18319): Gtk-WARNING **: Error loading theme icon ‘dialog-password’ for stock: Icon ‘dialog-password’ not present in theme Papirus

—Second run–

[prashant@prashant-Vostro-3558 ~ ]$ snap run evince

(evince:18326): Gtk-WARNING **: Error loading theme icon ‘dialog-password’ for stock: Icon ‘dialog-password’ not present in theme Papirus
**
Gtk:ERROR:/build/gtk+3.0-24RAPQ/gtk+3.0-3.22.24/./gtk/gtkrecentmanager.c:1999:get_icon_fallback: assertion failed: (retval != NULL)
Aborted
[prashant@prashant-Vostro-3558 ~ ]


I can reliably reproduce the crash by installing and switching to the papirus icon theme. Switching back to another theme (ubuntu-mono-dark) “fixes” the application.

The code that triggers the assertion and the crash is https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/gtk/gtkrecentmanager.c#L1999.

This is similar to bug #651678.

Not sure why this is happening though, as papirus inherits from a number of other themes that should have the icon that it’s trying to load:

$ grep Inherits /usr/share/icons/Papirus/index.theme
Inherits=breeze,ubuntu-mono-dark,gnome,hicolor

Deleting $HOME/snap/evince/current/.local/share/recently-used.xbel also makes the app start again.
I can observe the crash even when there’s only one document in the recently used, with mime type application/pdf, which suggests that GTK fails to find an icon for that mime type in the theme. However:

$ dpkg -L papirus-icon-theme | grep application-pdf
/usr/share/icons/Papirus/16x16/mimetypes/application-pdf.svg
/usr/share/icons/Papirus/22x22/mimetypes/application-pdf.svg
/usr/share/icons/Papirus/24x24/mimetypes/application-pdf.svg
/usr/share/icons/Papirus/32x32/mimetypes/application-pdf.svg
/usr/share/icons/Papirus/48x48/mimetypes/application-pdf.svg
/usr/share/icons/Papirus/64x64/mimetypes/application-pdf.svg

And evince from the ubuntu package correctly loads that icon when the thumbnail cache is empty.

Solved it. The dialog-password icon is in the Humanity theme. Once I added that to the inherits portion of Papirus, evince started working. Go figure!

Pretty fragile, though, I must say if it borks on a missing icon. :slight_smile:

My bad. I typed too soon. Same issue. First run is fine. Then it crashes. I give up. The icon in question is, in fact, present in other icon themes like Adwaita & gnome but the app crashes even with those. Odd.

The dialog-password icon warning is a red herring I think.
Given that the crash happens in get_icon_fallback() in gtkrecentmanager.c, I suspect that the application fails to load a generic PDF/CBR mimetype icon that it wants to display before a thumbnail is generated for the recent file.

The crash goes away if I do:

cp -R /usr/share/icons/Papirus ~/snap/evince/current/.local/share/icons/

So the issue really happens because the snap is unable to find an icon from the current theme.

This other thread discusses exposing system themes to snaps, as snaps.

evince does not detect installed printers

This merge request should fix it (and we should probably request auto-connection of the cups-control plug once this is merged and published).

1 Like

Merged and now available in the stable channel. If you update the snap, you should be able to print after issuing the following command:

snap connect evince:cups-control

And I have requested auto-connection for that interface.