gEDA-dev: Drawing regression in unstable

Peter Clifton pcjc2 at cam.ac.uk
Fri Jul 27 08:19:42 EDT 2007


On Thu, 2007-07-26 at 11:10 +0100, Peter TB Brett wrote:
> Hi folks,
> 
> I think I've found a regression: when messing about with nets in gschem, 
> sometimes I'll do something which causes a net segment to lose its colour 
> setting (it gets set to -1).  Then, because gschem doesn't know about colour 
> index -1, it draws the net as white and spews lots of error messages to 
> stderr:
> 
>   Tried to get an invalid color: -1
>   Tried to get an invalid color: -1
> 
> This is hard to reproduce reliably.  I attach a screenshot.  Most of the time, 
> it happens when dragging nets causes two net segments to be merged into one.

I can always reproduce by drawing a net in an "L" shape, selecting one
segment, then dragging the un-attached end of said selected segment so
the "L" becomes a straight line.

I'm working on tracking down the root cause, but it looks like the bad
colour assignment is being made as the net is being de-selected.

With a hardware watch point on the color field of the first net segment
(the one I didn't select, and am not dragging):

Hardware watchpoint 2: ((struct st_object *) 137656960)->color

Old value = 4
New value = -1

(gdb) bt
#0  o_selection_unselect (object=0x8347a80) at o_selection.c:174
#1  0xb7f009a6 in o_selection_remove (selection=0x82c02d0, o_selected=0x8347a80) at o_selection.c:87
#2  0xb7f002fa in o_net_consolidate_segments (w_current=0x80d0668, object=0x8347a80) at o_net_basic.c:641
#3  0xb7f00384 in o_net_consolidate (w_current=0x80d0668) at o_net_basic.c:680
#4  0xb7ef1096 in o_save (w_current=0x80d0668, filename=0x8348048 "/tmp/gschem.save12539_2.sch") at a_basic.c:191
#5  0x080785c0 in o_undo_savestate (w_current=0x80d0668, flag=0) at o_undo.c:119
#6  0x08069c44 in o_grips_end (w_current=0x80d0668) at o_grips.c:1417
#7  0x08087b5f in x_event_button_released (widget=0x816ccd0, event=0x8290720, w_current=0x80d0668) at x_event.c:707

The assignment in o_selection_unselect is:
object->color = object->saved_color;

So either the object being de-selected was never selected properly
(possible due to the operations being performed), or the saved_color is
being zerod by mistake elsewhere.

> Glancing down my git log output, I can't see anything that looks like its 
> affected this recently, so it may be an accidental side-effect of other 
> changes/fixes.  Any ideas?

Looks very much like this bug has been introduced by the selection
changes I committed. I'll track down the cause unless anyone beats me to
it.

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



More information about the geda-dev mailing list