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 565174 - Evince crashes with cb7 files
Evince crashes with cb7 files
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: backends
git master
Other All
: Normal critical
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-20 14:36 UTC by Juanjo Marín
Modified: 2009-05-20 23:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rework of the management of the family of p7zip commands for cb7 support. Fixes bug #565174. (2.60 KB, patch)
2008-12-23 19:59 UTC, Juanjo Marín
none Details | Review
Support for cb7 using the p7zip commands. Fixes bug #565174. (4.52 KB, patch)
2009-05-18 17:37 UTC, Juanjo Marín
committed Details | Review

Description Juanjo Marín 2008-12-20 14:36:52 UTC
Steps to reproduce:
Just open a cb7 file, it shows the following error message:
ERROR:ev-page-cache.c:420:ev_page_cache_new: assertion failed: (page_cache->uniform_width > 0 && page_cache->uniform_height > 0)
Cancelado



Stack trace:


Other information:
Comment 1 Juanjo Marín 2008-12-20 14:54:29 UTC
The problem is because the selected list_files_command doesn't work:

    list_files_command = g_strdup_printf ("7zr l -- %s", quoted_file);

I suggest to change it to the following:

    list_files_command = g_strdup_printf ("/bin/sh -c \"7zr l -- %s | cut -c54-\"", quoted_file);

list_files_command must provide a list of lines with the name of the files _at_the_begining_ of the lines. It is enough to filter the output to eliminate the previous information that cause the mess.



Exemple:

A) The output from the current list_files_command:
jjmarin@midgard:~/src/gnome/svn/evince$ 7zr l -- ~/Escritorio/prueba.cb7 
[...eliminated....]
   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2006-09-05 15:05:20 ....A        93981       209006  prueba/z-tag.jpg
2008-12-12 20:59:17 ....A       184849               prueba/Z35_R_tandorired.jpg
2008-12-16 19:11:07 D....            0            0  prueba
------------------- ----- ------------ ------------  ------------------------
                                278830       209006  2 files, 1 folders

B) The output from the proposed list_files_command:
jjmarin@midgard:~/src/gnome/svn/evince$ 7zr l -- ~/Escritorio/prueba.cb7 | cut -c54-
[...eliminated....]
Name
------------------------
Red Rocket 7 01 [1997] (Slinky J)/z-tag.jpg
Red Rocket 7 01 [1997] (Slinky J)/Z35_R_tandorired.jpg
Red Rocket 7 01 [1997] (Slinky J)
------------------------
2 files, 1 folders
Comment 2 Juanjo Marín 2008-12-20 22:44:06 UTC
The solution proposed seems to work, but 7z it's sloooooow. 

jjmarin@midgard:~$ time 7z x -so -- 'archive' 'file.jpg' 2>/dev/null 3>/dev/null 1>~/Desktop/7z.jpg

real	0m3.684s
user	0m3.392s
sys	0m0.048s
jjmarin@midgard:~$ time unrar p -c- -ierr -- 'archive' 'file.jpg' 2>/dev/null 3>/dev/null 1>~/Desktop/7z.jpg

real	0m0.041s
user	0m0.024s
sys	0m0.016s

We have to consider seriourly to decompress only once in the tmp instead of decompressing to the stdout several times.

Another issue to consider is the existence of several versions of 7zip called 7z, 7za and 7za that should be supported.

Comment 3 Juanjo Marín 2008-12-23 19:59:51 UTC
Created attachment 125222 [details] [review]
Rework of the management of the family of p7zip commands for cb7 support. Fixes bug #565174.

It needs patch from bug 562143 (Fix cb7 mime-type support in comics backend) be applied before applying this one.
Comment 4 Juanjo Marín 2009-01-11 20:27:30 UTC
I'm working on a more general patch for this bug. I think that it is necesary to make more changes in order to obtain a more clear and better code.

I'll report this new and better pacth on the 552074 bug page.
Comment 5 Juanjo Marín 2009-05-18 17:37:35 UTC
Created attachment 134884 [details] [review]
Support for cb7 using the p7zip commands. Fixes bug #565174.
Comment 6 Juanjo Marín 2009-05-18 19:27:25 UTC
nsh: isn't g_strstrip already return a copy?

No, g_strstrip doesn't allocate or reallocate any memory; it only modifies string in place.
Comment 7 Nickolay V. Shmyrev 2009-05-20 23:09:18 UTC
Thanks