Bug #73039 [NEW]: Temporary files not being cleaned up when shell_exec called
| From: | chu_man_fu at hotmail dot com | Date: | Wed, 07 Sep 2016 12:56:20 +0000 |
| Subject: | Bug #73039 [NEW]: Temporary files not being cleaned up when shell_exec called | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-203849@lists.php.net to get a copy of this message | ||
From: chu_man_fu at hotmail dot com
Operating system: Windows Server 2012 R2
PHP version: 5.6.25
Package: Streams related
Bug Type: Bug
Bug description:Temporary files not being cleaned up when shell_exec called
Description:
------------
I have noticed the temp directory on the web server is full of files
named php*.tmp.
The contents of these files is POST data for various ajax calls (mainly
the same group of calls). There isn't a temp file per call. If I watch
the directoy I can see most temp files appear and then get deleted.
However, for whatever reason, sometimes these files are not cleaned up.
The only way I have been able to reproduce this error is using apache
bench to post data (26KB) to a script which uses the shell_exec, exec,
popen command:
<?php
shell_exec("dir");
echo "FINISHED";
?>
It will only produce the temp file when there is concurrency and lots of
requests for each:
ab -p <post_data_file> -c 3 -n 30 <url_to_script>
Our system does perform calls to popen() but the POST data temp files
which are being left behind are not always for calls which invoke this
function.
I can produce the issue on 5.6.24 and 5.6.25.
I have tried on the following versions and not been able to reproduce
it: 5.4.44, 5.5.25, 7.1
I not beein able to reproduce the issue on a Mac running 5.6.18.
--
Edit bug report at https://bugs.php.net/bug.php?id=73039&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73039&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73039&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73039&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73039&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73039&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73039&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73039&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73039&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73039&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73039&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73039&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73039&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73039&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73039&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73039&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73039&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73039&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73039&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73039&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73039&r=mysqlcfg