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 499717 - NULL pointer crash in header/footer customization code
NULL pointer crash in header/footer customization code
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Printing
git master
Other All
: Urgent blocker
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2007-11-26 11:49 UTC by sum1
Modified: 2007-11-26 21:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for the first crash (1.23 KB, patch)
2007-11-26 16:49 UTC, Andreas J. Guelzow
none Details | Review
Fix for both crashes (2.30 KB, patch)
2007-11-26 17:51 UTC, Andreas J. Guelzow
committed Details | Review

Description sum1 2007-11-26 11:49:02 UTC
Version: r16203
OS: Ubuntu Gutsy

Steps to reproduce:
- Run Gnumeric
- Import gnumeric/samples/excel/mathfuns.xls
- File > Page Setup
- Select the "Headers and Footers" tab
- Press either Configure button to crash Gnumeric

Backtrace:
Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 5447)

  • #0 add_text_to_buffer
    at dialog-printer-setup.c line 1422
  • #1 do_hf_customize
    at dialog-printer-setup.c line 1648
  • #2 do_header_customize
    at dialog-printer-setup.c line 833
  • #3 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #4 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #5 ??
    from /usr/lib/libgobject-2.0.so.0
  • #6 ??
  • #7 ??

Comment 1 Morten Welinder 2007-11-26 15:19:54 UTC
It's worse.  Selecting Cancel and the exiting crashes in the gconf
code.
Comment 2 Andreas J. Guelzow 2007-11-26 16:49:25 UTC
Created attachment 99673 [details] [review]
patch for the first crash

This patch fixes the first crash. I haven'tbeen able to replicate the second one yet.  

Morten: what exactly are you cancelling and exiting?
Comment 3 Morten Welinder 2007-11-26 17:32:35 UTC
I agree with that patch in the sense that it will fix the crash.  I do
not know if having NULL there is a good idea.  Go ahead and commit.

I start with mathfuns.xls
Select File->Page Setup
Click Headers and Footers
  --> and see "(null) (null) (null)"
Click Cancel.
Ctrl-Q


(gdb) where
  • #0 IA__g_utf8_validate
    at gutf8.c line 1568
  • #1 gconf_value_list_from_primitive_list
    at gconf-internals.c line 1264
  • #2 gconf_engine_set_list
    at gconf.c line 3442
  • #3 gconf_client_set_list
    at gconf-client.c line 1815
  • #4 go_conf_set_str_list
    at gnm-conf-gconf.c line 108
  • #5 gnm_gconf_set_print_header_formats
    at gnumeric-gconf.c line 689
  • #6 save_formats
    at print-info.c line 348
  • #7 print_shutdown
    at print-info.c line 782

Comment 4 Andreas J. Guelzow 2007-11-26 17:43:52 UTC
Morten:

We used to allow null pointers for the formats. This implies that we have to check everywhere for those null pointers. I think it is better just to use empty strings. THose extra 6 bytes per sheet should not kill us.

I'll redo the patch.
Comment 5 Andreas J. Guelzow 2007-11-26 17:51:54 UTC
Created attachment 99675 [details] [review]
Fix for both crashes

THis patch fixes both crashes by using "" rather than NULL.
Comment 6 Morten Welinder 2007-11-26 18:23:20 UTC
Comment on attachment 99675 [details] [review]
Fix for both crashes

Looks good.
Comment 7 Andreas J. Guelzow 2007-11-26 21:29:30 UTC
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.