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 159365 - Crash when undoing
Crash when undoing
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 156583 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-11-24 20:15 UTC by Emmanuel Pacaud
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test file (324.48 KB, application/x-gnumeric)
2004-11-24 20:15 UTC, Emmanuel Pacaud
  Details
Keep refs to objects removed (12.47 KB, patch)
2004-11-25 15:52 UTC, Jody Goldberg
none Details | Review

Description Emmanuel Pacaud 2004-11-24 20:15:20 UTC
Open the attached file.

Move the selected block to top left.

Undo (Ctrl-Z)

-> crash.

Program received signal SIGSEGV, Segmentation fault.

Thread 1088615936 (LWP 17652)

  • #0 dependent_changed
    at dependent.c line 128
  • #1 dependents_unrelocate
    at dependent.c line 1513
  • #2 cmd_paste_cut_undo
    at commands.c line 2561
  • #3 command_undo
    at commands.c line 476
  • #4 cb_undo_activated
    at wbc-gtk.c line 438
  • #5 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #7 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #8 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #9 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #10 _gtk_action_emit_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #11 gtk_action_unblock_activate_from
    from /usr/lib/libgtk-x11-2.0.so.0
  • #12 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #13 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #14 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #15 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #16 gtk_accel_group_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #17 gtk_accel_groups_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #18 gtk_window_activate_key
    from /usr/lib/libgtk-x11-2.0.so.0
  • #19 gtk_window_propagate_key_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #20 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #21 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #22 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #23 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #24 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #25 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #26 gtk_widget_send_expose
    from /usr/lib/libgtk-x11-2.0.so.0
  • #27 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #28 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #29 _gdk_events_queue
    from /usr/lib/libgdk-x11-2.0.so.0
  • #30 g_main_depth
    from /usr/lib/libglib-2.0.so.0
  • #31 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #32 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #33 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #34 bonobo_main
    from /usr/lib/libbonobo-2.so.0
  • #35 main
    at main-application.c line 358

Comment 1 Emmanuel Pacaud 2004-11-24 20:15:48 UTC
Created attachment 34102 [details]
test file
Comment 2 Jody Goldberg 2004-11-25 14:42:23 UTC
<jody> emmanuel_afk: this exposes a rather serious conflict between Dependent
and SheetObject
<jody> We do not ref count dependents
<jody> The crash is exposed by some overzealous sheet object removal
<jody> The minor bug is that we remove objects if thier topleft cell is in a
changed region
<jody> the major bug is that if a sheet object contains a dependent that changes
as a result
<jody> we point directly at the dependent
<jody> with no way of knowing that the SheetObject containing it has been deleted
<jody> I'll attempt to patch around it by finishing undo support for sheet
objects deleted by cut-paste and ins/del col/row
<jody> which should by us time
<jody> but I suspect that we may need to add _ref/_unref methods to Dependent
<jody> So that the unrelocate lists can add refs to the containing chart somehow
Comment 3 Jody Goldberg 2004-11-25 15:52:57 UTC
Created attachment 34126 [details] [review]
Keep refs to objects removed

This patch doesn't solve to core problem but it avoids it at a higher level and
we needed to do it anyway.  It keeps refs to objects being removed by pasting a
cut, or ins/del col/row.  since the objects continue to exist, we don't end up
with dependent pointers to non-existent GObjects.

On a related note we may want to relax the selection sheet objects to remove
when pasting a cut.  It currently uses the top left cell as the test.
Comment 4 Jody Goldberg 2004-11-26 06:28:28 UTC
I've self reviewed and realized that my change to restoring the objects to the
sheet before unrelocating the expressions removed the need for the dependent.c
patch.  We'll likely need at least part of that eventually, but for now I'll
leave it off.
Comment 5 Jody Goldberg 2004-11-27 16:16:25 UTC
*** Bug 156583 has been marked as a duplicate of this bug. ***