[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: PCB segfaults on click in netlist window



On Mon, Jul 18, 2011 at 01:04:10AM +0200, Kai-Martin Knaak wrote:
> Hi.
> With my current project PCB sefaults reproducably. It crashes when 
> I click on one of the node items on the right column of the netlist 
> window. Curiously, everything is fine if I click on the right column
> for the first time in a session. The cross hair jumps to where the 
> node happens to be on the canvas and everything looks fine. But when
> I try this trick again (with a different node), PCB segfaults 
> instantly. There is nothing on the command line except for the 
> string "Segmentation fault".
> 
> It does not seem to matter, which node I choose.
> PCB from git-head shows the same behavior as v20100929 distributed by 
> debian/testing. I cannot reproduce with other layouts of mine, though.
> My current is bit larger than usual. Size of the layout is 2.4 MB.
> Probably larger than the list allows. I attached the netlist (53 kB)
> 
> Anyone else seen this? Is this a known bug?
>

It looks like our support for heirachical netlists is broken. When
looking up the selected net name in the list, pcb looks through all
named nets, expecting each to have an associated list of pins.

When it hits B/, which is not a net but a category, it gets a NULL
pointer for the pin-list and blithely dereferences it, hence the
crash. You can get the same result with the netlist

safenet C1-2
danger/dangernet        C1-1

if you click around in the list.

The fix will be to restructure node_get_node_from_name() in
hid/gtk/gui-netlist-window.c, which does the offending lookup, to
recursively search the list rather than iteratively.


Interesting that no one has noticed this before...


-- 
Andrew Poelstra
Email: asp11 at sfu.ca OR apoelstra at wpsoftware.net
Web:   http://www.wpsoftware.net/andrew/



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user