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 705638 - Failure to print sheet object widgets from ssconvert
Failure to print sheet object widgets from ssconvert
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Printing
git master
Other Linux
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on: 705640
Blocks:
 
 
Reported: 2013-08-07 18:54 UTC by jutaky
Modified: 2013-08-09 19:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1020 bytes, text/x-c)
2013-08-07 23:47 UTC, Andreas J. Guelzow
  Details
completed patch (1.90 KB, patch)
2013-08-08 01:53 UTC, Andreas J. Guelzow
none Details | Review

Description jutaky 2013-08-07 18:54:41 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
  • #0 raise
    from /usr/lib/libc.so.6
  • #1 abort
    from /usr/lib/libc.so.6
  • #2 _g_log_abort
    at gmessages.c line 255
  • #3 g_assertion_message
  • #4 g_assertion_message_expr
    at gtestutils.c line 2086
  • #5 ??
    from /usr/lib/libgtk-3.so.0
  • #6 ??
    from /usr/lib/libgtk-3.so.0
  • #7 ??
    from /usr/lib/libgtk-3.so.0
  • #8 ??
    from /usr/lib/libgtk-3.so.0
  • #9 ??
    from /usr/lib/libgtk-3.so.0
  • #10 ??
    from /usr/lib/libgtk-3.so.0
  • #11 ??
    from /usr/lib/libgtk-3.so.0
  • #12 ??
    from /usr/lib/libgtk-3.so.0
  • #13 ??
    from /usr/lib/libgtk-3.so.0
  • #14 ??
    from /usr/lib/libgtk-3.so.0
  • #15 ??
    from /usr/lib/libgtk-3.so.0
  • #16 ??
    from /usr/lib/libgtk-3.so.0
  • #17 gtk_widget_get_preferred_size
    from /usr/lib/libgtk-3.so.0
  • #18 ??
    from /usr/lib/libgtk-3.so.0
  • #19 ??
    from /usr/lib/libgtk-3.so.0
  • #20 g_cclosure_marshal_VOID__VOIDv
    at gmarshal.c line 115
  • #21 g_type_class_meta_marshalv
    at gclosure.c line 997
  • #22 _g_closure_invoke_va
    at gclosure.c line 840
  • #23 g_signal_emit_valist
    at gsignal.c line 3234
  • #24 g_signal_emit
    at gsignal.c line 3382
  • #25 gtk_widget_show
    from /usr/lib/libgtk-3.so.0
  • #26 sheet_widget_draw_cairo
    at sheet-object-widget.c line 233
  • #27 sheet_object_draw_cairo
    at sheet-object.c line 764
  • #28 gnm_print_sheet_objects
    at print.c line 244
  • #29 print_page_cells
    at print.c line 262
  • #30 print_page
    at print.c line 649
  • #31 gnm_draw_page_cb
    at print.c line 1431
  • #32 g_closure_invoke
    at gclosure.c line 777
  • #33 signal_emit_unlocked_R
    at gsignal.c line 3582
  • #34 g_signal_emit_valist
    at gsignal.c line 3326
  • #35 g_signal_emit
    at gsignal.c line 3382
  • #36 ??
    from /usr/lib/libgtk-3.so.0
  • #37 ??
    from /usr/lib/libgtk-3.so.0
  • #38 ??
    from /usr/lib/libgdk-3.so.0
  • #39 g_idle_dispatch
    at gmain.c line 5250
  • #40 g_main_dispatch
    at gmain.c line 3065
  • #41 g_main_context_dispatch
    at gmain.c line 3641
  • #42 g_main_context_iterate
    at gmain.c line 3712
  • #43 g_main_loop_run
    at gmain.c line 3906
  • #44 ??
    from /usr/lib/libgtk-3.so.0
  • #45 gtk_print_operation_run
    from /usr/lib/libgtk-3.so.0
  • #46 gnm_print_sheet
    at print.c line 1861
  • #47 pdf_write_workbook
    at print-info.c line 851
  • #48 pdf_export
    at print-info.c line 876
  • #49 go_file_saver_save_real
    at app/file.c line 577
  • #50 go_file_saver_save
    at app/file.c line 848
  • #51 wbv_save_to_output
    at workbook-view.c line 1055
  • #52 wb_view_save_to_uri
    at workbook-view.c line 1092
  • #53 wb_view_save_as
    at workbook-view.c line 1128
  • #54 convert
    at ssconvert.c line 788
  • #55 main
    at ssconvert.c line 855

--
Juha Kylmänen
Research Assistant, OUSPG
Comment 1 Andreas J. Guelzow 2013-08-07 19:08:40 UTC
This appears to happen far inside GTK.
Comment 2 Morten Welinder 2013-08-07 20:39:05 UTC
Lots of issue here.  One is bug 705640.
Comment 3 Andreas J. Guelzow 2013-08-07 23:47:55 UTC
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.
Comment 4 Andreas J. Guelzow 2013-08-08 01:53:37 UTC
Created attachment 251114 [details] [review]
completed patch

Patch to avoid crashing.
Comment 5 Andreas J. Guelzow 2013-08-08 01:55:49 UTC
Patch committed, but we now fail to print sheet object widgets from within ssconvert.
Comment 6 Morten Welinder 2013-08-08 02:16:20 UTC
Sure beats a crash!
Comment 7 Andreas J. Guelzow 2013-08-08 03:07:51 UTC
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.
Comment 8 Andreas J. Guelzow 2013-08-08 04:17:22 UTC
The remaining sheet widget objects are now also printable from ssconvert.
Comment 9 Andreas J. Guelzow 2013-08-09 17:39:29 UTC
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!
Comment 10 Andreas J. Guelzow 2013-08-09 19:22:18 UTC
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.