#23116 [NEW]: call to curl_getinfo() causes SIGSEGV
| From: | shawn at wnsi dot net | Date: | Tue, 08 Apr 2003 18:19:17 +0000 |
| Subject: | #23116 [NEW]: call to curl_getinfo() causes SIGSEGV | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-37362@lists.php.net to get a copy of this message | ||
From: shawn at wnsi dot net
Operating system: Linux
PHP version: 4.3.1
PHP Bug Type: cURL related
Bug description: call to curl_getinfo() causes SIGSEGV
My script ( using php-cli ) loops over a result set and makes a curl post
for each row. It retreives all the data from the curl post for error
detection and performance data. After succesfully executing a random (
but usually between 50-120 ) number of posts the script will segfault on
the call to add_assoc_string_ex() called from within curl_getinfo().
Re-running the script from where it left off will result in another 50-120
succesful posts and another crash.
In addition I have been able to determine that it is not related to the
record being used as the post fields or the response from the receiving
end of the post. Sniffing from the side receiving the post that it crashed
on shows that it completed the communication succesfully before the crash.
The problem record goes through fine on the next run.
Removing the call to curl_getinfo() seems to resolve the problem.
System Details.......
#################################
[root@rambler root]# uname -a
Linux rambler.wnsglobal.net 2.4.7-10smp #1 SMP Thu Sep 6 16:16:16 EDT 2001
i686 unknown
[root@rambler root]# cat /etc/issue
Red Hat Linux release 7.2 (Enigma)
Kernel \r on an \m
#################################
PHP Details......
#################################
./configure --with-xml --enable-ftp --with-curl=/usr/local
--with-sybase=/opt/sybase --with-apxs=/usr/local/apache/bin/apxs
#################################
#cURL details
#################################
[root@rambler root]# curl --version
curl 7.10.3 (i686-pc-linux-gnu) libcurl/7.10.3 OpenSSL/0.9.7 zlib/1.1.3
#################################
#Script Details
#################################
Selects a large result set from mssql ( ~3K rows )
for each row it assembles an array to be used as the post fields for
curl...
curl commands are as follows...
#################################
$url_id = curl_init($postLoc);
curl_setopt( $url_id, CURLOPT_REFERER, $ref );
curl_setopt( $url_id, CURLOPT_TIMEOUT, '45' );
curl_setopt( $url_id, CURLOPT_MUTE, 1 );
curl_setopt( $url_id, CURLOPT_POST, 1 );
curl_setopt( $url_id, CURLOPT_POSTFIELDS, $post_fields );
curl_setopt( $url_id,
CURLOPT_RETURNTRANSFER,1);
$postResult = curl_exec( $url_id );
$curl_results = curl_getinfo($url_id);
$curl_error = curl_error($url_id);
$curl_errno = curl_errno($url_id);
curl_close ( $url_id );
#################################
#Back Trace ( recreated many times. Always the same. )
#################################
Program received signal SIGSEGV, Segmentation fault.
0x08128099 in add_assoc_string_ex (arg=0x824acf4,
key=0x81544ba "content_type", key_len=13, str=0x0, duplicate=1)
at /usr/src/php-4.3.0/Zend/zend_API.c:671
671 ZVAL_STRING(tmp, str, duplicate);
(gdb) bt
#0 0x08128099 in add_assoc_string_ex (arg=0x824acf4,
key=0x81544ba "content_type", key_len=13, str=0x0, duplicate=1)
at /usr/src/php-4.3.0/Zend/zend_API.c:671
#1 0x08066aff in zif_curl_getinfo (ht=1, return_value=0x824acf4,
this_ptr=0x0, return_value_used=1)
at /usr/src/php-4.3.0/ext/curl/curl.c:1042
#2 0x08138f4c in execute (op_array=0x81cb828)
at /usr/src/php-4.3.0/Zend/zend_execute.c:1596
#3 0x0813910a in execute (op_array=0x81bfedc)
at /usr/src/php-4.3.0/Zend/zend_execute.c:1640
#4 0x08126b5c in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at /usr/src/php-4.3.0/Zend/zend.c:864
#5 0x08100abd in php_execute_script (primary_file=0xbffffa60)
at /usr/src/php-4.3.0/main/main.c:1573
#6 0x081414c0 in main (argc=2, argv=0xbffffb04)
at /usr/src/php-4.3.0/sapi/cli/php_cli.c:746
#7 0x402b1507 in __libc_start_main (main=0x8140b40 <main>, argc=2,
ubp_av=0xbffffb04, init=0x806243c <_init>, fini=0x8141a80 <_fini>,
rtld_fini=0x4000dc14 <_dl_fini>, stack_end=0xbffffafc)
at ../sysdeps/generic/libc-start.c:129
--
Edit bug report at http://bugs.php.net/?id=23116&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23116&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23116&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23116&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23116&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23116&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23116&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23116&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23116&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23116&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23116&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23116&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23116&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23116&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23116&r=gnused