#38631 [Bgs]: fopen('https://...') or curl with https gives Segmentation fault

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

  1. #1

    Default #38631 [Bgs]: fopen('https://...') or curl with https gives Segmentation fault

    ID: 38631
    Updated by: [email]darkelder@php.net[/email]
    Reported By: roberto dot berto at gmail dot com
    Status: Bogus
    Bug Type: cURL related
    Operating System: RHEL3
    PHP Version: 4.4.4
    New Comment:

    Duplicate of [url]http://bugs.php.net/bug.php?id=38631[/url]


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

    [2006-08-28 16:14:59] [email]tony2001@php.net[/email]

    The backtrace clearly shows that it's not PHP problem.

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

    [2006-08-28 16:09:41] roberto dot berto at gmail dot com

    Description:
    ------------
    While using fopen or CURL with https:// PHP returns 'Segmentation
    fault'

    Reproduce code:
    ---------------
    <?php
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://foo/');
    curl_exec($ch);
    curl_close($ch);
    ?>

    or

    <?php
    print join('', file('htps://foo'));
    ?>


    PHP compile:
    './configure' '--with-apxs=/usr/local/apache/bin/apxs'
    '--prefix=/usr/local' '--with-xml' '--enable-bcmath'
    '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt'
    '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd'
    '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
    '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-iconv'
    '--with-imap=/usr/local/imap-2004g' '--enable-mbstring'
    '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt'
    '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr'
    '--with-openssl' '--enable-discard-path' '--with-pear'
    '--with-pgsql=/usr' '--enable-xslt' '--with-xslt-sablot'
    '--enable-safe-mode' '--enable-sockets' '--enable-track-vars'
    '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf'
    '--enable-versioning' '--with-xmlrpc' '--with-zip' '--with-zlib'


    Expected result:
    ----------------
    Return url content

    Actual result:
    --------------
    For file():


    #0 0x00508272 in BN_num_bits () from /usr/lib/libcrypto.so.4
    #1 0x0054d1d0 in X509_ATTRIBUTE_create () from
    /usr/lib/libcrypto.so.4
    #2 0x00553fc5 in asn1_ex_i2c () from /usr/lib/libcrypto.so.4
    #3 0x00553d31 in ASN1_template_i2d () from /usr/lib/libcrypto.so.4
    #4 0x00553437 in ASN1_item_ex_i2d () from /usr/lib/libcrypto.so.4
    #5 0x00553968 in ASN1_template_i2d () from /usr/lib/libcrypto.so.4
    #6 0x00553500 in ASN1_item_ex_i2d () from /usr/lib/libcrypto.so.4
    #7 0x005532cd in ASN1_item_i2d () from /usr/lib/libcrypto.so.4
    #8 0x00518db0 in i2d_DHparams () from /usr/lib/libcrypto.so.4
    #9 0x00548dba in ASN1_dup () from /usr/lib/libcrypto.so.4
    #10 0x001b1ade in ssl3_connect () from /usr/lib/libssl.so.4
    #11 0x001af9cf in ssl3_connect () from /usr/lib/libssl.so.4
    #12 0x001bbcda in SSL_connect () from /usr/lib/libssl.so.4
    #13 0x001b884b in ssl23_connect () from /usr/lib/libssl.so.4
    #14 0x001b8337 in ssl23_connect () from /usr/lib/libssl.so.4
    #15 0x001bbcda in SSL_connect () from /usr/lib/libssl.so.4
    #16 0x0819dca7 in php_stream_sock_ssl_activate_with_method
    (stream=0x890c4b0, activate=1, method=0x1d0ca0,
    session_stream=0x890b258)
    at /home/cpapachebuild/buildapache/php-4.4.3/main/network.c:766
    #17 0x08166eb4 in php_stream_url_wrap_http_ex (wrapper=0x889ed38,
    path=0x8902fe4 "https://foo",
    mode=0x82172e0 "rb", options=4, opened_path=0x0, context=0x0,
    redirect_max=20, header_init=1)
    at
    /home/cpapachebuild/buildapache/php-4.4.3/ext/standard/http_fopen_wrapper.c:160
    #18 0x081682ad in php_stream_url_wrap_http (wrapper=0x889ed38,
    path=0x8902fe4 "https://foo", mode=0x82172e0 "rb",
    options=4, opened_path=0x0, context=0x0) at
    /home/cpapachebuild/buildapache/php-4.4.3/ext/standard/http_fopen_wrapper.c:563
    #19 0x0819ce4c in _php_stream_open_wrapper_ex (path=0x8902fe4
    "https://foo", mode=0x82172e0 "rb", options=12,
    opened_path=0x4, context=0x0) at
    /home/cpapachebuild/buildapache/php-4.4.3/main/streams.c:2696
    #20 0x08137f8b in zif_file (ht=1, return_value=0x89071bc, this_ptr=0x0,
    return_value_used=1)
    at
    /home/cpapachebuild/buildapache/php-4.4.3/ext/standard/file.c:498
    #21 0x081c15ee in execute (op_array=0x8907664) at
    /home/cpapachebuild/buildapache/php-4.4.3/Zend/zend_execute.c:1675
    #22 0x081b4df7 in zend_execute_scripts (type=8, retval=0x0,
    file_count=3) at
    /home/cpapachebuild/buildapache/php-4.4.3/Zend/zend.c:934
    #23 0x08191587 in php_execute_script (primary_file=0xbfffbb80) at
    /home/cpapachebuild/buildapache/php-4.4.3/main/main.c:1752
    #24 0x081c55a0 in main (argc=2, argv=0xbfffbc44) at
    /home/cpapachebuild/buildapache/php-4.4.3/sapi/cli/php_cli.c:832



    For curl:


    #0 0x0052b481 in __pause_nocancel () from /lib/tls/libpthread.so.0
    #1 0x00bee6c9 in zend_oe () from
    /usr/local/Zend/lib/Optimizer-3.0.1/php-4.4.x/ZendOptimizer.so
    #2 <signal handler called>
    #3 0x00860272 in BN_num_bits () from /usr/lib/libcrypto.so.4
    #4 0x008a51d0 in X509_ATTRIBUTE_create () from
    /usr/lib/libcrypto.so.4
    #5 0x008abfc5 in asn1_ex_i2c () from /usr/lib/libcrypto.so.4
    #6 0x008abd31 in ASN1_template_i2d () from /usr/lib/libcrypto.so.4
    #7 0x008ab437 in ASN1_item_ex_i2d () from /usr/lib/libcrypto.so.4
    #8 0x008ab968 in ASN1_template_i2d () from /usr/lib/libcrypto.so.4
    #9 0x008ab500 in ASN1_item_ex_i2d () from /usr/lib/libcrypto.so.4
    #10 0x008ab2cd in ASN1_item_i2d () from /usr/lib/libcrypto.so.4
    #11 0x00870db0 in i2d_DHparams () from /usr/lib/libcrypto.so.4
    #12 0x008a0dba in ASN1_dup () from /usr/lib/libcrypto.so.4
    #13 0x00705ade in ssl3_connect () from /usr/lib/libssl.so.4
    #14 0x007039cf in ssl3_connect () from /usr/lib/libssl.so.4
    #15 0x0070fcda in SSL_connect () from /usr/lib/libssl.so.4
    #16 0x0070c84b in ssl23_connect () from /usr/lib/libssl.so.4
    #17 0x0070c337 in ssl23_connect () from /usr/lib/libssl.so.4
    #18 0x0070fcda in SSL_connect () from /usr/lib/libssl.so.4
    #19 0x0046bd37 in Curl_ossl_connect (conn=0x9aa2288,
    sockindex=162398240) at ssluse.c:1338
    #20 0x00478379 in Curl_ssl_connect (conn=0x9ae06d0, sockindex=16085786)
    at sslgen.c:203
    #21 0x0045e453 in Curl_http_connect (conn=0x9aa2288, done=0x9ae0020 "
    ") at http.c:1376
    #22 0x00467705 in Curl_protocol_connect (conn=0x9aa2288,
    protocol_done=0xbfff88ab "") at url.c:2381
    #23 0x004696d1 in SetupConnection (conn=0x9aa2288, hostaddr=0x9a0d2b0,
    protocol_done=0xbfff88ab "") at url.c:3878
    #24 0x0046976b in Curl_connect (data=0x9aa76e0, in_connect=0xbfff88e8,
    asyncp=0xbfff88aa "", protocol_done=0xbfff88ab "") at url.c:3934
    #25 0x0047225b in Curl_connect_host (data=0x9aa76e0, conn=0xbfff88e8)
    at transfer.c:2064
    #26 0x00472414 in Curl_perform (data=0x9aa76e0) at transfer.c:2153
    #27 0x00472b1b in curl_easy_perform (curl=0x9aa76e0) at easy.c:445
    #28 0x080a75da in zif_curl_exec (ht=1, return_value=0x9a9d1dc,
    this_ptr=0x0, return_value_used=0)
    at /home/cpapachebuild/buildapache/php-4.4.3/ext/curl/curl.c:1276
    #29 0x00b64293 in zend_oe () from
    /usr/local/Zend/lib/Optimizer-3.0.1/php-4.4.x/ZendOptimizer.so
    #30 0x00b60a4c in zend_oe () from
    /usr/local/Zend/lib/Optimizer-3.0.1/php-4.4.x/ZendOptimizer.so
    #31 0x081b4df7 in zend_execute_scripts (type=8, retval=0x0,
    file_count=3) at
    /home/cpapachebuild/buildapache/php-4.4.3/Zend/zend.c:934
    #32 0x08191587 in php_execute_script (primary_file=0xbfffb150) at
    /home/cpapachebuild/buildapache/php-4.4.3/main/main.c:1752
    #33 0x081c55a0 in main (argc=2, argv=0xbfffb214) at
    /home/cpapachebuild/buildapache/php-4.4.3/sapi/cli/php_cli.c:832



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


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

  2. Similar Questions and Discussions

    1. #26562 [Com]: fopen for https Sites does not work
      ID: 26562 Comment by: bhavin1194 at gmail dot com Reported By: sahin dot etik at web dot de Status: No Feedback...
    2. #39570 [NEW]: https Segmentation fault
      From: danilo69 at gmail dot com Operating system: Linux x86_64 PHP version: 5.2.0 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. PHP HTTPS POST Como hacer un POST https con PHP
      http://wedoit4you.com/forums4you/display_message.php?Msg_pk_id=628 /** Author: Ing. Angel Leon Function: postHttps($url,$params) Given the...
    5. #12149 [Com]: PHP 4.0.6 upgrade seems to break cURL https
      ID: 12149 Comment by: celine dot charbonnaud at vigilante dot com Reported By: brianl at stcu dot org Status: ...
  3. #2

    Default #38631 [Bgs]: fopen('https://...') or curl with https gives Segmentation fault

    ID: 38631
    Updated by: [email]darkelder@php.net[/email]
    Reported By: roberto dot berto at gmail dot com
    Status: Bogus
    Bug Type: cURL related
    Operating System: RHEL3
    PHP Version: 4.4.4
    New Comment:

    Duplicate of [url]http://bugs.php.net/bug.php?id=38393[/url]


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

    [2006-12-30 06:20:18] [email]darkelder@php.net[/email]

    Duplicate of [url]http://bugs.php.net/bug.php?id=38631[/url]

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

    [2006-08-28 16:14:59] [email]tony2001@php.net[/email]

    The backtrace clearly shows that it's not PHP problem.

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

    [2006-08-28 16:09:41] roberto dot berto at gmail dot com

    Description:
    ------------
    While using fopen or CURL with https:// PHP returns 'Segmentation
    fault'

    Reproduce code:
    ---------------
    <?php
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://foo/');
    curl_exec($ch);
    curl_close($ch);
    ?>

    or

    <?php
    print join('', file('htps://foo'));
    ?>


    PHP compile:
    './configure' '--with-apxs=/usr/local/apache/bin/apxs'
    '--prefix=/usr/local' '--with-xml' '--enable-bcmath'
    '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt'
    '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd'
    '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
    '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-iconv'
    '--with-imap=/usr/local/imap-2004g' '--enable-mbstring'
    '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt'
    '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr'
    '--with-openssl' '--enable-discard-path' '--with-pear'
    '--with-pgsql=/usr' '--enable-xslt' '--with-xslt-sablot'
    '--enable-safe-mode' '--enable-sockets' '--enable-track-vars'
    '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf'
    '--enable-versioning' '--with-xmlrpc' '--with-zip' '--with-zlib'


    Expected result:
    ----------------
    Return url content

    Actual result:
    --------------
    For file():


    #0 0x00508272 in BN_num_bits () from /usr/lib/libcrypto.so.4
    #1 0x0054d1d0 in X509_ATTRIBUTE_create () from
    /usr/lib/libcrypto.so.4
    #2 0x00553fc5 in asn1_ex_i2c () from /usr/lib/libcrypto.so.4
    #3 0x00553d31 in ASN1_template_i2d () from /usr/lib/libcrypto.so.4
    #4 0x00553437 in ASN1_item_ex_i2d () from /usr/lib/libcrypto.so.4
    #5 0x00553968 in ASN1_template_i2d () from /usr/lib/libcrypto.so.4
    #6 0x00553500 in ASN1_item_ex_i2d () from /usr/lib/libcrypto.so.4
    #7 0x005532cd in ASN1_item_i2d () from /usr/lib/libcrypto.so.4
    #8 0x00518db0 in i2d_DHparams () from /usr/lib/libcrypto.so.4
    #9 0x00548dba in ASN1_dup () from /usr/lib/libcrypto.so.4
    #10 0x001b1ade in ssl3_connect () from /usr/lib/libssl.so.4
    #11 0x001af9cf in ssl3_connect () from /usr/lib/libssl.so.4
    #12 0x001bbcda in SSL_connect () from /usr/lib/libssl.so.4
    #13 0x001b884b in ssl23_connect () from /usr/lib/libssl.so.4
    #14 0x001b8337 in ssl23_connect () from /usr/lib/libssl.so.4
    #15 0x001bbcda in SSL_connect () from /usr/lib/libssl.so.4
    #16 0x0819dca7 in php_stream_sock_ssl_activate_with_method
    (stream=0x890c4b0, activate=1, method=0x1d0ca0,
    session_stream=0x890b258)
    at /home/cpapachebuild/buildapache/php-4.4.3/main/network.c:766
    #17 0x08166eb4 in php_stream_url_wrap_http_ex (wrapper=0x889ed38,
    path=0x8902fe4 "https://foo",
    mode=0x82172e0 "rb", options=4, opened_path=0x0, context=0x0,
    redirect_max=20, header_init=1)
    at
    /home/cpapachebuild/buildapache/php-4.4.3/ext/standard/http_fopen_wrapper.c:160
    #18 0x081682ad in php_stream_url_wrap_http (wrapper=0x889ed38,
    path=0x8902fe4 "https://foo", mode=0x82172e0 "rb",
    options=4, opened_path=0x0, context=0x0) at
    /home/cpapachebuild/buildapache/php-4.4.3/ext/standard/http_fopen_wrapper.c:563
    #19 0x0819ce4c in _php_stream_open_wrapper_ex (path=0x8902fe4
    "https://foo", mode=0x82172e0 "rb", options=12,
    opened_path=0x4, context=0x0) at
    /home/cpapachebuild/buildapache/php-4.4.3/main/streams.c:2696
    #20 0x08137f8b in zif_file (ht=1, return_value=0x89071bc, this_ptr=0x0,
    return_value_used=1)
    at
    /home/cpapachebuild/buildapache/php-4.4.3/ext/standard/file.c:498
    #21 0x081c15ee in execute (op_array=0x8907664) at
    /home/cpapachebuild/buildapache/php-4.4.3/Zend/zend_execute.c:1675
    #22 0x081b4df7 in zend_execute_scripts (type=8, retval=0x0,
    file_count=3) at
    /home/cpapachebuild/buildapache/php-4.4.3/Zend/zend.c:934
    #23 0x08191587 in php_execute_script (primary_file=0xbfffbb80) at
    /home/cpapachebuild/buildapache/php-4.4.3/main/main.c:1752
    #24 0x081c55a0 in main (argc=2, argv=0xbfffbc44) at
    /home/cpapachebuild/buildapache/php-4.4.3/sapi/cli/php_cli.c:832



    For curl:


    #0 0x0052b481 in __pause_nocancel () from /lib/tls/libpthread.so.0
    #1 0x00bee6c9 in zend_oe () from
    /usr/local/Zend/lib/Optimizer-3.0.1/php-4.4.x/ZendOptimizer.so
    #2 <signal handler called>
    #3 0x00860272 in BN_num_bits () from /usr/lib/libcrypto.so.4
    #4 0x008a51d0 in X509_ATTRIBUTE_create () from
    /usr/lib/libcrypto.so.4
    #5 0x008abfc5 in asn1_ex_i2c () from /usr/lib/libcrypto.so.4
    #6 0x008abd31 in ASN1_template_i2d () from /usr/lib/libcrypto.so.4
    #7 0x008ab437 in ASN1_item_ex_i2d () from /usr/lib/libcrypto.so.4
    #8 0x008ab968 in ASN1_template_i2d () from /usr/lib/libcrypto.so.4
    #9 0x008ab500 in ASN1_item_ex_i2d () from /usr/lib/libcrypto.so.4
    #10 0x008ab2cd in ASN1_item_i2d () from /usr/lib/libcrypto.so.4
    #11 0x00870db0 in i2d_DHparams () from /usr/lib/libcrypto.so.4
    #12 0x008a0dba in ASN1_dup () from /usr/lib/libcrypto.so.4
    #13 0x00705ade in ssl3_connect () from /usr/lib/libssl.so.4
    #14 0x007039cf in ssl3_connect () from /usr/lib/libssl.so.4
    #15 0x0070fcda in SSL_connect () from /usr/lib/libssl.so.4
    #16 0x0070c84b in ssl23_connect () from /usr/lib/libssl.so.4
    #17 0x0070c337 in ssl23_connect () from /usr/lib/libssl.so.4
    #18 0x0070fcda in SSL_connect () from /usr/lib/libssl.so.4
    #19 0x0046bd37 in Curl_ossl_connect (conn=0x9aa2288,
    sockindex=162398240) at ssluse.c:1338
    #20 0x00478379 in Curl_ssl_connect (conn=0x9ae06d0, sockindex=16085786)
    at sslgen.c:203
    #21 0x0045e453 in Curl_http_connect (conn=0x9aa2288, done=0x9ae0020 "
    ") at http.c:1376
    #22 0x00467705 in Curl_protocol_connect (conn=0x9aa2288,
    protocol_done=0xbfff88ab "") at url.c:2381
    #23 0x004696d1 in SetupConnection (conn=0x9aa2288, hostaddr=0x9a0d2b0,
    protocol_done=0xbfff88ab "") at url.c:3878
    #24 0x0046976b in Curl_connect (data=0x9aa76e0, in_connect=0xbfff88e8,
    asyncp=0xbfff88aa "", protocol_done=0xbfff88ab "") at url.c:3934
    #25 0x0047225b in Curl_connect_host (data=0x9aa76e0, conn=0xbfff88e8)
    at transfer.c:2064
    #26 0x00472414 in Curl_perform (data=0x9aa76e0) at transfer.c:2153
    #27 0x00472b1b in curl_easy_perform (curl=0x9aa76e0) at easy.c:445
    #28 0x080a75da in zif_curl_exec (ht=1, return_value=0x9a9d1dc,
    this_ptr=0x0, return_value_used=0)
    at /home/cpapachebuild/buildapache/php-4.4.3/ext/curl/curl.c:1276
    #29 0x00b64293 in zend_oe () from
    /usr/local/Zend/lib/Optimizer-3.0.1/php-4.4.x/ZendOptimizer.so
    #30 0x00b60a4c in zend_oe () from
    /usr/local/Zend/lib/Optimizer-3.0.1/php-4.4.x/ZendOptimizer.so
    #31 0x081b4df7 in zend_execute_scripts (type=8, retval=0x0,
    file_count=3) at
    /home/cpapachebuild/buildapache/php-4.4.3/Zend/zend.c:934
    #32 0x08191587 in php_execute_script (primary_file=0xbfffb150) at
    /home/cpapachebuild/buildapache/php-4.4.3/main/main.c:1752
    #33 0x081c55a0 in main (argc=2, argv=0xbfffb214) at
    /home/cpapachebuild/buildapache/php-4.4.3/sapi/cli/php_cli.c:832



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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=38631&edit=1[/url]
    darkelder@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