[Tux3] the first dleaf_chop in dleaf.c:main() crashes

Daniel Phillips phillips at phunq.net
Tue Sep 9 13:23:17 PDT 2008


On Tuesday 09 September 2008 13:01, Benjamin K. Stuhl wrote:
> I get crashes in the first dleaf_chop() when running "make dleaftest"; the
> following patch fixes them, but I'm not at all certain it's correct.
> 
> Is Tux3 looking for Signed-off-by's yet?

They are not necessary because these are not kernel patches yet, but
if you write them anyway I will copy them into the commit log.

> Either way,
> Signed-Off-By: Benjamin K. Stuhl <benjamin.stuhl at colorado.edu>
 
Filling the whole block with zero probably just papers over the real
bug, which looks like dleaf_chop not handling the zero groups case
properly.

Does this work for you?

diff -r ef31d85601b7 user/test/dleaf.c
--- a/user/test/dleaf.c	Tue Sep 09 12:02:44 2008 -0700
+++ b/user/test/dleaf.c	Tue Sep 09 13:21:24 2008 -0700
@@ -168,7 +168,7 @@ int dleaf_chop(BTREE, tuxkey_t high, vle
 	unsigned extents = 0, start = 0, trunc = 0;
 	unsigned newgroups = leaf->groups;
 
-	while (1) {
+	while (newgroups) {
 		unsigned count = entry->limit - start;
 		tuxkey_t key = ((tuxkey_t)group->loghi << 24) | entry->loglo;
 		if (key >= high) {

_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list