GNOME Bugzilla – Bug 611374
dia-gnome: Dia crashes if you delete an object while resizing
Last modified: 2011-12-11 16:20:42 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
Created attachment 177008 [details] [review] Fixes a segfault while deleting a newly drawn object
I can confirm this bug on my Ubuntu 10.10 - attached is a fix for the problem. Hopefully the patch is according to standards.
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.
Found a much more simple way: http://git.gnome.org/browse/dia/commit/?id=c0ec759a702a6272cb812bc2a9c64f84adfa7ae5
*** Bug 656304 has been marked as a duplicate of this bug. ***
Looking at the patch I wonder what I was thinking - the important part is missing.
*** Bug 665873 has been marked as a duplicate of this bug. ***
Fix pushed to master and dia-0-97 branch: http://git.gnome.org/browse/dia/commit/?h=dia-0-97&id=19647c38eae85d3ba5e8c2960fad4425c0e1c1b9