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 334771 - Ungroup crashes
Ungroup crashes
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: win32
0.95-preX
Other All
: Normal critical
: 0.95.1
Assigned To: Steffen Macke
Dia maintainers
: 338936 340145 341913 342955 345120 346774 347726 348043 350822 351388 390731 405619 420163 427563 441774 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-03-16 15:20 UTC by Russell
Modified: 2007-05-28 11:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposition to fix diagram_ungroup_selected() bug (235 bytes, patch)
2006-04-27 15:28 UTC, Victor STINNER
none Details | Review
Ok, this patch really fix the bug and doesn't change function behaviour (699 bytes, patch)
2006-05-02 08:46 UTC, Victor STINNER
committed Details | Review

Description Russell 2006-03-16 15:20:02 UTC
Steps to reproduce:
1. Add an object
2. Duplicate it (ctrl-d)
3. Select both objects
4. Group them (Ctrl-g)
5. Ungroup them
6. Rinse and repeat (usually crashes quite quickly - about the 3rd or 4th time)


Stack trace:
Sorry guys - this is on Microsoft Windows

Other information:
Comment 1 Hans Breuer 2006-03-19 17:51:23 UTC
diagram_ungroup_selected(_Diagram * 0x01d1e1b8) line 1153 + 3 bytes
objects_ungroup_callback(void * 0x00000000, unsigned int 0, _GtkWidget * 0x01ccd618) line 999 + 11 bytes

Looks like somewhere dia->data-selected was screwed. It was 0x03 when
the crash occured. Strangely enough I was not able to reproduce on
Linux.
Comment 2 John Beisley 2006-04-17 20:45:42 UTC
I was unable to reproduce this bug in the manner described by Russell. However, I did get a crash when ungrouping an object. I enclose a Linux (x86, Debian-unstable) stacktrace. Dia version is reported as 0.94

  • #0 diagram_ungroup_selected
  • #1 gtk_item_factory_get_type
    from /usr/lib/libgtk-x11-2.0.so.0
  • #2 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #3 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #4 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #5 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #7 gtk_widget_can_activate_accel
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #9 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #10 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #12 gtk_accel_group_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #13 gtk_accel_groups_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #14 gtk_window_activate_key
    from /usr/lib/libgtk-x11-2.0.so.0
  • #15 gtk_window_activate_key
    from /usr/lib/libgtk-x11-2.0.so.0
  • #16 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #17 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #18 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #19 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #20 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #21 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #22 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #23 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #24 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #25 _gdk_events_queue
    from /usr/lib/libgdk-x11-2.0.so.0
  • #26 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #27 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #28 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #29 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #30 main

Comment 3 Victor STINNER 2006-04-27 14:11:00 UTC
I have same bug. It's hard to reproduce it. I added some printf, here are the results:
=================================== 8< =====================================

(create two objects)
(group them)
(ungroup)

dia = 0x9488060
list length = 1
selected = 0x94ee270
group = 0x94ee808
before apply(), selected = 0x94ee270
apply()
selected = 0x94ee270
list length = 2
(end of while) selected = 0x94ee270
(end of while) selected (next) = (nil)

(group two objects)
(ungroup)

dia = 0x9488060
list length = 1
selected = 0x94ee230
group = 0x94f7648
before apply(), selected = 0x94ee230
apply()
selected = 0x94ee230
list length = 2
(end of while) selected = 0x94ee230
(end of while) selected (next) = 0x94f4d48
group = 0x815df18
(end of while) selected = 0x94f4d48
(end of while) selected (next) = 0x3
Erreur de segmentation (core dumped)

=================================== 8< =====================================

Informations from gdb:

  • #0 diagram_ungroup_selected
    at diagram.c line 1157
  • #1 objects_ungroup_callback
    at commands.c line 1000
  • #2 gtk_item_factory_get_type
    from /usr/lib/libgtk-x11-2.0.so.0

