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 159581 - Dependency leaks
Dependency leaks
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: General
git master
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2004-11-26 19:24 UTC by Morten Welinder
Modified: 2005-02-03 21:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1.16 KB, patch)
2005-02-03 20:00 UTC, Morten Welinder
none Details | Review
m3.xls -- file to demonstrate leak (14.50 KB, application/octet-stream)
2005-02-03 20:03 UTC, Morten Welinder
  Details

Description Morten Welinder 2004-11-26 19:24:47 UTC
File from 159635 produces a few leaks:

         MLK: 16 bytes leaked at 0x30aea60
         This memory was allocated from:
               malloc         [rtlib.o pc=0x73978]
               g_malloc       [gmem.c:137 pc=0xfa445e98]
               range_dup      [ranges.c:599 pc=0x16f7d4]
               gnm_app_clipboard_cut_copy [application.c:251 pc=0xa18f4]
               sv_selection_cut [sheet-view.c:344 pc=0x18b330]
               cb_edit_cut    [wbcg-actions.c:270 pc=0x1ebca0]
               g_cclosure_marshal_VOID__VOID [gmarshal.c:77 pc=0xfa8a7614]
               g_closure_invoke [gclosure.c:437 pc=0xfa87dd40]
               signal_emit_unlocked_R [gsignal.c:2442 pc=0xfa8a5960]
               g_signal_emit_valist [gsignal.c:2201 pc=0xfa8a2c54]
               g_signal_emit  [gsignal.c:2245 pc=0xfa8a3188]
               _gtk_action_emit_activate [gtkaction.c:1010 pc=0xfac7ded8]
               closure_accel_activate [gtkaction.c:1401 pc=0xfac7efb8]
               g_closure_invoke [gclosure.c:437 pc=0xfa87dd40]
               signal_emit_unlocked_R [gsignal.c:2442 pc=0xfa8a5960]
               g_signal_emit_valist [gsignal.c:2211 pc=0xfa8a2cd8]
               g_signal_emit  [gsignal.c:2245 pc=0xfa8a3188]
               gtk_accel_group_activate [gtkaccelgroup.c:739 pc=0xfac75450]
               gtk_accel_groups_activate [gtkaccelgroup.c:777 pc=0xfac755a8]
               gtk_window_activate_key [gtkwindow.c:7477 pc=0xfafb2778]
               gtk_window_key_press_event [gtkwindow.c:4578 pc=0xfafab9d4]
               _gtk_marshal_BOOLEAN__BOXED [gtkmarshalers.c:83 pc=0xfaddef34]
               g_type_class_meta_marshal [gclosure.c:514 pc=0xfa87e100]
               g_closure_invoke [gclosure.c:437 pc=0xfa87dd40]
               signal_emit_unlocked_R [gsignal.c:2480 pc=0xfa8a6134]

Maybe gnm_app_clipboard_cut_copy_obj should g_free app->clipboard_cut_range
before NULLing it?


         MLK: 88 bytes leaked in 2 blocks
         This memory was allocated from:
               malloc         [rtlib.o pc=0x73978]
               calloc         [rtlib.o pc=0x74afc]
               g_malloc0      [gmem.c:154 pc=0xfa445f38]
               micro_hash_resize [dependent.c:347 pc=0xd241c]
               micro_hash_insert [dependent.c:392 pc=0xd2738]
               link_range_dep [dependent.c:640 pc=0xd3270]
               link_cellrange_dep [dependent.c:706 pc=0xd371c]
               link_expr_dep  [dependent.c:758 pc=0xd3a1c]
               dependent_link [dependent.c:1032 pc=0xd4614]
               dependent_set_sheet [dependent.c:209 pc=0xd2064]
               gnm_go_data_set_sheet [graph.c:151 pc=0xff364]
               sog_data_set_sheet [sheet-object-graph.c:119 pc=0x1aa3c4]
               sog_datas_set_sheet [sheet-object-graph.c:139 pc=0x1aa490]
               sheet_object_graph_set_sheet [sheet-object-graph.c:365 pc=0x1aaef4]
               sheet_object_set_sheet [sheet-object.c:316 pc=0x1a04e0]
               xml_read_sheet_object [xml-io.c:2825 pc=0x1f93e4]
               xml_sheet_read [xml-io.c:3275 pc=0x1fab34]
               xml_workbook_read [xml-io.c:3927 pc=0x1fc980]
               gnumeric_xml_read_workbook [xml-io.c:4254 pc=0x1fd91c]
               gnm_file_opener_open_real [file.c:90 pc=0xe2f2c]
               gnm_file_opener_open [file.c:308 pc=0xe3938]
               wb_view_new_from_input [workbook-view.c:923 pc=0x1dd198]
               wb_view_new_from_uri [workbook-view.c:974 pc=0x1dd2c8]
               main           [main-application.c:315 pc=0x202440]
               _start         [crt1.o pc=0x6b758]
         Block of 44 bytes (2 times); last block at 0x15f04d0

