GNOME Bugzilla – Bug 705638
Failure to print sheet object widgets from ssconvert
Last modified: 2013-08-09 19:22:18 UTC
SIGABRT on converting a fuzzed ods file to a pdf. Git versions of glib, goffice, gnumeric, libgsf and libxml2. Test case: http://jutaky.com/fuzzing/gnumeric_case_16172_1848.2pdf.ods Backtrace from "ssconvert gnumeric_case_16172_1848.2pdf.ods out.pdf": Program received signal SIGABRT, Aborted. 0x00007ffff32591c9 in raise () from /usr/lib/libc.so.6 (gdb) bt
+ Trace 232356
-- Juha Kylmänen Research Assistant, OUSPG
This appears to happen far inside GTK.
Lots of issue here. One is bug 705640.
Created attachment 251111 [details] proposed patch This patch skips printing the sheet widgets when no default gdk screen is set. This avoids the crash in question, and does not affect printing from within Gnumeric.
Created attachment 251114 [details] [review] completed patch Patch to avoid crashing.
Patch committed, but we now fail to print sheet object widgets from within ssconvert.
Sure beats a crash!
Checkboxes and radio buttons are now again printed under ssconvert too. I retrieved some old code we were using while the gtk offscreen drawing didn't work correctly. Note that at that time we had used a GtkStyle to retrieve teh font information but that does not seem to work under ssconvert. So I fell back on hardcoding the font to be used for the moment.
The remaining sheet widget objects are now also printable from ssconvert.
With the last changes, the text in sheet object widgets is no longer printed under ssconvert. With GNM_DEBUG=so-font I get: font=Normal 0 which leads to no text!
I have add some fallbacks to get_font. Note: Under gnumeric, we appear to get a proper font using GtkStyleContext. Under ssconvert, some seem to get a proper font using GtkStyleContext, some don't. Those get one using the Gsettings. The 'sans 10' is just insurance. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.