Coda File System

Re: Hoard Problem: Device not configured

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Mon, 21 May 2001 10:48:26 -0400
On Mon, May 21, 2001 at 03:33:33PM +0200, Steffen Neumann wrote:
> 	hoard walk
> and after some 12mins 
> 	pioctl:Verify(-1, /tmp/fileWL7FDQ, 10157, 0): No such device

Is there any GetAttr/Fetch activity visible in the 'codacon' output
The "No such device" error is probably due to a crashed venus.

> [ H(06) : 0006 : 14:58:15 ] binding::~binding:  somebody forgot to decrement before delete
> [...] Many of these
> [ H(06) : 0006 : 14:58:16 ] binding::~binding:  somebody forgot to decrement before delete

Coda 5.3.14 fixed the "hoard-bindings refcounting" that caused these
messages. There is in fact no real problem, except for flooding the log
with these messages.

> [ W(19) : 0000 : 14:58:52 ] WAITING(HDBD_Request): Verify
> [ H(06) : 0007 : 14:58:52 ] HDBDaemon just woke up
> [ H(06) : 0007 : 14:58:52 ] hdb::Verify: </tmp/fileWL7FDQ, 0, -1, 10157>

Crashed while verifying.

On Mon, May 21, 2001 at 04:10:23PM +0200, Steffen Neumann wrote:
> Steffen Neumann <sneumann_at_TechFak.Uni-Bielefeld.DE> writes:
> [...]
> > Any ideas ? Any other Info that could be helpful ?
> 
> Well, remembering the recent near-online debugging session
> here on the list I now have the stack trace of the dying venus,
> maybe that helps.
> 
> So long,
> Steffen
> 
> -------------------------------------------------
> 
>  cat /tmp/gdb.trace 
> #0  0x80764e9 in namectxt::printsuspect (this=0x9161798, fd=12, verbosity=0)    at hdb.cc:2472
...
> #15 0x8076629 in namectxt::printsuspect (this=0x94fe600, fd=12, verbosity=0)    at hdb.cc:2505
> #16 0x8074731 in hdbent::printsuspect (this=0x2507fa88, afd=12, verbosity=0)    at hdb.cc:1394


Ok, we recursed 16 deep into namectxt::printsuspect, each of which puts
at least MAXPATHLEN+1 bytes on the stack, which is around 4KB each. LWP
stacks are fixed in size, so this one is easy. We ran out of stackspace
by using up over 64KB of stackspace.

I see 2 solutions, one is to split PUTMSG into it's own function, that
way printsuspect only adds 2 pointers to the stack. Secondly, this
function is pretty much tail-recursive, so it should be possible to
convert it into a loop.

Quick patch that leaves the recursion, but significantly lowers the
stack usage is attached. (I have only tested that it compiles)

Jan


Index: hdb.cc
===================================================================
RCS file: /afs/cs/project/coda-src/cvs/coda/coda-src/venus/hdb.cc,v
retrieving revision 4.46
diff -u -u -r4.46 hdb.cc
--- hdb.cc	2001/05/17 21:26:54	4.46
+++ hdb.cc	2001/05/21 14:46:39
@@ -2434,27 +2434,28 @@
 	return;
 }
 
+void namectxt::putmsg(int fd, char *reason, int include_modifier)
+{
+    char fullpath[MAXPATHLEN+1];
+    const char *modifier = !include_modifier ? "" :
+	(expand_descendents ? " d+" : (expand_children ? " c+" : "   "));
+
+    getpath(fullpath);
 
-#define PUTMSG(reason, include_modifier) do {\
-	getpath(fullpath);\
-	fdprint(fd, "%25s  %s", reason, fullpath);\
-	if (include_modifier) fdprint(fd, " %s\n", modifier);\
-	else fdprint(fd, "\n");\
-} while(0);
+    fdprint(fd, "%25s  %s%s\n", reason, fullpath, modifier);
+}
 
-void namectxt::printsuspect(int fd, int verbosity) {
+void namectxt::printsuspect(int fd, int verbosity)
+{
     /* verbosity = 0		silence except for errors
        0 < verbosity <= 100	errors and confirmation of items in hoard database
        100 < verbosity		errors and confirmation of all expanded items
     */
-    char fullpath[MAXPATHLEN+1];
-    const char *modifier = expand_descendents ? "d+" :
-			  (expand_children    ? "c+" : "  ");
 
     /* Deal with this node first */
     dlink *d = expansion.last();
     if (d == 0){
-	PUTMSG("*** Not bound ***", 1);
+	putmsg(fd, "*** Not bound ***", 1);
 	return;
     }
     else {
@@ -2462,12 +2463,12 @@
 	fsobj *f = (fsobj *)b->bindee;
 
 	if (!f || !STATUSVALID(f) || !DATAVALID(f)) {
-	    PUTMSG("*** Missing/Invalid ***", 1);
+	    putmsg(fd, "*** Missing/Invalid ***", 1);
 	    return;
 	}
     }
 
-    if (verbosity) PUTMSG("OK", 0);
+    if (verbosity) putmsg(fd, "OK", 0);
 
     /* Then recursively deal with children */
     if (children) {
@@ -2479,10 +2480,6 @@
 	}
     }
 }
-#undef PUTMSG
-
-
-
 
 int NC_PriorityFN(bsnode *b1, bsnode *b2) {
     namectxt *n1 = strbase(namectxt, b1, prio_handle);
Index: hdb.h
===================================================================
RCS file: /afs/cs/project/coda-src/cvs/coda/coda-src/venus/hdb.h,v
retrieving revision 4.20
diff -u -u -r4.20 hdb.h
--- hdb.h	2001/05/17 21:26:55	4.20
+++ hdb.h	2001/05/21 14:46:40
@@ -388,7 +388,7 @@
     void print(int, void * =0);
     void printsuspect(int, int);
     void getpath(char *);
-
+    void putmsg(int fd, char *reason, int include_modifier);
 };
 
 #ifdef	VENUSDEBUG
Received on 2001-05-21 10:48:40