#40635 [NEW]: segfault in curl extension

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40635 [NEW]: segfault in curl extension

    From: shar at cflash dot com
    Operating system: FreeBSD 4.11, 6.2
    PHP version: 4.4.6RC1
    PHP Bug Type: cURL related
    Bug description: segfault in curl extension

    Description:
    ------------
    php segfaults on curl_exec, 2nd call in the sample code. Crashes with
    4.4.5 and STABLE-200702260130 snapshot.

    Reproduce code:
    ---------------
    <?
    $url="http://www.php.net/";

    $l = curl_init ();

    curl_setopt ($l, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($l, CURLOPT_URL, "{$url}/index.php");
    curl_exec ($l);

    curl_setopt ($l, CURLOPT_URL, $url);
    $r = curl_exec ($l);
    ?>

    Expected result:
    ----------------
    run w/o segfault

    Actual result:
    --------------
    #0 0x80eb7fc in _erealloc (ptr=0x81be024, size=28520, allow_failure=0,
    __zend_filename=0x28289ba0
    "/usr/local/include/php/ext/standard/php_smart_str.h", __zend_lineno=83,
    __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at
    /usr/ports-current/ports/lang/php4/work/php4-STABLE-200702260130/Zend/zend_alloc.c:350
    350 REMOVE_POINTER_FROM_LIST(p);

    #1 0x28286bc2 in curl_write (
    data=0x81b55b4 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
    Strict//EN\"\n
    ", ' ' <repeats 22 times>,
    "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\
    ">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"
    lang=\"en\">\n"..., size=1, nmemb=1076, ctx=0x81a8a24)
    at /usr/local/include/php/ext/standard/php_smart_str.h:83
    83 smart_str_alloc(dest, len, what);


    #2 0x2829cb6c in Curl_client_write () from /usr/local/lib/libcurl.so.4
    #3 0x282b05b9 in Curl_httpchunk_read () from /usr/local/lib/libcurl.so.4
    #4 0x282ae389 in Curl_readwrite () from /usr/local/lib/libcurl.so.4
    #5 0x282aefda in Transfer () from /usr/local/lib/libcurl.so.4
    #6 0x282af90f in Curl_perform () from /usr/local/lib/libcurl.so.4
    #7 0x282afea5 in curl_easy_perform () from /usr/local/lib/libcurl.so.4
    #8 0x28288fbf in zif_curl_exec (ht=1, return_value=0x81b3724,
    this_ptr=0x0,
    return_value_used=1)
    at
    /usr/ports-current/ports/ftp/php4-curl/work/php4-STABLE-200702260130/ext/curl/curl.c:1294

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

  2. Similar Questions and Discussions

    1. #40179 [NEW]: Compilation of cURL extension fails with cURL 7.16.0
      From: iain at workingsoftware dot com dot au Operating system: FreeBSD 6.0 PHP version: 5.2.0 PHP Bug Type: Compile Failure...
    2. #39933 [NEW]: Curl extension is missing CURLOPT_TCP_NODELAY
      From: gopalv@php.net Operating system: linux-i686 PHP version: 5CVS-2006-12-22 (CVS) PHP Bug Type: cURL related Bug...
    3. #39182 [NEW]: https URLs with curl causes segfault
      From: shawn at digitalpoint dot com Operating system: SuSE Linux Enterprise 9.3 PHP version: 5.1.6 PHP Bug Type: cURL related...
    4. #22213 [Opn->Fbk]: Apache mod_ssl + PHP + cURL SSL segfault
      ID: 22213 Updated by: sniper@php.net Reported By: alan at pair dot com -Status: Open +Status: ...
    5. #22213 [Com]: Apache mod_ssl + PHP + cURL SSL segfault
      ID: 22213 Comment by: php at dpk dot net Reported By: alan at pair dot com Status: Open Bug Type: cURL...
  3. #2

    Default #40635 [Opn->Csd]: segfault in curl extension

    ID: 40635
    Updated by: [email]tony2001@php.net[/email]
    Reported By: shar at cflash dot com
    -Status: Open
    +Status: Closed
    Bug Type: cURL related
    Operating System: FreeBSD 4.11, 6.2
    PHP Version: 4.4.6RC1
    New Comment:

    This bug has been fixed in CVS.

    Snapshots of the sources are packaged every three hours; this change
    will be in the next snapshot. You can grab the snapshot at
    [url]http://snaps.php.net/[/url].

    Thank you for the report, and for helping us make PHP better.




    Previous Comments:
    ------------------------------------------------------------------------

    [2007-02-26 05:36:00] shar at cflash dot com

    Description:
    ------------
    php segfaults on curl_exec, 2nd call in the sample code. Crashes with
    4.4.5 and STABLE-200702260130 snapshot.

    Reproduce code:
    ---------------
    <?
    $url="http://www.php.net/";

    $l = curl_init ();

    curl_setopt ($l, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($l, CURLOPT_URL, "{$url}/index.php");
    curl_exec ($l);

    curl_setopt ($l, CURLOPT_URL, $url);
    $r = curl_exec ($l);
    ?>

    Expected result:
    ----------------
    run w/o segfault

    Actual result:
    --------------
    #0 0x80eb7fc in _erealloc (ptr=0x81be024, size=28520, allow_failure=0,

    __zend_filename=0x28289ba0
    "/usr/local/include/php/ext/standard/php_smart_str.h",
    __zend_lineno=83, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at
    /usr/ports-current/ports/lang/php4/work/php4-STABLE-200702260130/Zend/zend_alloc.c:350
    350 REMOVE_POINTER_FROM_LIST(p);

    #1 0x28286bc2 in curl_write (
    data=0x81b55b4 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
    Strict//EN\"\n
    ", ' ' <repeats 22 times>,
    "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\
    ">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"
    lang=\"en\">\n"..., size=1, nmemb=1076, ctx=0x81a8a24)
    at /usr/local/include/php/ext/standard/php_smart_str.h:83
    83 smart_str_alloc(dest, len, what);


    #2 0x2829cb6c in Curl_client_write () from
    /usr/local/lib/libcurl.so.4
    #3 0x282b05b9 in Curl_httpchunk_read () from
    /usr/local/lib/libcurl.so.4
    #4 0x282ae389 in Curl_readwrite () from /usr/local/lib/libcurl.so.4
    #5 0x282aefda in Transfer () from /usr/local/lib/libcurl.so.4
    #6 0x282af90f in Curl_perform () from /usr/local/lib/libcurl.so.4
    #7 0x282afea5 in curl_easy_perform () from
    /usr/local/lib/libcurl.so.4
    #8 0x28288fbf in zif_curl_exec (ht=1, return_value=0x81b3724,
    this_ptr=0x0,
    return_value_used=1)
    at
    /usr/ports-current/ports/ftp/php4-curl/work/php4-STABLE-200702260130/ext/curl/curl.c:1294


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40635&edit=1[/url]
    tony2001@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139