From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] drawterm sigsegv on linux 2.6.18 From: "Russ Cox" Date: Tue, 29 May 2007 08:26:02 -0400 In-Reply-To: <1180366010.706662.238930@q69g2000hsb.googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20070529122316.C7AD51E8C3B@holo.morphisms.net> Topicbox-Message-UUID: 74527ac0-ead2-11e9-9d60-3106f5b1d025 > When I do a "du -a /" on a plan9 cpu server via drawterm, drawterm > gets a sigsegv after a while. Gdb reports that the sigsegv arrived > when tas.c:9 (inline assembler code to do test and set) is called. I > cannot see anything wrong with the tas code though. The problem isn't in tas but its caller -- note that tas is being passed a null pointer. Thanks for the gdb stack trace, which was very helpful. The fix this change to kern/devfs-posix.c (a similar change applies to kern/devfs-win32.c too): cname = addelem(cname, name[i]); wq->qid[i] = nc->qid; } - nc->name = nil; - cnameclose(cname); + nc->name = cname; if(i != nname){ cclose(nc); wq->clone = nil; The bug is only triggered when traversing paths more than 16 levels deep on the local machine. Russ