Bug #67845 [Com]: Resource ids may overflow when running a daemon or large app
| From: | arnoldbarclay at gmail dot com | Date: | Mon, 25 Jan 2021 13:36:51 +0000 |
| Subject: | Bug #67845 [Com]: Resource ids may overflow when running a daemon or large app | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231753@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67845&edit=1
ID: 67845
Comment by: arnoldbarclay at gmail dot com
Reported by: blondie101010 at hotmail dot com
Summary: Resource ids may overflow when running a daemon or
large app
Status: Open
Type: Bug
Package: Streams related
Operating System: Gentoo
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Professionals from a mobile app development company in Dallas reveal that the major concern of such
is the extent to which artificial intelligence can be applied in daily operations. Throughout the
years, insurance wasnât eager when it came to introduce new technologies. for more info here https://www.branex.com/mobile-app-development/
Previous Comments:
------------------------------------------------------------------------
[2015-05-24 22:56:31] nikic@php.net
Related To: Bug #69702
------------------------------------------------------------------------
[2014-08-14 21:02:48] blondie101010 at hotmail dot com
Description:
------------
Working on a socket server, I had wondered what would happen when the resource id would reach 31
bits long, so I used the code below to test it.
Inevitably it failed at 2147483647.
A proactive solution would be for it to wrap once it reaches its limit, of course checking to see if
the resource is already assigned.
An alternative would be to reuse freed resource ids but I can already see many bad programmers who
would be scared by that option.
Test script:
---------------
<?php
for ($i = 0; $i < 5000000000; $i ++)
{
$fp = fopen("/dev/null", "w");
if (($i % 500000) == 0)
{
var_dump($fp);
system("date");
} // if
fclose($fp);
} // for
?>
Expected result:
----------------
Keep running as there are actually no resources in use.
Actual result:
--------------
It starts giving errors when it exceeds 31 bits on my 32 bit system.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67845&edit=1