ID: 46748 User updated by: romanf at trash dot net Reported By: romanf at trash dot net -Status: Feedback +Status: Open Bug Type: HTTP related Operating System: Linux (OpenSuse 11) PHP Version: 5.2CVS-2008-12-04 (snap) New Comment:
I have the same bug on two OpenSuse systems. Both have: # rpm -q openssl openssl-0.9.8e-45.5 installed. I used the following config to compile this mornings snapshot: ./configure --enable-debug --with-mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-mcrypt --with-imap --with-imap-ssl --with-gettext --with-zlib --with-openssl --with-pdo-mysql --enable-mbstring=all --with-gd Did you try the get_headers() against an HTTPS-Link that -requires- a Client-Certificate? I can reproduce this on the test-pages given in my samples *and* in a company-intranet... Regards Roman Previous Comments: ------------------------------------------------------------------------ [2008-12-08 11:38:46] [EMAIL PROTECTED] I can't reproduce this. Are you absolutely sure you're using the latest CVS build? And also, what openssl version are you linking PHP with? ------------------------------------------------------------------------ [2008-12-08 08:14:15] romanf at trash dot net Checked with Snapshot 200812080530, same result: -------------- backtrace ------------------ [EMAIL PROTECTED]:/usr/src/php/php5.2-200812080530> gdb /usr/local/bin/php GNU gdb 6.6.50.20070726-cvs Copyright (C) 2007 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 "x86_64-suse-linux"... Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run ../client_test.php Starting program: /usr/local/bin/php ../client_test.php [Thread debugging using libthread_db enabled] [New Thread 0x2b3b6c2b6310 (LWP 11655)] Array ( [0] => HTTP/1.1 200 OK [1] => Date: Mon, 08 Dec 2008 08:12:55 GMT [2] => Server: Apache [3] => X-Powered-By: PHP/5.2.9-dev [4] => Content-Length: 136 [5] => Connection: close [6] => Content-Type: text/html; charset=ISO-8859-1 ) Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14094410:SSL routines:func(148):reason(1040) in /usr/src/php/client_test.php on line 3 Warning: get_headers(https://fish-serv.dyndns.org/php_test/client_require.php): failed to open stream: HTTP request failed! in /usr/src/php/client_test.php on line 3 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x2b3b6c2b6310 (LWP 11655)] _zend_mm_free_int (heap=0xc5d2b0, p=0xdefd70) at /usr/src/php/php5.2-200812080530/Zend/zend_alloc.c:1973 1973 if (ZEND_MM_IS_FREE_BLOCK(next_block)) { (gdb) bt #0 _zend_mm_free_int (heap=0xc5d2b0, p=0xdefd70) at /usr/src/php/php5.2-200812080530/Zend/zend_alloc.c:1973 #1 0x00000000006bcf37 in destroy_op_array (op_array=0xdedc00) at /usr/src/php/php5.2-200812080530/Zend/zend_variables.h:35 #2 0x00000000006c550c in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/php/php5.2-200812080530/Zend/zend.c:1171 #3 0x0000000000682e8d in php_execute_script (primary_file=0x7fff41852460) at /usr/src/php/php5.2-200812080530/main/main.c:2023 #4 0x000000000074836b in main (argc=2, argv=0x7fff41852658) at /usr/src/php/php5.2-200812080530/sapi/cli/php_cli.c:1133 (gdb) ------------------------------------------------------------------------ [2008-12-08 02:34:08] [EMAIL PROTECTED] 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 http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2008-12-07 09:36:53] [EMAIL PROTECTED] 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. ------------------------------------------------------------------------ [2008-12-04 07:39:54] romanf at trash dot net Description: ------------ get_headers() generates segmentation fault on HTTPS-URLs with "SSLVerifyClient required". Reproduce code: --------------- I put up two test-pages to reproduce the bug. One (client_none.php) has "SSLVerifyClient none" set in .htaccess, the other (client_require.php) has "SSLVerifyClient required" set. Use the following to get the segmentation fault: php -r "print_r(get_headers('https://fish-serv.dyndns.org/php_test/client_none.php')); print_r(get_headers('https://fish-serv.dyndns.org/php_test/client_require.php'));" Expected result: ---------------- Second get_headers() should NOT produce a segmentation fault. It should return a normal error-code instead. Actual result: -------------- [EMAIL PROTECTED]:~> php -r "print_r(get_headers('https://fish-serv.dyndns.org/php_test/client_none.php')); print_r(get_headers('https://fish-serv.dyndns.org/php_test/client_require.php'));" Array ( [0] => HTTP/1.1 200 OK [1] => Date: Thu, 04 Dec 2008 07:37:52 GMT [2] => Server: Apache [3] => X-Powered-By: PHP/5.2.8-dev [4] => Content-Length: 136 [5] => Connection: close [6] => Content-Type: text/html; charset=ISO-8859-1 ) Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14094410:SSL routines:func(148):reason(1040) error:140940E5:SSL routines:func(148):reason(229) in Command line code on line 1 Warning: get_headers(https://fish-serv.dyndns.org/php_test/client_require.php): failed to open stream: HTTP request failed! in Command line code on line 1 Segmentation fault ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46748&edit=1