9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] drawterm sigsegv on linux 2.6.18
Date: Tue, 29 May 2007 08:26:02 -0400	[thread overview]
Message-ID: <20070529122316.C7AD51E8C3B@holo.morphisms.net> (raw)
In-Reply-To: <1180366010.706662.238930@q69g2000hsb.googlegroups.com>

> 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



      reply	other threads:[~2007-05-29 12:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-29  8:50 onyx.peridot
2007-05-29 12:26 ` Russ Cox [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070529122316.C7AD51E8C3B@holo.morphisms.net \
    --to=rsc@swtch.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).