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 321714 - Copying a graph leaves gnumeric in an unstable state
Copying a graph leaves gnumeric in an unstable state
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: General
1.7.x
Other Linux
: Normal critical
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2005-11-17 12:04 UTC by Jean Bréfort
Modified: 2006-10-10 10:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the files for which I get a crash (13.00 KB, application/vnd.ms-excel)
2005-11-17 12:06 UTC, Jean Bréfort
Details

Description Jean Bréfort 2005-11-17 12:04:23 UTC
Open a file with a graph or create one, even an empty one, then select the graph
and type Ctrl-C and Ctrl-Q. In the best case, you get one or several (seems as
many as seiries):

** (gnumeric:1885): CRITICAL **: dependent_unlink: assertion `IS_SHEET
(dep->sheet)' failed

Also, I have an excel file for which I get a crash on exit, but only if it is
open from the recent files list !!! I attach the file. The stack trace is:

  • #0 g_type_check_instance_is_a
    from /usr/lib/libgobject-2.0.so.0
  • #1 dependent_unlink
    at dependent.c line 1044
  • #2 dependent_set_expr
    at dependent.c line 156
  • #3 gnm_go_data_vector_finalize
    at graph.c line 332
  • #4 g_object_unref
    from /usr/lib/libgobject-2.0.so.0
  • #5 gog_graph_unref_data
    at gog-graph.c line 460
  • #6 gog_dataset_set_dim_internal
    at gog-data-set.c line 163
  • #7 gog_dataset_finalize
    at gog-data-set.c line 189
  • #8 gog_series_finalize
    at gog-series.c line 285
  • #9 g_object_unref
    from /usr/lib/libgobject-2.0.so.0
  • #10 g_slist_foreach
    from /usr/lib/libglib-2.0.so.0
  • #11 gog_object_finalize
    at gog-object.c line 204
  • #12 g_object_unref
    from /usr/lib/libgobject-2.0.so.0
  • #13 g_slist_foreach
    from /usr/lib/libglib-2.0.so.0
  • #14 gog_object_finalize
  • #15 g_object_unref
    from /usr/lib/libgobject-2.0.so.0
  • #16 g_slist_foreach
    from /usr/lib/libglib-2.0.so.0
  • #17 gog_object_finalize
    at gog-object.c line 204
  • #18 g_object_unref
    from /usr/lib/libgobject-2.0.so.0
  • #19 gnm_sog_finalize
    at sheet-object-graph.c line 159
  • #20 g_object_unref
    from /usr/lib/libgobject-2.0.so.0
  • #21 cellregion_unref
    at clipboard.c line 665
  • #22 gnm_app_clipboard_clear
    at application.c line 189
  • #23 gnm_shutdown
    at libgnumeric.c line 173
  • #24 main
    at main-application.c line 474

The crash seems to affect only HEAD, not gnumeric-1.6.1, but the critical
affects both.
Comment 1 Jean Bréfort 2005-11-17 12:06:18 UTC
Created attachment 54873 [details]
the files for which I get a crash

I do not remember if I generated this file using excel or gnumeric. It was when
I worked on the #318610 patch
Comment 2 Jean Bréfort 2005-11-17 14:02:08 UTC
I could also reproduce the bug doing the following:
-open gnumeric
-open the graph guru
-immediatly insert
-Ctrl-C and then Ctrl-Q

The problem comes from the fact that the graph in the clipboard depends on the
sheet. If the sheet is destroyed, finalizing the GnmGOData is unsafe. Seems
related to the changes I made to graph.c :-(
Comment 3 Jean Bréfort 2005-11-17 14:18:48 UTC
More thinking.

The problem is that the dep->flags does not indicate that the reference goes
outside of the sheet (and even outside of the workbook). So when the sheet is
destroyed, handle_outgoing_references does not unlink it.
Comment 4 Jean Bréfort 2005-11-17 14:39:42 UTC
seems like we must add DEPENDENT_GOES_INTERBOOK | DEPENDENT_GOES_INTERSHEET to
dst_dep->flags in gnm_go_data_dup when copying to the clipboard.
This must probably be implemented in sheet-object-graph.c (it is not difficult).
Should I proceed?
Comment 5 robby 2005-11-20 09:45:44 UTC
With 1.6.1. RC1 the problem seems to be fixed. Well done! 
Comment 6 Jean Bréfort 2005-11-20 13:40:25 UTC
It is not fixed at all, unfortunately. It would be nice if bugs were fixed
without any action from developers ;-)
Comment 7 Jon Kåre Hellan 2005-12-11 18:45:12 UTC
Here's the crash recipe from 323762, which probably is the same bug. Same
behaviour in 1.6.1 and HEAD:
New gnumeric. 
Open sample spreadsheet from gnumeric web page. 
Mark graph.
Copy.
File/New.
Close sample spreadsheet.
File/Paste in the remaining window.
Result: Segfault
Comment 8 Jon Kåre Hellan 2005-12-11 18:46:03 UTC
*** Bug 323762 has been marked as a duplicate of this bug. ***
Comment 9 Jon Kåre Hellan 2005-12-11 18:58:55 UTC
Here's the stacktrace from 323762:
  • #0 link_range_dep
    at dependent.c line 601
  • #1 link_cellrange_dep
    at dependent.c line 677
  • #2 link_expr_dep
    at dependent.c line 733
  • #3 dependent_link
    at dependent.c line 1022
  • #4 dependent_set_sheet
    at dependent.c line 202
  • #5 gnm_go_data_set_sheet
    at graph.c line 156
  • #6 sog_data_set_sheet
    at sheet-object-graph.c line 126
  • #7 sog_datas_set_sheet
    at sheet-object-graph.c line 146
  • #8 gnm_sog_set_sheet
    at sheet-object-graph.c line 474
  • #9 sheet_object_set_sheet
    at sheet-object.c line 330
  • #10 paste_object
    at clipboard.c line 228
  • #11 clipboard_paste_region
    at clipboard.c line 266
  • #12 cmd_paste_copy_impl
    at commands.c line 2781
  • #13 cmd_paste_copy_redo
    at commands.c line 2830

Comment 10 Jon Kåre Hellan 2006-10-09 11:24:44 UTC
Recipe from comment #7 still crashes HEAD.
Comment 11 Jon Kåre Hellan 2006-10-10 10:42:24 UTC
The original issue is solved. The "duplicate" bug 323762 is still a crasher. Closing this report and reopening 323762.