php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37974 error when using https url
Submitted: 2006-06-30 12:08 UTC Modified: 2006-07-01 05:53 UTC
From: mizuiro dot ccc at gmail dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5CVS-2006-06-30 (snap) OS: Fedora5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mizuiro dot ccc at gmail dot com
New email:
PHP Version: OS:

 

 [2006-06-30 12:08 UTC] mizuiro dot ccc at gmail dot com
Description:
------------
Hello..
   I have a problem which crashes PHP when using HTTPS url.

Example: (HTTPS)  
   curl_setopt($cl,CURLOPT_URL,"https://login.yahoo.com");
   $out = curl_exec($cl); //ERROR

Example: (NO HTTPS)
   curl_setopt($cl,CURLOPT_URL,"http://login.yahoo.com");
   $out = curl_exec($cl); //It is OK!



Reproduce code:
---------------
[root@locahost ~] /usr/local/php5/bin/php test.php

test.php:
<?
$cl = curl_init();
curl_setopt($cl,CURLOPT_URL,"https://login.yahoo.com");
$out = curl_exec($cl);
curl_close($cl);
echo $out;
?>

Expected result:
----------------
*** glibc detected *** /usr/local/php5/bin/php: free(): invalid pointer: 0x00973ca0 ***
======= Backtrace: =========
/lib/libc.so.6[0xc41f18]
/lib/libc.so.6(__libc_free+0x78)[0xc453ef]
/usr/local/php5/bin/php(_ZdlPvN5yaSSL5new_tE+0x23)[0x83695d3]
/usr/local/php5/bin/php(_ZN5yaSSL8ysDeleteINS_10SSL_METHODEEEvPT_+0x24)[0x8361c74]
/usr/local/php5/bin/php(_ZN5yaSSL7SSL_CTXD1Ev+0x2a)[0x836d2aa]
/usr/local/php5/bin/php(_ZN5yaSSL8ysDeleteINS_7SSL_CTXEEEvPT_+0x26)[0x8361886]
/usr/local/php5/bin/php(SSL_CTX_free+0x1f)[0x835d05f]
/usr/lib/libcurl.so.3(Curl_ossl_close+0x66)[0x575ab6]
/usr/lib/libcurl.so.3(Curl_ssl_close+0x26)[0x5840f6]
/usr/lib/libcurl.so.3(Curl_disconnect+0xf2)[0x56d882]
/usr/lib/libcurl.so.3(Curl_connect+0xd49)[0x56e969]
/usr/lib/libcurl.so.3[0x57a79b]
/usr/lib/libcurl.so.3(Curl_perform+0xf0)[0x57cd50]
/usr/lib/libcurl.so.3(curl_easy_perform+0x3c)[0x57d21c]
/usr/local/php5/bin/php(zif_curl_exec+0x98)[0x80d59e8]
/usr/local/php5/bin/php[0x82eb2a8]
/usr/local/php5/bin/php(execute+0x12d)[0x82dca4d]
/usr/local/php5/bin/php(zend_execute_scripts+0x217)[0x82c0bf7]
/usr/local/php5/bin/php(php_execute_script+0x1a2)[0x8284a42]
/usr/local/php5/bin/php(main+0x11d4)[0x8338324]
/lib/libc.so.6(__libc_start_main+0xdc)[0xbf3724]
/usr/local/php5/bin/php[0x80b3e11]
======= Memory map: ========
00101000-00106000 r-xp 00000000 fd:00 6286804    /lib/libcrypt-2.4.so
00106000-00107000 r-xp 00004000 fd:00 6286804    /lib/libcrypt-2.4.so
00107000-00108000 rwxp 00005000 fd:00 6286804    /lib/libcrypt-2.4.so
00108000-0012f000 rwxp 00108000 00:00 0 
0012f000-0015e000 r-xp 00000000 fd:00 4951278    /usr/lib/libidn.so.11.5.16
0015e000-0015f000 rwxp 0002f000 fd:00 4951278    /usr/lib/libidn.so.11.5.16
001c5000-001d4000 r-xp 00000000 fd:00 6286508    /lib/libresolv-2.4.so
001d4000-001d5000 r-xp 0000e000 fd:00 6286508    /lib/libresolv-2.4.so
001d5000-001d6000 rwxp 0000f000 fd:00 6286508    /lib/libresolv-2.4.so
001d6000-001d8000 rwxp 001d6000 00:00 0 
00311000-0031c000 r-xp 00000000 fd:00 6285329    /lib/libgcc_s-4.1.1-20060525.so.1
0031c000-0031d000 rwxp 0000a000 fd:00 6285329    /lib/libgcc_s-4.1.1-20060525.so.1
00400000-00473000 r-xp 00000000 fd:00 4956073    /usr/lib/libkrb5.so.3.2
00473000-00475000 rwxp 00073000 fd:00 4956073    /usr/lib/libkrb5.so.3.2
00477000-0047a000 r-xp 00000000 fd:00 4955666    /usr/lib/libkrb5support.so.0.0
0047a000-0047b000 rwxp 00002000 fd:00 4955666    /usr/lib/libkrb5support.so.0.0
0047d000-004a1000 r-xp 00000000 fd:00 4955742    /usr/lib/libk5crypto.so.3.0
004a1000-004a2000 rwxp 00024000 fd:00 4955742    /usr/lib/libk5crypto.so.3.0
004e5000-004fd000 r-xp 00000000 fd:00 4956074    /usr/lib/libgssapi_krb5.so.2.2
004fd000-004fe000 rwxp 00017000 fd:00 4956074    /usr/lib/libgssapi_krb5.so.2.2
00557000-0058f000 r-xp 00000000 fd:00 4955203    /usr/lib/libcurl.so.3.0.0
0058f000-00590000 rwxp 00038000 fd:00 4955203    /usr/lib/libcurl.so.3.0.0
0066a000-0066c000 r-xp 00000000 fd:00 5696100    /usr/local/Zend/lib/ZendExtensionManager.so
0066c000-0066d000 rwxp 00002000 fd:00 5696100    /usr/local/Zend/lib/ZendExtensionManager.so
006a4000-007c8000 r-xp 00000000 fd:00 4947104    /usr/lib/libxml2.so.2.6.23
007c8000-007d0000 rwxp 00124000 fd:00 4947104    /usr/lib/libxml2.so.2.6.23
007d0000-007d1000 rwxp 007d0000 00:00 0 
007d3000-007dc000 r-xp 00000000 fd:00 6285336    /lib/libnss_files-2.4.so
007dc000-007dd000 r-xp 00008000 fd:00 6285336    /lib/libnss_files-2.4.so
007dd000-007de000 rwxp 00009000 fd:00 6285336    /lib/libnss_files-2.4.so
007e0000-007e4000 r-xp 00000000 fd:00 6285340    /lib/libnss_dns-2.4.so
007e4000-007e5000 r-xp 00003000 fd:00 6285340    /lib/libnss_dns-2.4.so
007e5000-007e6000 rwxp 00004000 fd:00 6285340    /lib/libnss_dns-2.4.so
008e2000-00909000 r-xp 00000000 fd:00 4947489    /usr/lib/libpng12.so.0.1.2.8
00909000-0090a000 rwxp 00026000 fd:00 4947489    /usr/lib/libpng12.so.0.1.2.8
00930000-00971000 r-xp 00000000 fd:00 6286478    /lib/libssl.so.0.9.8b
00971000-00975000 rwxp 00040000 fd:00 6286478    /lib/libssl.so.0.9.8b
00bc0000-00bc1000 r-xpAborted

