GNOME Bugzilla – Bug 755776
Segmentation fault
Last modified: 2016-09-03 06:40:51 UTC
Created attachment 312348 [details] A PostScript file. A PDF version of this file works fine (evince:5036): GLib-GObject-WARNING **: The property GtkSettings:gtk-menu-imagesis deprecated and shouldn't be used anymore. It will be removed in a future version
It does not crash with EV_JOBS=1, although it has problems to render a part of the document (like some bits shifted or so). This is gdb ouput: (gdb) r /tmp/jamie.ps Starting program: /home/gpoo/code/evince/install/bin/evince /tmp/jamie.ps [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffecb69700 (LWP 3062)] (evince:3054): GLib-GObject-WARNING **: The property GtkSettings:gtk-menu-images is deprecated and shouldn't be used anymore. It will be removed in a future version. [New Thread 0x7fffed5f0700 (LWP 3061)] [New Thread 0x7fffedfee700 (LWP 3060)] [New Thread 0x7fffee7ef700 (LWP 3059)] [New Thread 0x7fffeeff0700 (LWP 3058)] Program received signal SIGSEGV, Segmentation fault. sse2_blt (src_bits=<optimized out>, dst_bits=<optimized out>, src_stride=<optimized out>, dst_stride=<optimized out>, src_bpp=<optimized out>, src_x=<optimized out>, src_y=108, dest_x=0, dest_y=0, width=1223, height=<optimized out>, dst_bpp=<optimized out>, imp=<optimized out>) at ../../pixman/pixman-sse2.c:4767 4767 ../../pixman/pixman-sse2.c: No such file or directory. (gdb) thread apply all bt
+ Trace 235500
Thread 1 (Thread 0x7ffff7fb8880 (LWP 3054))
There are other documents that cause this crash in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766836 and the several merged bugs. I found this commit with git bisect: commit 6b50ba7172d84de19f1215bed289698d82ea4187 Author: Owen W. Taylor <otaylor@fishsoup.net> Switch to specifying rendered output in pixels, not as a scale Adding Owen to CC list to see if he can comment. It looks kind of like the width and height are getting mixed up.
Created attachment 328351 [details] [review] Fix scaling calculation Since the change to specify rendering output in pixels instead of a scale, the scaling passed to spectre_render_context_set_scale has the width and height swapped for rotated documents. This fixes the scaling calculation. The rendering will still be wrong because it runs into https://bugs.freedesktop.org/76450 from libspectre (Documents are not rotated correctly), but this fixes the crash, and the rendering works if I test with a patched libspectre.
Comment on attachment 328351 [details] [review] Fix scaling calculation Thanks!
Created attachment 330475 [details] Sample file to crash Evince after rotating/scaling or scaling/rotating Applying the patch, rebuilding Evince and installing it in `/usr/local/bin`, running it from there, it crashes with the attached file. You need to rotate the file, and zoom in/out (or have done it before).
(In reply to Paul Menzel from comment #5) > Applying the patch, rebuilding Evince and installing it in `/usr/local/bin`, > running it from there, it crashes with the attached file. I don't see any crashes after patching evince. I just see some UI glitches and 'matrix not invertable' warning messages and those are fixed by running an updated libspectre. Does it work if you also use the latest libspectre from git master?
Did you try the attached EPS file?
(In reply to Paul Menzel from comment #7) > Did you try the attached EPS file? Yes, I tried it with your crash-evince.eps file. With the patch applied, I can't get it to crash, though I do see UI glitches and matrix not invertible warnings. I would not be too surprised if it did crash because I'm not sure what libspectre does when it does the rotation wrong, but the latest libspectre should fix that. Have you tried it with both a patched evince and an updated libspectre?
(In reply to Jason Crain from comment #8) > (In reply to Paul Menzel from comment #7) > > Did you try the attached EPS file? > > Yes, I tried it with your crash-evince.eps file. With the patch applied, I > can't get it to crash, though I do see UI glitches and matrix not invertible > warnings. I would not be too surprised if it did crash because I'm not sure > what libspectre does when it does the rotation wrong, but the latest > libspectre should fix that. Have you tried it with both a patched evince > and an updated libspectre? I now installed libspectre 0.2.8 containing the changes, and even unpatched Evince 3.20.1 doesn’t crash when rotating the EPS. So it seems to be a different problem. Sorry f or the noise.
Jason, it seems your patch is not yet committed. Is there any reason?
(In reply to José Aliste from comment #10) > Jason, it seems your patch is not yet committed. Is there any reason? Um.. hold off on this patch for now. From looking at this after not having worked on it for a while, I see: 1. The crash and rotation are fixed by the latest libspectre. 2. The width and height calculation in evince is not the cause of the crash, but is still wrong. The effect is that the aspect ratio of the thumbnails in the sidebar is wrong and resolution in the main window is wrong. My patch maybe improves it a little but it's still not correct. Give me a day or two to fix it.
Created attachment 332751 [details] [review] Fix-scaling-calculation.patch Improved patch. Previous version had an interaction between evince's rotation and the document's internal rotation so it got the aspect ratio and scaling wrong for some rotations.
Should the ticket summary/title be updated or a new ticket be created, as the segmentation fault has been fixed already?
Comment on attachment 332751 [details] [review] Fix-scaling-calculation.patch Pushed, thanks!