[Cook] Running with parallel

Peter Miller millerp at canb.auug.org.au
Wed Jul 16 22:12:17 EST 2003


On Sat, 2003-06-07 at 00:54, Jerry Pendergraft wrote:
> Attached is a simple cook file using some of Jody's recipes.
> I ran with cook.2.23 [and it failed].

I ran this against the soon-to-be-released 2.24
and it didn't fail.  (Yay!)

The problem is almost certainly the bug in the itab.c file (patch
attached) because itabs are used to track child processes.

-- 
Regards
Peter Miller <millerp at canb.auug.org.au>
/\/\*        http://www.canb.auug.org.au/~millerp/

PGP public key ID: 1024D/D0EDB64D
fingerprint = AD0A C5DF C426 4F03 5D53  2BDB 18D8 A4E2 D0ED B64D
See http://www.keyserver.net or any PGP keyserver for public key.
-------------- next part --------------
MIME-Version: 1.0
Content-Type: application/aegis-patch
Subject: cook.2.23 - itab fix
Content-Name: cook.2.23.C012.patch
Content-Disposition: attachment; filename=cook.2.23.C012.patch
X-Aegis-Project-Name: cook.2.23
X-Aegis-Change-Number: 12

#	
#	I've been having problems for a while now with parallel builds using
#	cook. It turns out that hitting this bug in cook probably required an
#	unusual set of conditions:
#	1) Running as: cook -par 8
#	2) Running on an SMP system (may not matter).
#	3) A very fast recipe; body follows:
#	echo \"#!/home/jasone/cw/devroot/bin/onyx/bin/tonyx\" > [target]
#	&& cat ./%0test/%.nx.in >> [target]
#	&& chmod u+x [target];
#	4) Many files generated by the fast recipe (currently in excess of
#	800).
#	The problem is in common/itab.c:split(). That function doubles the
#	size of a hash table, then rebuilds the table. The problem is, it
#	doesn't bother to switch to the new table once it has been
#	constructed. Thus, for any bucket chains that have collisions at the
#	original size, elements other than the first ones are no longer
#	accessible.  Naturally, this bug is a huge memory leak, even if we get
#	lucky and there are no collisions, since split() is repeatedly called,
#	but the table never gets larger to relieve the pressure.
#	
#	My thanks to Jason Evans for this patch.
#	
Index: common/itab.c
*** common/itab.c
--- common/itab.c
***************
*** 176,181 ****
--- 176,190 ----
  	    *ipp = p2;
  	}
      }
+ 
+     /*
+      * Switch over to the new table and parameters.
+      */
+     itp->hash_modulus = new_hash_modulus;
+     itp->hash_mask = new_hash_mask;
+     mem_free(itp->hash_table);
+     itp->hash_table = new_hash_table;
+ 
      trace(("}\n"));
  }
  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.auug.org.au/pipermail/cook-users/attachments/20030716/bd7d12cc/attachment.pgp>


More information about the Cook-users mailing list