Hi Peter,

On Donnerstag, 14. Februar 2008, Peter Clifton wrote:
> It appears the git HEAD code crashes deleting attributes from nets.
> I'm can't recall if this is in 1.4.0 or not, but either way it needs
> fixing. We shouldn't call o_attrib_slot_update() for non-complex
> objects.
>
> Its related to slot updates:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1221146960 (LWP 11350)]
> 0xb7f70de5 in o_attrib_search_slotdef (object=0x85014b0,
> slotnumber=1) at o_attrib.c:1590 1590      o_current =
> object->complex->prim_objs;
>
> #0  0xb7f70de5 in o_attrib_search_slotdef (object=0x85014b0,
> slotnumber=1) at o_attrib.c:1590 #1  0xb7f71d14 in
> o_attrib_slot_update (toplevel=0x80d74c0, object=0x85014b0) at
> o_attrib.c:1695 #2  0x08097900 in multiattrib_action_delete_attribute
> (w_current=0x80cfa78, o_attrib=0x8501638) at x_multiattrib.c:521 #3 
> 0x08097aaa in multiattrib_callback_key_pressed (widget=0x8614100,
> event=0x82d19a0, user_data=0x817ed68) at x_multiattrib.c:963
>
> (gdb) print object->complex
> $2 = (COMPLEX *) 0x0
>
> (It is a net, not a complex!)

I'm sorry. I guess I've introduced this bug with the first commit after 
tag 1.4.0: 22396b286d50c454287ff94a3c3de414b3f9a08a

This patch should fix it:

diff --git a/gschem/src/o_delete.c b/gschem/src/o_delete.c
index 60f6f38..df45421 100644
--- a/gschem/src/o_delete.c
+++ b/gschem/src/o_delete.c
@@ -216,7 +216,7 @@ void o_delete_text(GSCHEM_TOPLEVEL *w_current, 
OBJECT *obj)
   toplevel->page_current->object_tail =
     (OBJECT *) return_tail(toplevel->page_current->object_head);

-  if (o_parent != NULL)
+  if (o_parent != NULL && o_parent->type == OBJ_COMPLEX)
     o_attrib_slot_update(toplevel, o_parent);
 }

Regards
Werner


_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to