Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Nov 2000 12:45:32 +0200
From:      Peter Pentchev <roam@orbitel.bg>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, David Malone <dwmalone@maths.tcd.ie>, will@FreeBSD.ORG, bugs@FreeBSD.ORG, gnats-submit@FreeBSD.ORG
Subject:   Re: bin/19978: /usr/bin/make segfaults w/o Makefile for root (over NFS)
Message-ID:  <20001107124532.E314@ringworld.oblivion.bg>
In-Reply-To: <Pine.BSF.4.21.0011072125130.2869-100000@besplex.bde.org>; from bde@zeta.org.au on Tue, Nov 07, 2000 at 09:29:39PM %2B1100
References:  <Pine.BSF.4.30.0011052331360.15575-100000@deneb.dbai.tuwien.ac.at> <Pine.BSF.4.21.0011072125130.2869-100000@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Could the attached patch do something about it? It's against RELENG_4
(rev 1.10 of dir.c).

G'luck,
Peter

-- 
When you are not looking at it, this sentence is in Spanish.

On Tue, Nov 07, 2000 at 09:29:39PM +1100, Bruce Evans wrote:
> On Sun, 5 Nov 2000, Gerald Pfeifer wrote:
> 
> > On Sun, 5 Nov 2000, David Malone wrote:
> > > I've reopened the PR.
> > 
> > Thanks!
> > 
> > > Can you either get a back trace of the core from make using gdb or
> > > ktrace it, so we can see what it was doing when it died?
> 
> >  15545 make     CALL  stat(0x805b887,0xbfbfeb64)
> >  15545 make     NAMI  "."
> >  15545 make     RET   stat 0
> >  15545 make     CALL  open(0x805b887,0x4,0x280f8190)
> >  15545 make     NAMI  "."
> >  15545 make     RET   open -1 errno 13 Permission denied
> >  15545 make     PSIG  SIGSEGV SIG_DFL
> >  15545 make     NAMI  "/tmp/make.core"
> 
> This output made it easy to reproduce the bug in a simpler way:
> 
>     $ cd /tmp
>     $ mkdir z
>     $ cd z
>     $ chmod 0 /tmp/z
>     $ make
>     Segmentation fault

diff -urN src/usr.bin/make/dir.c mysrc/usr.bin/make/dir.c
--- src/usr.bin/make/dir.c	Sat Sep 11 16:08:01 1999
+++ mysrc/usr.bin/make/dir.c	Tue Nov  7 12:42:20 2000
@@ -225,6 +225,8 @@
      */
     Dir_AddDir (openDirectories, ".");
     dot = (Path *) Lst_DeQueue (openDirectories);
+    if (dot == (Path *) NIL)
+	err(1, "cannot open current directory");
 
     /*
      * We always need to have dot around, so we increment its reference count


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001107124532.E314>