Actual result:
--------------
echo html code

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-30 12:14 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2006-06-30 13:45 UTC] mizuiro dot ccc at gmail dot com
Is this?

[root@MyHost ~]# gdb --args /usr/local/php5/bin/php test.php

GNU gdb Red Hat Linux (6.3.0.0-1.122rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /usr/local/php5/bin/php test.php
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xbc0000
[Thread debugging using libthread_db enabled]
[New Thread -1208252736 (LWP 11843)]
PHP Warning:  Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0
*** glibc detected *** /usr/local/php5/bin/php: free(): invalid pointer: 0x00973ca0 ***
======= Backtrace: =========
/lib/libc.so.6[0xc41f18]
/lib/libc.so.6(__libc_free+0x78)[0xc453ef]
/usr/local/php5/bin/php(_ZdlPvN5yaSSL5new_tE+0x23)[0x83695d3]
/usr/local/php5/bin/php(_ZN5yaSSL8ysDeleteINS_10SSL_METHODEEEvPT_+0x24)[0x8361c74]
/usr/local/php5/bin/php(_ZN5yaSSL7SSL_CTXD1Ev+0x2a)[0x836d2aa]
/usr/local/php5/bin/php(_ZN5yaSSL8ysDeleteINS_7SSL_CTXEEEvPT_+0x26)[0x8361886]
/usr/local/php5/bin/php(SSL_CTX_free+0x1f)[0x835d05f]
/usr/lib/libcurl.so.3(Curl_ossl_close+0x66)[0x575ab6]
/usr/lib/libcurl.so.3(Curl_ssl_close+0x26)[0x5840f6]
/usr/lib/libcurl.so.3(Curl_disconnect+0xf2)[0x56d882]
/usr/lib/libcurl.so.3(Curl_connect+0xd49)[0x56e969]
/usr/lib/libcurl.so.3[0x57a79b]
/usr/lib/libcurl.so.3(Curl_perform+0xf0)[0x57cd50]
/usr/lib/libcurl.so.3(curl_easy_perform+0x3c)[0x57d21c]
/usr/local/php5/bin/php(zif_curl_exec+0x98)[0x80d59e8]
/usr/local/php5/bin/php[0x82eb2a8]
/usr/local/php5/bin/php(execute+0x12d)[0x82dca4d]
/usr/local/php5/bin/php(zend_execute_scripts+0x217)[0x82c0bf7]
/usr/local/php5/bin/php(php_execute_script+0x1a2)[0x8284a42]
/usr/local/php5/bin/php(main+0x11d4)[0x8338324]
/lib/libc.so.6(__libc_start_main+0xdc)[0xbf3724]
/usr/local/php5/bin/php[0x80b3e11]
======= Memory map: ========
00101000-00106000 r-xp 00000000 fd:00 6286804    /lib/libcrypt-2.4.so
00106000-00107000 r-xp 00004000 fd:00 6286804    /lib/libcrypt-2.4.so
00107000-00108000 rwxp 00005000 fd:00 6286804    /lib/libcrypt-2.4.so
00108000-0012f000 rwxp 00108000 00:00 0 
0012f000-0015e000 r-xp 00000000 fd:00 4951278    /usr/lib/libidn.so.11.5.16
0015e000-0015f000 rwxp 0002f000 fd:00 4951278    /usr/lib/libidn.so.11.5.16
0015f000-00161000 r-xp 00000000 fd:00 5696100    /usr/local/Zend/lib/ZendExtensionManager.so
00161000-00162000 rwxp 00002000 fd:00 5696100    /usr/local/Zend/lib/ZendExtensionManager.so
001c5000-001d4000 r-xp 00000000 fd:00 6286508    /lib/libresolv-2.4.so
001d4000-001d5000 r-xp 0000e000 fd:00 6286508    /lib/libresolv-2.4.so
001d5000-001d6000 rwxp 0000f000 fd:00 6286508    /lib/libresolv-2.4.so
001d6000-001d8000 rwxp 001d6000 00:00 0 
00311000-0031c000 r-xp 00000000 fd:00 6285329    /lib/libgcc_s-4.1.1-20060525.so.1
0031c000-0031d000 rwxp 0000a000 fd:00 6285329    /lib/libgcc_s-4.1.1-20060525.so.1
00400000-00473000 r-xp 00000000 fd:00 4956073    /usr/lib/libkrb5.so.3.2
00473000-00475000 rwxp 00073000 fd:00 4956073    /usr/lib/libkrb5.so.3.2
00477000-0047a000 r-xp 00000000 fd:00 4955666    /usr/lib/libkrb5support.so.0.0
0047a000-0047b000 rwxp 00002000 fd:00 4955666    /usr/lib/libkrb5support.so.0.0
0047d000-004a1000 r-xp 00000000 fd:00 4955742    /usr/lib/libk5crypto.so.3.0
004a1000-004a2000 rwxp 00024000 fd:00 4955742    /usr/lib/libk5crypto.so.3.0
004e5000-004fd000 r-xp 00000000 fd:00 4956074    /usr/lib/libgssapi_krb5.so.2.2
004fd000-004fe000 rwxp 00017000 fd:00 4956074    /usr/lib/libgssapi_krb5.so.2.2
00557000-0058f000 r-xp 00000000 fd:00 4955203    /usr/lib/libcurl.so.3.0.0
0058f000-00590000 rwxp 00038000 fd:00 4955203    /usr/lib/libcurl.so.3.0.0
006a4000-007c8000 r-xp 00000000 fd:00 4947104    /usr/lib/libxml2.so.2.6.23
007c8000-007d0000 rwxp 00124000 fd:00 4947104    /usr/lib/libxml2.so.2.6.23
007d0000-007d1000 rwxp 007d0000 00:00 0 
007d3000-007dc000 r-xp 00000000 fd:00 6285336    /lib/libnss_files-2.4.so
007dc000-007dd000 r-xp 00008000 fd:00 6285336    /lib/libnss_files-2.4.so
007dd000-007de000 rwxp 00009000 fd:00 6285336    /lib/libnss_files-2.4.so
007e0000-007e4000 r-xp 00000000 fd:00 6285340    /lib/libnss_dns-2.4.so
007e4000-007e5000 r-xp 00003000 fd:00 6285340    /lib/libnss_dns-2.4.so
007e5000-007e6000 rwxp 00004000 fd:00 6285340    /lib/libnss_dns-2.4.so
008e2000-00909000 r-xp 00000000 fd:00 4947489    /usr/lib/libpng12.so.0.1.2.8
00909000-0090a000 rwxp 00026000 fd:00 4947489    /usr/lib/libpng12.so.0.1.2.8
00930000-00971000 r-xp 00000000 fd:00 6286478    /lib/libssl.so.0.9.8b
00971000-00975000 rwxp 00040000 fd:00 6286478    /lib/libssl.so.0.9.8b
00bc0000-00bc1000 r-xp 00bc0000 00:00 0          [vdso]
00bc1000-00bda000 r-xp 00000000 fd:00 6285363    /lib/
Program received signal SIGABRT, Aborted.
[Switching to Thread -1208252736 (LWP 11843)]
0x00bc0402 in __kernel_vsyscall ()
(gdb) bt
#0  0x00bc0402 in __kernel_vsyscall ()
#1  0x00c06069 in raise () from /lib/libc.so.6
#2  0x00c07671 in abort () from /lib/libc.so.6
#3  0x00c3aa4b in __libc_message () from /lib/libc.so.6
#4  0x00c41f18 in _int_free () from /lib/libc.so.6
#5  0x00c453ef in free () from /lib/libc.so.6
#6  0x083695d3 in operator delete ()
#7  0x08361c74 in yaSSL::ysDelete<yaSSL::SSL_METHOD> ()
#8  0x0836d2aa in yaSSL::SSL_CTX::~SSL_CTX ()
#9  0x08361886 in yaSSL::ysDelete<yaSSL::SSL_CTX> ()
#10 0x0835d05f in SSL_CTX_free ()
#11 0x00575ab6 in Curl_ossl_close () from /usr/lib/libcurl.so.3
#12 0x005840f6 in Curl_ssl_close () from /usr/lib/libcurl.so.3
#13 0x0056d882 in Curl_disconnect () from /usr/lib/libcurl.so.3
#14 0x0056e969 in Curl_connect () from /usr/lib/libcurl.so.3
#15 0x0057a79b in Curl_follow () from /usr/lib/libcurl.so.3
#16 0x0057cd50 in Curl_perform () from /usr/lib/libcurl.so.3
#17 0x0057d21c in curl_easy_perform () from /usr/lib/libcurl.so.3
#18 0x080d59e8 in zif_curl_exec (ht=1, return_value=0xa03d98c, return_value_ptr=0x0, 
    this_ptr=0x0, return_value_used=1)
    at /usr/local/src/php5.2-200606300630/ext/curl/interface.c:1598