uh-oh...
Comment 1 Jody Goldberg 2004-11-26 20:31:24 UTC
Agreed.  The patch for the first one is clear.  I've committed it.
Comment 2 Morten Welinder 2004-11-28 18:54:18 UTC
Opening mathfuns.xls and inserting a column before A yields...

         MLK: 176 bytes leaked in 4 blocks
         This memory was allocated from:
               malloc         [rtlib.o pc=0x73990]
               calloc         [rtlib.o pc=0x74b14]
               g_malloc0      [gmem.c:154 pc=0xfa445f38]
               micro_hash_resize [dependent.c:347 pc=0xd2458]
               micro_hash_insert [dependent.c:392 pc=0xd2774]
               link_range_dep [dependent.c:640 pc=0xd32ac]
               link_cellrange_dep [dependent.c:708 pc=0xd3780]
               link_expr_dep  [dependent.c:758 pc=0xd3a58]
               link_expr_dep  [dependent.c:777 pc=0xd3b24]
               dependent_link [dependent.c:1032 pc=0xd4650]
               cell_set_expr_and_value [cell.c:311 pc=0xa4824]
               excel_read_FORMULA [ms-excel-read.c:2499 pc=0xf7c24844]
               excel_read_sheet [ms-excel-read.c:5346 pc=0xf7c2f000]
               excel_read_BOF [ms-excel-read.c:5787 pc=0xf7c306e8]
               excel_read_workbook [ms-excel-read.c:5851 pc=0xf7c30fe8]
               excel_file_open [boot.c:188 pc=0xf7c12d20]
               gnm_plugin_loader_module_func_file_open
[plugin-loader-module.c:315 pc=0x14d234]
               gnm_plugin_file_opener_open [plugin-service.c:578 pc=0x151994]
               gnm_file_opener_open [file.c:308 pc=0xe3974]
               wb_view_new_from_input [workbook-view.c:923 pc=0x1dd214]
               wb_view_new_from_uri [workbook-view.c:974 pc=0x1dd344]
               gui_file_read  [gui-file.c:128 pc=0x104228]
               gui_file_open  [gui-file.c:312 pc=0x104b58]
               cb_file_open   [wbcg-actions.c:93 pc=0x1eb2a8]
               g_cclosure_marshal_VOID__VOID [gmarshal.c:77 pc=0xfa8a7614]
         Block of 44 bytes (4 times); last block at 0x148ebb0
Comment 3 Morten Welinder 2005-02-03 20:00:54 UTC
Created attachment 36942 [details] [review]
Patch

First "hunk" isn't really related to the leak -- it's just that we never
downgrade to singleton and too agressively upgrade to buckets array.
Comment 4 Morten Welinder 2005-02-03 20:03:10 UTC
Created attachment 36943 [details]
m3.xls -- file to demonstrate leak

Leak (pre-patch) will occur upon inserting a new column before A.
Comment 5 Morten Welinder 2005-02-03 21:11:31 UTC
Fixed in cvs.