Ask a Question related to PHP Bugs, Design and Development.
-
adam-phpbugs at adam dot gs #1
#40633 [NEW]: disk_free_space returns a bad result on filesystems with negative free space
From: adam-phpbugs at adam dot gs
Operating system: *BSD (at least)
PHP version: 5.2.1
PHP Bug Type: Filesystem function related
Bug description: disk_free_space returns a bad result on filesystems with negative free space
Description:
------------
on a filesystem with a negative amount of free space (this
can happen on at least FreeBSD) disk_free_space returns
unreasonable results.
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:55]=-
[root@cube]# php -r 'print disk_free_space(".")."\n";'
3.77789318629E+22
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:57]=-
[root@cube]# df -h .
Filesystem Size Used Avail Capacity Mounted on
/dev/ad7 289G 289G -23G 109% /some/path
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:58]=-
[root@cube]# df .
Filesystem 1K-blocks Used Avail Capacity Mounted
on
/dev/ad7 302732078 302699550 -24186038 109% /some/
path
Reproduce code:
---------------
php -r 'print disk_free_space(".")."\n";'
Expected result:
----------------
-24186038
Actual result:
--------------
3.77789318629E+22
--
Edit bug report at [url]http://bugs.php.net/?id=40633&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40633&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40633&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40633&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40633&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=40633&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=40633&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40633&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=40633&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=40633&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=40633&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=40633&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=40633&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=40633&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40633&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=40633&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=40633&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40633&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=40633&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40633&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40633&r=mysqlcfg[/url]
adam-phpbugs at adam dot gs Guest
-
How come the web service returns no result ?
Hi everyone, If possible, please tell me how come the two trace statements return nothing. <mx:Script> <!]> </mx:Script> ... -
Calc returns garbled result
What am I doing wrong here, it doesn't work? Field payment date is formatted 01/01/2001 Next Payment Due= DateToText(Date(Month(Payment Date)... -
how to get (free) space of a drive?
How can I find out how much space the drive has got and how much free space is remaining on it? thx -
Looking into a recordset until it returns a result
I currently connect to two servers. One is IIS, that runs my asp and sql server, and the other is an AS400, that also cranks out data. Sometimes I... -
How much free space left on ext. FW drive?
In article <heronstone-5836B6.21001722062003@netnews.attbi.com>, heron stone <heronstone@attbi.com> wrote: 5% of their total size. -
tony2001@php.net #2
#40633 [Opn->Fbk]: disk_free_space returns a bad result on filesystems with negative free space
ID: 40633
Updated by: [email]tony2001@php.net[/email]
Reported By: adam-phpbugs at adam dot gs
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: *BSD (at least)
PHP Version: 5.2.1
New Comment:
What kind of BSD is that and don't you think that negative free space
is a BSD bug?
Previous Comments:
------------------------------------------------------------------------
[2007-02-26 00:55:02] adam-phpbugs at adam dot gs
Description:
------------
on a filesystem with a negative amount of free space (this
can happen on at least FreeBSD) disk_free_space returns
unreasonable results.
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:55]=-
[root@cube]# php -r 'print disk_free_space(".")."\n";'
3.77789318629E+22
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:57]=-
[root@cube]# df -h .
Filesystem Size Used Avail Capacity Mounted on
/dev/ad7 289G 289G -23G 109% /some/path
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:58]=-
[root@cube]# df .
Filesystem 1K-blocks Used Avail Capacity Mounted
on
/dev/ad7 302732078 302699550 -24186038 109% /some/
path
Reproduce code:
---------------
php -r 'print disk_free_space(".")."\n";'
Expected result:
----------------
-24186038
Actual result:
--------------
3.77789318629E+22
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40633&edit=1[/url]
tony2001@php.net Guest
-
adam-phpbugs at adam dot gs #3
#40633 [Fbk->Opn]: disk_free_space returns a bad result on filesystems with negative free space
ID: 40633
User updated by: adam-phpbugs at adam dot gs
Reported By: adam-phpbugs at adam dot gs
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: *BSD (at least)
PHP Version: 5.2.1
New Comment:
This was FreeBSD
if you look at the FreeBSD manpage for tunefs(8), this is
the intended behaviour.
[url]http://www.freebsd.org/cgi/man.cgi?[/url]
query=tunefs&apropos=0&sektion=0&manpath=FreeBSD+6 .2-
RELEASE&format=html
Basically, in FreeBSD (under UFS2 at least) avaliable space
is calculated as total minus used minus reserved. A small %
(8 by default) is reserved.
So, this is not really a bug, but actually an intended
feature.
Previous Comments:
------------------------------------------------------------------------
[2007-02-26 09:33:41] [email]tony2001@php.net[/email]
What kind of BSD is that and don't you think that negative free space
is a BSD bug?
------------------------------------------------------------------------
[2007-02-26 00:55:02] adam-phpbugs at adam dot gs
Description:
------------
on a filesystem with a negative amount of free space (this
can happen on at least FreeBSD) disk_free_space returns
unreasonable results.
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:55]=-
[root@cube]# php -r 'print disk_free_space(".")."\n";'
3.77789318629E+22
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:57]=-
[root@cube]# df -h .
Filesystem Size Used Avail Capacity Mounted on
/dev/ad7 289G 289G -23G 109% /some/path
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:58]=-
[root@cube]# df .
Filesystem 1K-blocks Used Avail Capacity Mounted
on
/dev/ad7 302732078 302699550 -24186038 109% /some/
path
Reproduce code:
---------------
php -r 'print disk_free_space(".")."\n";'
Expected result:
----------------
-24186038
Actual result:
--------------
3.77789318629E+22
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40633&edit=1[/url]
adam-phpbugs at adam dot gs Guest
-
adam-phpbugs at adam dot gs #4
#40633 [Opn]: disk_free_space returns a bad result on filesystems with negative free space
ID: 40633
User updated by: adam-phpbugs at adam dot gs
Reported By: adam-phpbugs at adam dot gs
Status: Open
Bug Type: Filesystem function related
-Operating System: *BSD (at least)
+Operating System: FreeBSD
PHP Version: 5.2.1
New Comment:
changing OS to FreeBSD
Previous Comments:
------------------------------------------------------------------------
[2007-02-26 13:32:36] adam-phpbugs at adam dot gs
This was FreeBSD
if you look at the FreeBSD manpage for tunefs(8), this is
the intended behaviour.
[url]http://www.freebsd.org/cgi/man.cgi?[/url]
query=tunefs&apropos=0&sektion=0&manpath=FreeBSD+6 .2-
RELEASE&format=html
Basically, in FreeBSD (under UFS2 at least) avaliable space
is calculated as total minus used minus reserved. A small %
(8 by default) is reserved.
So, this is not really a bug, but actually an intended
feature.
------------------------------------------------------------------------
[2007-02-26 09:33:41] [email]tony2001@php.net[/email]
What kind of BSD is that and don't you think that negative free space
is a BSD bug?
------------------------------------------------------------------------
[2007-02-26 00:55:02] adam-phpbugs at adam dot gs
Description:
------------
on a filesystem with a negative amount of free space (this
can happen on at least FreeBSD) disk_free_space returns
unreasonable results.
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:55]=-
[root@cube]# php -r 'print disk_free_space(".")."\n";'
3.77789318629E+22
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:57]=-
[root@cube]# df -h .
Filesystem Size Used Avail Capacity Mounted on
/dev/ad7 289G 289G -23G 109% /some/path
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:58]=-
[root@cube]# df .
Filesystem 1K-blocks Used Avail Capacity Mounted
on
/dev/ad7 302732078 302699550 -24186038 109% /some/
path
Reproduce code:
---------------
php -r 'print disk_free_space(".")."\n";'
Expected result:
----------------
-24186038
Actual result:
--------------
3.77789318629E+22
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40633&edit=1[/url]
adam-phpbugs at adam dot gs Guest
-
tony2001@php.net #5
#40633 [Opn->Fbk]: disk_free_space returns a bad result on filesystems with negative free space
ID: 40633
Updated by: [email]tony2001@php.net[/email]
Reported By: adam-phpbugs at adam dot gs
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: FreeBSD
PHP Version: 5.2.1
New Comment:
Please provide an SSH account on a machine where I can reproduce it.
Previous Comments:
------------------------------------------------------------------------
[2007-02-26 13:33:03] adam-phpbugs at adam dot gs
changing OS to FreeBSD
------------------------------------------------------------------------
[2007-02-26 13:32:36] adam-phpbugs at adam dot gs
This was FreeBSD
if you look at the FreeBSD manpage for tunefs(8), this is
the intended behaviour.
[url]http://www.freebsd.org/cgi/man.cgi?[/url]
query=tunefs&apropos=0&sektion=0&manpath=FreeBSD+6 .2-
RELEASE&format=html
Basically, in FreeBSD (under UFS2 at least) avaliable space
is calculated as total minus used minus reserved. A small %
(8 by default) is reserved.
So, this is not really a bug, but actually an intended
feature.
------------------------------------------------------------------------
[2007-02-26 09:33:41] [email]tony2001@php.net[/email]
What kind of BSD is that and don't you think that negative free space
is a BSD bug?
------------------------------------------------------------------------
[2007-02-26 00:55:02] adam-phpbugs at adam dot gs
Description:
------------
on a filesystem with a negative amount of free space (this
can happen on at least FreeBSD) disk_free_space returns
unreasonable results.
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:55]=-
[root@cube]# php -r 'print disk_free_space(".")."\n";'
3.77789318629E+22
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:57]=-
[root@cube]# df -h .
Filesystem Size Used Avail Capacity Mounted on
/dev/ad7 289G 289G -23G 109% /some/path
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:58]=-
[root@cube]# df .
Filesystem 1K-blocks Used Avail Capacity Mounted
on
/dev/ad7 302732078 302699550 -24186038 109% /some/
path
Reproduce code:
---------------
php -r 'print disk_free_space(".")."\n";'
Expected result:
----------------
-24186038
Actual result:
--------------
3.77789318629E+22
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40633&edit=1[/url]
tony2001@php.net Guest
-
tony2001@php.net #6
#40633 [Fbk->Ana]: disk_free_space returns a bad result on filesystems with negative free space
ID: 40633
Updated by: [email]tony2001@php.net[/email]
Reported By: adam-phpbugs at adam dot gs
-Status: Feedback
+Status: Analyzed
Bug Type: Filesystem function related
Operating System: FreeBSD
PHP Version: 5.2.1
-Assigned To:
+Assigned To: tony2001
Previous Comments:
------------------------------------------------------------------------
[2007-02-26 15:44:08] [email]tony2001@php.net[/email]
Please provide an SSH account on a machine where I can reproduce it.
------------------------------------------------------------------------
[2007-02-26 13:33:03] adam-phpbugs at adam dot gs
changing OS to FreeBSD
------------------------------------------------------------------------
[2007-02-26 13:32:36] adam-phpbugs at adam dot gs
This was FreeBSD
if you look at the FreeBSD manpage for tunefs(8), this is
the intended behaviour.
[url]http://www.freebsd.org/cgi/man.cgi?[/url]
query=tunefs&apropos=0&sektion=0&manpath=FreeBSD+6 .2-
RELEASE&format=html
Basically, in FreeBSD (under UFS2 at least) avaliable space
is calculated as total minus used minus reserved. A small %
(8 by default) is reserved.
So, this is not really a bug, but actually an intended
feature.
------------------------------------------------------------------------
[2007-02-26 09:33:41] [email]tony2001@php.net[/email]
What kind of BSD is that and don't you think that negative free space
is a BSD bug?
------------------------------------------------------------------------
[2007-02-26 00:55:02] adam-phpbugs at adam dot gs
Description:
------------
on a filesystem with a negative amount of free space (this
can happen on at least FreeBSD) disk_free_space returns
unreasonable results.
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:55]=-
[root@cube]# php -r 'print disk_free_space(".")."\n";'
3.77789318629E+22
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:57]=-
[root@cube]# df -h .
Filesystem Size Used Avail Capacity Mounted on
/dev/ad7 289G 289G -23G 109% /some/path
-=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:58]=-
[root@cube]# df .
Filesystem 1K-blocks Used Avail Capacity Mounted
on
/dev/ad7 302732078 302699550 -24186038 109% /some/
path
Reproduce code:
---------------
php -r 'print disk_free_space(".")."\n";'
Expected result:
----------------
-24186038
Actual result:
--------------
3.77789318629E+22
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40633&edit=1[/url]
tony2001@php.net Guest



Reply With Quote