#19 0x082eb2a8 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfc94ab0)
    at /usr/local/src/php5.2-200606300630/Zend/zend_vm_execute.h:200
#20 0x082dca4d in execute (op_array=0xa03904c)
    at /usr/local/src/php5.2-200606300630/Zend/zend_vm_execute.h:92
#21 0x082c0bf7 in zend_execute_scripts (type=8, retval=Variable "retval" is not available.
)
    at /usr/local/src/php5.2-200606300630/Zend/zend.c:1110
#22 0x08284a42 in php_execute_script (primary_file=0xbfc96ee0)
    at /usr/local/src/php5.2-200606300630/main/main.c:1748
#23 0x08338324 in main (argc=2, argv=0xbfc97014)
    at /usr/local/src/php5.2-200606300630/sapi/cli/php_cli.c:1097
(gdb)
 [2006-06-30 13:49 UTC] tony2001@php.net
Yes, thank you.
As you can see from the backtrace, the crash happens somewhere inside libcurl and it's not PHP problem.
Looks like a symbol clash between some libs.

Do you know yaSSL symbols come from?
What was your configure line?
 [2006-06-30 14:01 UTC] mizuiro dot ccc at gmail dot com
My configure line:
'./configure' '--prefix=/usr/local/php5' '--with-mysqli=/usr/bin/mysql_config' '--with-mysql=/usr' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-config-file-path=/usr/local/php5' '--enable-mbstring=tw' '--enable-ftp' '--with-iconv' '--with-zlib' '--with-gd=/usr' '--with-jpeg-dir=/usr/local/lib' '--enable-exif' '--with-gd' '--with-jpeg' '--with-tiff-dir=/usr/lib' '--with-png' '--enable-track-vars' '--with-curl' '--with-freetype' '--with-xpm' '--enable-sysvshm' '--enable-sysvsem' '--enable-sockets' '--with-openssl=/usr'

