From:             [EMAIL PROTECTED]
Operating system: Linux/FreeBSD
PHP version:      5.3CVS-2008-05-17 (CVS)
PHP Bug Type:     cURL related
Bug description:  POST requests have an emalloc leak

Description:
------------
Adding a bug for this so we can track it.

The leak size isn't constant even though the post data size in this
example is constant, and the returned data (a dns error, presumably) is the
same.  Seems like there is something weird in our postfield handling code
in the curl extension.  Note also that it stabilizes somehow, although this
is an extremely simplified version of a long-running command-line script
that seems to grow on each post with wildly varying post data. 

Reproduce code:
---------------
<?php
function curl($post) {
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "www.fdhfkdsslak.bogus");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  if($post) {
    curl_setopt($ch, CURLOPT_POST, 1);
    for($args='',$i=0;$i<75;$i++) $args .= "a=$i&";
    curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
    unset($args);
  }
  curl_exec($ch);
  curl_close($ch);
}
echo "start ".memory_get_usage()."\n";
for($i=0;$i<10;$i++) {
  curl(0);
  echo "GET ".memory_get_usage()."\n";
}
for($i=0;$i<10;$i++) {
  curl(1);
  echo "POST ".memory_get_usage()."\n";
}
?>


Expected result:
----------------
No memory_usage increase from one POST request to the next.

Actual result:
--------------
start 326616
GET 327256
GET 327276
GET 327276
GET 327276
GET 327276
GET 327276
GET 327276
GET 327276
GET 327276
GET 327276
POST 327516
POST 327588
POST 327652
POST 327712
POST 327892
POST 328064
POST 328228
POST 328384
POST 328528
POST 328628 

-- 
Edit bug report at http://bugs.php.net/?id=45029&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45029&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45029&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45029&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45029&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45029&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45029&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45029&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45029&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45029&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45029&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45029&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45029&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45029&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45029&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45029&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45029&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45029&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45029&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45029&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45029&r=mysqlcfg

Reply via email to