#23573 [NEW]: fread with large number kills script
| From: | fidian at tiny dot net | Date: | Sat, 10 May 2003 03:43:03 +0000 |
| Subject: | #23573 [NEW]: fread with large number kills script | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-39413@lists.php.net to get a copy of this message | ||
From: fidian at tiny dot net
Operating system: Linux 2.4.18-586tsc
PHP version: 4.3.2RC1
PHP Bug Type: Reproducible crash
Bug description: fread with large number kills script
Running this script causes the server to close the connection. When doing
a similar operation to delete a record at the end of the file, the server
will run the script, delete the record, restart the script, try to delete
a non-existant record (I coded an error message) and then works the second
time but it thinks it couldn't delete the record. Really weird.
I am using the Debian packaged version of PHP. phpinfo() returns this
information:
Linux cyberhq 2.4.21-pre5 #1 SMP Sat Mar 1 00:30:11 PST 2003 i686 unknown
unknown GNU/Linux
Apache/1.3.27 (Unix) Debian GNU/Linux PHP/4.2.3 mod_ssl/2.8.14
OpenSSL/0.9.7a
Build Date Apr 21 2003 01:48:55
If you need the configure line, just email me. I don't think it is
relevant.
Here is my script that I used to finally track down the bug.
<?PHP
// These few lines are for a good hit counter
// to see the problem easier.
// They don't need to be here to show the problem.
// Seed the "hit.txt" file with an initial number
$fp = fopen('hit.txt', 'rb');
$Hit = fgets($fp, 1024);
fclose($fp);
$Hit ++;
echo "Hit: $Hit<br>\n";
$fp = fopen('hit.txt', 'wb');
fputs($fp, $Hit);
fclose($fp);
// The problem.
$fp = fopen('php_bug.txt', "w+");
// Uncomment this to kill the process.
//fread($fp, 1080648704);
echo "Done.";
--
Edit bug report at http://bugs.php.net/?id=23573&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23573&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23573&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23573&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23573&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23573&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23573&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23573&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23573&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23573&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23573&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23573&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23573&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23573&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23573&r=gnused