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 611374 - dia-gnome: Dia crashes if you delete an object while resizing
dia-gnome: Dia crashes if you delete an object while resizing
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: general
0.97.x
Other All
: Normal normal
: 0.97.2
Assigned To: Dia maintainers
Dia maintainers
: 656304 665873 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-02-28 09:51 UTC by Roland Stigge
Modified: 2011-12-11 16:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes a segfault while deleting a newly drawn object (1.11 KB, patch)
2010-12-24 11:38 UTC, Robert van Drunen
none Details | Review

Description Roland Stigge 2010-02-28 09:51:40 UTC
Hi,

a Debian user reported the following:

=========================================================================
1) Select an object to draw from the toolbox window.  This can be
primitive items such as Line and Arc, or a template item from a sheet
of icons.

2) Click on a diagram to insert the item, but do not release the mouse
button.  This allows you to drag the object to insert a specific sized
item.

3) Without releasing the mouse button, press delete to remove the
element being resized.  The element should disappear, but the cursor
should remain with the resize icon.

4) Release the cursor, dia crashes with a segfault.
=========================================================================

I can reproduce the described segfault on newly placed objects (not on existing objects). The problem exists for gnome and non-gnome versions.

See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538308

Thanks for considering.

bye,
  Roland
Comment 1 Robert van Drunen 2010-12-24 11:38:19 UTC
Created attachment 177008 [details] [review]
Fixes a segfault while deleting a newly drawn object
Comment 2 Robert van Drunen 2010-12-24 11:43:31 UTC
I can confirm this bug on my Ubuntu 10.10 - attached is a fix for the problem.

Hopefully the patch is according to standards.
Comment 3 Hans Breuer 2011-01-02 17:43:36 UTC
The patch as is just delays the crashing - possibly until hitting undo.
The code in app/create_object.c is just not written to be interrupted between button_press and button_release, some addtional pointer checks elswewhere wont fix that. 
The best thing to do would probably be to disable the deletion of objects during creation/moving. There already is some partially working code (search for "tool->moving"), I'm uncertain if that should be extended.
Comment 4 Hans Breuer 2011-01-30 16:26:52 UTC
Found a much more simple way:
http://git.gnome.org/browse/dia/commit/?id=c0ec759a702a6272cb812bc2a9c64f84adfa7ae5
Comment 5 Hans Breuer 2011-08-10 18:33:28 UTC
*** Bug 656304 has been marked as a duplicate of this bug. ***
Comment 6 Hans Breuer 2011-12-11 15:19:56 UTC
Looking at the patch I wonder what I was thinking - the important part is missing.
Comment 7 Hans Breuer 2011-12-11 15:20:38 UTC
*** Bug 665873 has been marked as a duplicate of this bug. ***
Comment 8 Hans Breuer 2011-12-11 16:20:42 UTC
Fix pushed to master and dia-0-97 branch:
http://git.gnome.org/browse/dia/commit/?h=dia-0-97&id=19647c38eae85d3ba5e8c2960fad4425c0e1c1b9