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

Re: gEDA-user: problems with PCB and large board



On Wed, 2008-12-24 at 01:02 +0000, Peter Clifton wrote:
> On Tue, 2008-12-23 at 19:13 -0500, gene wrote:
> > 
> > ==3971== Invalid read of size 1
> > ==3971==    at 0x40247B1: strlen (in 
> > /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
> > ==3971==    by 0x45C1FFD: g_strjoinv
> > (in /usr/lib/libglib-2.0.so.0.1600.6)
> > ==3971==    by 0x80D89CD: net_model_create (gui-netlist-window.c:391)
> 
> Thanks.. I think that might land the blame on my shoulders... I'll have
> a poke and see what logic I messed up when I last touched that function.
> 
> Notice how valgrind quit out much much sooner than the gdb backtrace.
> Often the real bug lies far before the crash occured.

I pushed a fix to CVS. Could you update and rebuild?

Alternatively, if you have the PCB sources from the last release, just
apply this one line edit:

diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index 147b05a..a37b063 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -385,7 +385,7 @@ net_model_create (void)
         parent_iter = new_iter;
         parent_ptr = &parent_iter;
 
-        join_array = g_new0 (char *, try_depth + 1);
+        join_array = g_new0 (char *, try_depth + 2);
         memcpy (join_array, path_segments, sizeof (char *) * (try_depth + 1));
 
         hash_string = g_strjoinv (NET_HIERARCHY_SEPARATOR, join_array);


IE: in the file src/hid/gtk/gui-netlist-window.c, line 388,
change the + 1 to a + 2.

Hope that resolves the issue, if not - run valgrind again, and it may
get further.


-- 
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!)



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