Bug #71613 [NEW]: nonblocking UDP stream_socket_recvfrom() memory leak
| From: | jnelson at archive dot org | Date: | Tue, 16 Feb 2016 21:45:56 +0000 |
| Subject: | Bug #71613 [NEW]: nonblocking UDP stream_socket_recvfrom() memory leak | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-199280@lists.php.net to get a copy of this message | ||
From: jnelson at archive dot org
Operating system: Ubuntu
PHP version: 5.5.32
Package: Performance problem
Bug Type: Bug
Bug description:nonblocking UDP stream_socket_recvfrom() memory leak
Description:
------------
While coding a UDP server with stream_socket_recvfrom(), I found a
memory leak when (a) the stream is set to nonblocking mode, (b) the
optional $address reference is passed, and (c) no data is ready. If
$address is not passed, there is no leak.
It appears the leak only occurs if there's some traffic on the socket,
meaning that this won't happen simply listening on a quiet port. I'm
including two scripts, client.php and server.php, which must be run
together for the server script to exhibit the leak.
Test script:
---------------
client.php: http://archive.org/~jnelson/client.php.txt
server.php: http://archive.org/~jnelson/server.php.txt
Expected result:
----------------
Expect memory usage to remain roughly the same for the duration of
execution.
Actual result:
--------------
server.php's memory usage gradually increases over time, but only if
$address is requested in the call to stream_socket_recvfrom().
--
Edit bug report at https://bugs.php.net/bug.php?id=71613&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71613&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71613&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71613&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71613&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71613&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71613&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71613&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71613&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71613&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71613&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71613&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71613&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71613&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71613&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71613&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71613&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71613&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71613&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71613&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71613&r=mysqlcfg