Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jul 2001 09:07:00 -0500
From:      Mike Pritchard <mpp@mppsystems.com>
To:        mike@FreeBSD.org
Cc:        tri@iki.fi, freebsd-bugs@FreeBSD.org
Subject:   Re: kern/3384: telldir-seekdir can cause livelock
Message-ID:  <20010722090700.A24321@mppsystems.com>
In-Reply-To: <200107220604.f6M64M279916@freefall.freebsd.org>; from mike@FreeBSD.org on Sat, Jul 21, 2001 at 11:04:22PM -0700
References:  <200107220604.f6M64M279916@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 21, 2001 at 11:04:22PM -0700, mike@FreeBSD.org wrote:
> Synopsis: telldir-seekdir can cause livelock
> 
> State-Changed-From-To: open->feedback
> State-Changed-By: mike
> State-Changed-When: Sat Jul 21 23:04:06 PDT 2001
> State-Changed-Why: 
> 
> Does this problem still occur in newer versions of FreeBSD,
> such as 4.3-RELEASE?

This should probably just be closed.  The test program has bugs
in it that cause it to core dump (namely, when accessing file names
from the dirent structure, you need to only access dp->d_namlen characters.
You can't assume that the string is zero terminated.

Secondly, as the man page points out, trying to use a value returned by
telldir after the directory has been closed with closedir will not work
because the information has been freed.  All it takes to make
this test program fail (after fixing the d_namlen problem) is
to have a directory structure like:

./a/b/1
./a/b/2
./a/b/c
./a/b/c/1
./a/b/c/2

For whatever they are trying to do, they should probably use the
fts(3) routines instead.

-Mike
-- 
Mike Pritchard
mpp@FreeBSD.org or mpp@mppsystems.com

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?20010722090700.A24321>