← Back to team overview

kicad-developers team mailing list archive

Re: Connection graph question


Hi Jon,

That's kind of what I thought.  I will track down every where in the
code where we call UpdateSymbolLinks() and to a full connectivity graph
rebuild.  It's ugly but at least there will be no stale item pointers.
We really should only be calling UpdateSymbolLinks() on schematic load,
symbol library changes, and symbol library table changes.  Thanks for
the help.



On 12/11/19 6:17 PM, Jon Evans wrote:
> Hi Wayne,
> I can't look at the code this minute, but I think you basically have it
> right. This call is quite expensive so if we can not trust the pin map
> to be valid, we'll probably want to come up with some way to make a
> targeted update so that we don't incur the computation time of a full
> recalculation.
> -Jon
> On Wed, Dec 11, 2019 at 6:01 PM Wayne Stambaugh <stambaughw@xxxxxxxxx
> <mailto:stambaughw@xxxxxxxxx>> wrote:
>     I'm guessing this is primarily a question for Jon but maybe someone else
>     can answer my question.  My recent symbol inheritance merge revealed
>     that the connection graph code has a serious fragility issue.  This
>     comment in the updateItemConnectivity function raised a red flag:
>     // Assumption: we don't need to call UpdatePins() here because anything
>     // that would change the pins of the component will have called it
>     already
>     It turns out this assumption was not only wrong, it was really wrong.
>     Now that the LIB_PART of the SCH_COMPONENT is no longer a pointer link
>     but an actual copy of the library symbol, any change to the underlying
>     library symbol will result in stale pin map pointers.  This is what has
>     been causing all of the crash bugs.  I cannot believe that we haven't
>     had more issues.  The only thing that saved us was as long as the
>     original LIB_PART pointer was around somewhere, it wouldn't crash even
>     if the connection information was completely wrong.  I think I have
>     fixed everyplace where the LIB_PART copy is changed in SCH_COMPONENT but
>     that still leaves the issue of keeping the connection graph up to date.
>     There are lots of places in the code where we call UpdateSymbolLinks().
>     This will replace every single library symbol copy in the schematic with
>     a new copy which will render the connect graph pointers completely out
>     of date.  What needs to be done to ensure the the connection graph is
>     not stale?  It appears to me that I have to call Recalulate( rootSheet,
>     true ) is the correct thing to do but this will perform a complete
>     rebuild of the connection graph.  I'm guessing that has a lot of
>     overhead involved in it.  Is there a better way that I'm missing here?
>     Cheers,
>     Wayne
>     _______________________________________________
>     Mailing list: https://launchpad.net/~kicad-developers
>     Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>     Unsubscribe : https://launchpad.net/~kicad-developers
>     More help   : https://help.launchpad.net/ListHelp