I use "yum update" to update FC5,and It's happen :(
yum.log:

Jun 27 01:00:03 Updated: gtk2.i386 2.8.19-2
Jun 27 01:00:04 Updated: glib-java.i386 0.2.5-0.FC5
Jun 27 01:00:05 Updated: cairo-java.i386 1.0.4-0.FC5
Jun 27 01:00:10 Updated: libgtk-java.i386 2.8.5-0.FC5
Jun 27 01:00:11 Updated: libsepol.i386 1.12.17-1.fc5
Jun 27 01:00:11 Updated: libselinux.i386 1.30.3-3.fc5
Jun 27 01:00:15 Updated: coreutils.i386 5.96-1.2
Jun 27 01:00:20 Updated: python.i386 2.4.3-4.FC5
Jun 27 01:00:20 Updated: avahi.i386 0.6.10-1.FC5
Jun 27 01:00:26 Updated: perl.i386 4:5.8.8-5
Jun 27 01:00:26 Updated: scim-libs.i386 1.4.4-9.7.fc5
Jun 27 01:00:27 Updated: libselinux-python.i386 1.30.3-3.fc5
Jun 27 01:00:28 Updated: policycoreutils.i386 1.30.10-2.fc5
Jun 27 01:00:29 Updated: libgnome-java.i386 2.12.3-0.FC5
Jun 27 01:00:29 Updated: libglade-java.i386 2.12.4-0.FC5
Jun 27 01:00:30 Updated: libvte-java.i386 0.12.0-0.FC5
Jun 27 01:00:41 Updated: tetex-fonts.i386 3.0-20.FC5
Jun 27 01:00:43 Updated: selinux-policy.noarch 2.2.43-4.fc5
Jun 27 01:00:44 Updated: qt.i386 1:3.3.6-0.1.fc5
Jun 27 01:00:45 Updated: tcl.i386 8.4.13-1.1
Jun 27 01:00:46 Updated: cscope.i386 15.5-13.7
Jun 27 01:00:47 Updated: shared-mime-info.i386 0.17-1.fc5.2
Jun 27 01:00:49 Updated: frysk.i386 0.0.1.2006.06.15.rh4-0.FC5
Jun 27 01:00:50 Updated: libselinux-devel.i386 1.30.3-3.fc5
Jun 27 01:00:52 Updated: system-config-lvm.noarch 1.0.18-1.2.FC5
Jun 27 01:00:55 Updated: python-devel.i386 2.4.3-4.FC5
Jun 27 01:00:55 Updated: rsync.i386 2.6.8-1.FC5.1
Jun 27 01:00:56 Updated: scim.i386 1.4.4-9.7.fc5
Jun 27 01:01:08 Updated: selinux-policy-targeted.noarch 2.2.43-4.fc5
Jun 27 01:01:10 Installed: kernel.i686 2.6.17-1.2139_FC5
Jun 27 01:01:19 Updated: tetex.i386 3.0-20.FC5
Jun 27 01:01:19 Updated: autofs.i386 1:4.1.4-27
Jun 27 01:01:20 Updated: avahi-glib.i386 0.6.10-1.FC5
Jun 27 01:01:20 Updated: smartmontools.i386 1:5.36-fc5.1
Jun 27 01:01:21 Updated: dhclient.i386 11:3.0.3-28
Jun 27 01:01:22 Updated: shadow-utils.i386 2:4.0.14-9.FC5
Jun 27 01:01:23 Updated: fedora-logos.noarch 1.1.42-1.fc5.1

Before Jun 27,It is OK :(
 [2006-06-30 14:07 UTC] tony2001@php.net
Aha, I see..
Looks like it's a bug in yaSSL. Try installing OpenSSL instead.
Anyway we're unable to help you in this case.
 [2006-07-01 05:53 UTC] mizuiro dot ccc at gmail dot com
I found the problem is comes from MySQL5(RPM).
I remove MySQL5.0(RPM),and install MySQL4.1(RPM),this question solved?
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 13:01:27 2019 UTC