[csw-devel] SF.net SVN: gar:[8035] csw/mgar/pkg/pcb/trunk

trygvis at users.sourceforge.net trygvis at users.sourceforge.net
Sat Jan 16 23:08:21 CET 2010


Revision: 8035
          http://gar.svn.sourceforge.net/gar/?rev=8035&view=rev
Author:   trygvis
Date:     2010-01-16 22:08:21 +0000 (Sat, 16 Jan 2010)

Log Message:
-----------
o Adding a couple of patches to prevent a coredump.

Modified Paths:
--------------
    csw/mgar/pkg/pcb/trunk/Makefile
    csw/mgar/pkg/pcb/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/pcb/trunk/files/0001-Fix-off-by-one-error-in-the-GTK-HID-s-netlist-window.patch
    csw/mgar/pkg/pcb/trunk/files/0001-Regenerate-rats-r-tree-when-re-allocating-a-bigger-r.patch

Modified: csw/mgar/pkg/pcb/trunk/Makefile
===================================================================
--- csw/mgar/pkg/pcb/trunk/Makefile	2010-01-16 21:29:58 UTC (rev 8034)
+++ csw/mgar/pkg/pcb/trunk/Makefile	2010-01-16 22:08:21 UTC (rev 8035)
@@ -55,8 +55,11 @@
 # uncomment the next line. Otherwise it is set by default to the value of MASTER_SITES
 # UPSTREAM_MASTER_SITES = 
 
-# Patch submitted to upstream, pending new release
-#PATCHFILES = iptc-dataset.patch
+# See [1] and [2]. [1] seems to fix the problem, but [2] is included too. - trygvis
+# [1]: http://www.mail-archive.com/geda-user@moria.seul.org/msg14911.html
+# [2]: http://www.mail-archive.com/geda-user@moria.seul.org/msg14914.html
+PATCHFILES  = 0001-Fix-off-by-one-error-in-the-GTK-HID-s-netlist-window.patch
+PATCHFILES += 0001-Regenerate-rats-r-tree-when-re-allocating-a-bigger-r.patch
 
 EXTRA_PKG_CONFIG_DIRS = $(prefix)/X11/lib
 CONFIGURE_ARGS = $(DIRPATHS)

Modified: csw/mgar/pkg/pcb/trunk/checksums
===================================================================
--- csw/mgar/pkg/pcb/trunk/checksums	2010-01-16 21:29:58 UTC (rev 8034)
+++ csw/mgar/pkg/pcb/trunk/checksums	2010-01-16 22:08:21 UTC (rev 8035)
@@ -1 +1,3 @@
-e192ee993b04749f82dd3e8b529d40c0  download/pcb-20081128.tar.gz
+509826c8a9184b46055258861228b555  0001-Fix-off-by-one-error-in-the-GTK-HID-s-netlist-window.patch
+00fd904d4439493a998100f40891fffd  0001-Regenerate-rats-r-tree-when-re-allocating-a-bigger-r.patch
+e192ee993b04749f82dd3e8b529d40c0  pcb-20081128.tar.gz

Added: csw/mgar/pkg/pcb/trunk/files/0001-Fix-off-by-one-error-in-the-GTK-HID-s-netlist-window.patch
===================================================================
--- csw/mgar/pkg/pcb/trunk/files/0001-Fix-off-by-one-error-in-the-GTK-HID-s-netlist-window.patch	                        (rev 0)
+++ csw/mgar/pkg/pcb/trunk/files/0001-Fix-off-by-one-error-in-the-GTK-HID-s-netlist-window.patch	2010-01-16 22:08:21 UTC (rev 8035)
@@ -0,0 +1,28 @@
+From d053b4e41da10fd033429cb4b88c6e3b52769eb7 Mon Sep 17 00:00:00 2001
+From: Peter Clifton <pcjc2 at cam.ac.uk>
+Date: Wed, 24 Dec 2008 03:07:02 +0000
+Subject: [PATCH] Fix off-by one error in the GTK HID's netlist window model generation
+
+Broken when I added support for a hierarchical view of nets. The bug
+caused invalid memory to be read, possibly leading to a crash, as the
+last (and missing) element from g_new0 was supposed to be a terminator.
+---
+ src/hid/gtk/gui-netlist-window.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
+index 8dc2299..848fb7e 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);
+-- 
+1.5.6.5
+

Added: csw/mgar/pkg/pcb/trunk/files/0001-Regenerate-rats-r-tree-when-re-allocating-a-bigger-r.patch
===================================================================
--- csw/mgar/pkg/pcb/trunk/files/0001-Regenerate-rats-r-tree-when-re-allocating-a-bigger-r.patch	                        (rev 0)
+++ csw/mgar/pkg/pcb/trunk/files/0001-Regenerate-rats-r-tree-when-re-allocating-a-bigger-r.patch	2010-01-16 22:08:21 UTC (rev 8035)
@@ -0,0 +1,37 @@
+From 40347a55413e152c7b5fc2bac074c75c7687b766 Mon Sep 17 00:00:00 2001
+From: Peter Clifton <pcjc2 at cam.ac.uk>
+Date: Wed, 24 Dec 2008 13:14:27 +0000
+Subject: [PATCH] Regenerate rats r-tree when re-allocating a bigger rats array.
+
+Shuould fix crashes observed on a board with a large number of rats.
+---
+ src/mymem.c |    9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/src/mymem.c b/src/mymem.c
+index 57eca2d..36b13d5 100644
+--- a/src/mymem.c
++++ b/src/mymem.c
+@@ -305,10 +305,19 @@ GetRatMemory (DataTypePtr Data)
+   if (Data->RatN >= Data->RatMax)
+     {
+       Data->RatMax += STEP_RAT;
++      /* all of the pointers move, so rebuild the whole tree */
++      if (Data->rat_tree)
++        r_destroy_tree (&Data->rat_tree);
+       rat = MyRealloc (rat, Data->RatMax * sizeof (RatType),
+ 		       "GetRatMemory()");
+       Data->Rat = rat;
+       memset (rat + Data->RatN, 0, STEP_RAT * sizeof (RatType));
++      Data->rat_tree = r_create_tree (NULL, 0, 0);
++      RAT_LOOP (Data);
++      {
++        r_insert_entry (Data->rat_tree, (BoxTypePtr) line, 0);
++      }
++      END_LOOP;
+     }
+   return (rat + Data->RatN++);
+ }
+-- 
+1.5.6.5
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list