#18697 [NEW]: HTTP POST with libcurl can cause Segmentation fault
| From: | glen at designsolution dot co dot uk | Date: | Fri, 02 Aug 2002 07:21:59 +0000 |
| Subject: | #18697 [NEW]: HTTP POST with libcurl can cause Segmentation fault | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-15788@lists.php.net to get a copy of this message | ||
From: glen@designsolution.co.uk
Operating system: Linux
PHP version: 4.2.2
PHP Bug Type: cURL related
Bug description: HTTP POST with libcurl can cause Segmentation fault
I'm afraid this bug may be quite tricky to track down, but here goes:
This script:
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, 'http://www.foo.com/test.php' );
curl_setopt( $ch, CURLOPT_FAILONERROR, 1 );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
curl_setopt( $ch, CURLOPT_TIMEOUT, 3 ); // times out after 4s
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_POST, 1 );
curl_setopt( $ch, CURLOPT_POSTFIELDS,
'postvar1=php&postvar2=is&postvar3=great' );
$result = curl_exec( $ch );
curl_close( $ch );
echo "result = '$result'";
will work 9 out of 10 times with no problem at all. However, occasionally
it will crash Apache. The line in the error log says 'child pid 2154 exit
signal Segmentation fault (11)' and the browser will report 'The document
contains no data'.
I will attempt to get a backtrace if this will help.
Here is my configure line:
'./configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql=/usr/'
'--with-gd=/usr/local' '--with-png-dir=/usr/local'
'--with-zlib-dir=/usr'
'--with-jpeg-dir=/usr/local' '--with-crack=../cracklib-2.7'
'--with-curl=/usr/local' '--with-mcrypt=/usr/local'
'--with-pspell=/usr/local'
My phpinfo reports curl support as:
libcurl 7.9.6 (SSL 0.9.3)
Thanks,
Glen
--
Edit bug report at http://bugs.php.net/?id=18697&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18697&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18697&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18697&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18697&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18697&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18697&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18697&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18697&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18697&r=globals