For sure, "selected->data" crash since selected=0x3 ...

So "apply" function looks to be buggy.

Haypo
Comment 4 Victor STINNER 2006-04-27 15:28:45 UTC
Created attachment 64403 [details] [review]
Proposition to fix diagram_ungroup_selected() bug

My patch looks to fix the bug (tested during long time), but i don't know if it keep old behaviour.

Haypo
Comment 5 Victor STINNER 2006-05-02 08:46:25 UTC
Created attachment 64654 [details] [review]
Ok, this patch really fix the bug and doesn't change function behaviour

The problem was that the function walk in "dia->data->selected" list, and that "dia->data->selected" is changed (replaced with new list, old list is free()'d) during the loop. So I just made a copy of the original list ;-)

This function works with two or more groups.

Haypo
PS: Don't use my first patch (works well, but don't allow to ungroup two or more groups)
Comment 6 Victor STINNER 2006-05-02 08:48:47 UTC
Note: #338936 is a duplicate of this bug.
Comment 7 Victor STINNER 2006-05-02 09:06:39 UTC
Note: bug #340145 is a duplicate of this bug.
Comment 8 Hans Breuer 2006-05-13 21:10:32 UTC
*** Bug 340145 has been marked as a duplicate of this bug. ***
Comment 9 Hans Breuer 2006-05-13 21:12:28 UTC
*** Bug 338936 has been marked as a duplicate of this bug. ***
Comment 10 Hans Breuer 2006-05-13 21:27:40 UTC
Hi Victor,
thanks for the patch. I've now commited it to HEAD and the newly created
dia-0-95 branch. Keep up the good work, even if we sometimes need some
time to actually apply it ;)

2006-04-02  Hans Breuer  <hans@breuer.org>

	[ also applied to branch dia-0-95 ]
	* app/diagram.c(diagram_ungroup_selected) : operate on a copy
	of data-Selected cause the original is modified during use.
	Patch from Victor Stinner, fixes bug #334771

Comment 11 Hans Breuer 2006-05-15 22:35:13 UTC
*** Bug 341913 has been marked as a duplicate of this bug. ***
Comment 12 Hans Breuer 2006-05-25 21:42:28 UTC
*** Bug 342955 has been marked as a duplicate of this bug. ***
Comment 13 Elijah Newren 2006-06-16 19:57:51 UTC
*** Bug 345120 has been marked as a duplicate of this bug. ***
Comment 14 Hans Breuer 2006-07-06 19:07:53 UTC
*** Bug 346774 has been marked as a duplicate of this bug. ***
Comment 15 Hans Breuer 2006-07-17 07:00:43 UTC
*** Bug 347726 has been marked as a duplicate of this bug. ***
Comment 16 Hans Breuer 2006-07-19 21:43:52 UTC
*** Bug 348043 has been marked as a duplicate of this bug. ***
Comment 17 Hans Breuer 2006-08-13 14:30:03 UTC
*** Bug 350822 has been marked as a duplicate of this bug. ***
Comment 18 Hans Breuer 2006-08-15 06:08:08 UTC
*** Bug 351388 has been marked as a duplicate of this bug. ***
Comment 19 Hans Breuer 2007-01-02 17:41:13 UTC
*** Bug 390731 has been marked as a duplicate of this bug. ***
Comment 20 Hans Breuer 2007-02-08 06:37:26 UTC
*** Bug 405619 has been marked as a duplicate of this bug. ***
Comment 21 Hans Breuer 2007-03-19 23:03:39 UTC
*** Bug 420163 has been marked as a duplicate of this bug. ***
Comment 22 Hans Breuer 2007-04-08 12:40:02 UTC
*** Bug 427563 has been marked as a duplicate of this bug. ***
Comment 23 Hans Breuer 2007-05-28 11:10:45 UTC
*** Bug 441774 has been marked as a duplicate of this bug. ***