Bug #60253 [Bgs]: readfile() fails and gives no error
Edit report at https://bugs.php.net/bug.php?id=60253&edit=1
ID: 60253
Updated by: pierrick@php.net
Reported by: dario at minttwist dot com
Summary: readfile() fails and gives no error
Status: Bogus
Type: Bug
Package: Filesystem function related
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Maybe some race conditions. One instance of your resize.php file is trying to
read it while an other one is writing it.
Previous Comments:
------------------------------------------------------------------------
[2011-11-10 18:18:33] dario at minttwist dot com
Ok, makes perfect sense - so why are they empty just sometimes..? The file is
always the same - or at least it's generated always following the same process.
------------------------------------------------------------------------
[2011-11-10 18:15:09] pierrick@php.net
Sorry I missed htaccess file.
The images containing "8: *,,,*" are there because the file exists but is empty.
Since the file is empty readfile return an empty string and did not failed.
------------------------------------------------------------------------
[2011-11-09 21:04:49] dario at minttwist dot com
What do you mean with include them? There is just one rule inside which is essential to
reproduce the bug
------------------------------------------------------------------------
[2011-11-09 20:58:51] pierrick@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
It looks like you're using some rewrite rules in your reproduce script. Could you
include them ?
------------------------------------------------------------------------
[2011-11-09 18:56:29] dario at minttwist dot com
Description:
------------
It seems like readfile() is failing without giving any error.
It apparently happens when you call readfile() several times in a short amount
of time. It can also be because I'm trying to read a file which as just been
saved in the filesystem.
In this case it's running on PHP 5.2.6 but it seems to be happening on other
versions as well.
Configure command: './configure' '--enable-bcmath' '--enable-calendar'
'--
enable-exif' '--enable-ftp' '--enable-gd-native-ttf'
'--enable-libxml' '--
enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--with-
curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/usr'
'--with-gd'
'--with-gettext' '--with-jpeg-dir=/usr' '--with-kerberos'
'--with-libxml-
dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr'
'--with-
mysqli' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr'
'--
with-openssl-dir=/usr' '--with-png-dir=/usr' '--with-ttf'
'--with-xmlrpc' '--
with-xpm-dir=/usr/X11R6' '--with-xsl=/opt/xslt/' '--with-zlib'
'--with-zlib-
dir=/usr' '--enable-soap' '--with-mssql=/usr' '--enable-pdo'
'--with-pdo-mysql'
'--with-imap=/usr/local/imap' '--enable-zip' '--with-ldap'
'--with-tidy' '--
with-magickwand=/usr' '--with-mhash' '--with-pgsql'
'--with-imap-ssl' '--with-
pdo-pgsql'
Test script:
---------------
Download source: http://www.mtcodelab.com/Development/PHP-bug/source.zip
See it in action: http://www.mtcodelab.com/Development/PHP-bug/
Expected result:
----------------
I expect to see 10 times the same image, always.
Actual result:
--------------
Sometimes some images containing "8: *,,,*" appear. If you don't see them, try
refreshing. It shouldn't happen!
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60253&edit=1
Thread (7 messages)