Bug #15665 Updated: readdir() crashes
| From: | jason at jase dot org | Date: | Wed, 08 May 2002 08:33:49 +0000 |
| Subject: | Bug #15665 Updated: readdir() crashes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-7203@lists.php.net to get a copy of this message | ||
ID: 15665
Updated by: jason@jase.org
Reported By: david@acz.org
Status: Open
Bug Type: Reproducible crash
Operating System: FreeBSD 4.4-STABLE
PHP Version: 4.1.1
New Comment:
See:
http://bugs.php.net/bug.php?id=16905 (closed)
&&
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/37825
(patch)
Jason
Previous Comments:
------------------------------------------------------------------------
[2002-04-13 08:55:39] noemail@a.ml
forgon to tell you...
apache 1.3.22 and php4.1.1 (both from the ports collection)
------------------------------------------------------------------------
[2002-04-13 08:54:30] noemail@a.ml
I have the same problems with a script under freebsd4.5-release.
It just started crasching out of nothing. No change in the dirscancode,
no change on the server. Worked just fine before yesterday. The only
way to run the script now is to press the updatebutton in
internetexplorer several times quite quickly, it works when I do so (I
get about 5-6 httpds wotrking in the background).
This is so strange.
------------------------------------------------------------------------
[2002-02-22 03:47:22] david@acz.org
The option is --enable-debug, right? --with-debug appeared to do
nothing. When compiled with --enable-debug, the script did not crash.
But it certainly crashes with a normal build without debugging.
------------------------------------------------------------------------
[2002-02-21 19:30:43] david@acz.org
I'll compile PHP from source with debugging and test tomorrow. Can't
do it today since I just changed the code to exec find, and it already
processed today's files (is a webserver log processing helper script).
You're right, I know about the 0/false issue, but I was lazy since all
the filenames will always be fully qualified hostnames :)
I don't remember exactly how many times readdir() was being called
before it crashed, but probably somewhere between 100-200. When it
first crashed, I noticed I had been calling that function a lot without
using closedir(), but after I added it and only called it once on a
single directory, it still crashed.
------------------------------------------------------------------------
[2002-02-21 18:50:04] mfischer@php.net
Can you enable --with-debug please and post a backtrace?
Btw, how often have you to call readdir() until it crashes?
Btw, your code won't work for directories containing files or dirs
naming like '0'; see the manual page and use 'while (false !== ($s =
readdir() ...'
Also, can you try the source relese itself please and not a/the port?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15665
--
Edit this bug report at http://bugs.php.net/?id=15665&edit=1