|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-12-04 07:39 UTC] 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:
--------------
roman@fish-serv:~> 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 02:00:01 2025 UTC |
Checked with Snapshot 200812080530, same result: -------------- backtrace ------------------ roman@fish-serv2006:/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)scott-mbp:php5_3 scott$ sapi/cli/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: Mon, 29 Dec 2008 14:56:39 GMT [2] => Server: Apache [3] => X-Powered-By: PHP/5.2.8 [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 This is definitely fixed.Hello When a request print_r (get_headers ('http://domain/error.php')); Browser issues: Warning: get_headers (http://domain/error.php) [function.get-headers]: failed to open stream: HTTP request failed! in X: \ home \ domain \ www \ error.php on line 7 Fatal error: Maximum execution time of 30 seconds exceeded in X: \ home \ domain \ www \ error.php on line 7 What is this bug? PHP 5.2.12