From: william at therileys dot freetcp dot com
Operating system: CentOS 4.7
PHP version: 5.2.12
PHP Bug Type: Reproducible crash
Bug description: Segfault if date.timezone is not set and error_log is defined
Description:
------------
When creating a new SoapClient PHP will segfault if the client is
unreachable or returns a 404. This behavior appears to be "fixed" if
date.timezone is defined in php.ini or if error_log is not set
(regardless of whether log_errors is on or off).
Reproduce code:
---------------
try
{
$client = new SoapClient("http://1.2.3.4/wsdl");
}
catch(Exception $e)
{
echo "\n\nNO SEG FAULT!\n\n";
}
Expected result:
----------------
See 'NO SEG FAULT' printed to screen
Actual result:
--------------
Segmentation fault
#0 0x0837ed83 in zend_object_store_get_object (zobject=0x0,
tsrm_ls=0x0) at /usr/src/redhat/BUILD/php-
5.2.12/Zend/zend_objects_API.c:261
#1 0x0837e419 in zend_std_object_get_class (object=0xb7ec6eb8,
tsrm_ls=0x8bdb050) at /usr/src/redhat/BUILD/php-
5.2.12/Zend/zend_object_handlers.c:1088
#2 0x08228c2b in soap_error_handler (error_num=2048,
error_filename=0xb7ec746c "Command line code", error_lineno=1,
format=0x8677f27 "%s", args=0xbff9b038 "@\214ì·xcÌ\b\t")
at /usr/src/redhat/BUILD/php-5.2.12/ext/soap/soap.c:2117
#3 0x0836484a in zend_error (type=2048, format=0x8677f27 "%s") at
/usr/src/redhat/BUILD/php-5.2.12/Zend/zend.c:976
#4 0x0832316e in php_verror (docref=0xb7ec7d40 "\220}
ì·client.soapclient", params=0x8663415 "", type=2048,
format=0x8447b50 "It is not safe to rely on the system's timezone
settings. Please use the date.timezone setting, the TZ environment
variable or the date_default_timezone_set() function. In case you used
any of those m"..., args=0xbff9b0d0 "Ç\212D\b\030\f¾\b",
tsrm_ls=0x8bdb050) at /usr/src/redhat/BUILD/php-5.2.12/main/main.c:733
#5 0x08323548 in php_error_docref0 (docref=0x0, tsrm_ls=0x8bdb050,
type=2048,
format=0x8447b50 "It is not safe to rely on the system's timezone
settings. Please use the date.timezone setting, the TZ environment
variable or the date_default_timezone_set() function. In case you used
any of those m"...) at /usr/src/redhat/BUILD/php-
5.2.12/main/main.c:745
#6 0x080c7385 in guess_timezone (tzdb=Variable "tzdb" is not
available.
) at /usr/src/redhat/BUILD/php-5.2.12/ext/date/php_date.c:627
#7 0x080c7524 in get_timezone_info (tsrm_ls=0x8bdb050) at
/usr/src/redhat/BUILD/php-5.2.12/ext/date/php_date.c:684
#8 0x080c80e5 in php_format_date (format=0x8677e3b "d-M-Y H:i:s",
format_len=11, ts=1265064008, localtime=1, tsrm_ls=0x8bdb050) at
/usr/src/redhat/BUILD/php-5.2.12/ext/date/php_date.c:934
#9 0x08322ea8 in php_log_err (
log_message=0xb7ec8950 "PHP Fatal error: SOAP-ERROR: Parsing
WSDL: Couldn't load from 'http://1.2.3.4/wsdl' : failed to load
external entity \"http://1.2.3.4/wsdl\"\n in Command line code on line
1",
tsrm_ls=0x8bdb050) at /usr/src/redhat/BUILD/php-
5.2.12/main/main.c:516
#10 0x08323b75 in php_error_cb (type=1, error_filename=0xb7ec746c
"Command line code", error_lineno=1, format=0x865af24 "SOAP-ERROR:
Parsing WSDL: Couldn't load from '%s' : %s",
args=0xbff9b808 "Øxì·ÐõÖ\bÌyì·Øxì·\024") at
/usr/src/redhat/BUILD/php-5.2.12/main/main.c:919
#11 0x08229254 in soap_error_handler (error_num=1,
error_filename=0xb7ec746c "Command line code", error_lineno=1,
format=0x865af24 "SOAP-ERROR: Parsing WSDL: Couldn't load from '%s' :
%s",
args=0xbff9b808 "Øxì·ÐõÖ\bÌyì·Øxì·\024") at
/usr/src/redhat/BUILD/php-5.2.12/ext/soap/soap.c:2170
#12 0x0836484a in zend_error (type=1, format=0x865af24 "SOAP-ERROR:
Parsing WSDL: Couldn't load from '%s' : %s") at
/usr/src/redhat/BUILD/php-5.2.12/Zend/zend.c:976
#13 0x08249a5d in load_wsdl_ex (this_ptr=0xb7ec6eb8, struri=0xb7ec78d8
"http://1.2.3.4/wsdl", ctx=0xbff9b9d0, include=0, tsrm_ls=0x8bdb050)
at /usr/src/redhat/BUILD/php-5.2.12/ext/soap/php_sdl.c:307
#14 0x08254c7a in get_sdl (this_ptr=0xb7ec6eb8, uri=0xb7ec78d8
"http://1.2.3.4/wsdl", cache_wsdl=Variable "cache_wsdl" is not
available.
) at /usr/src/redhat/BUILD/php-5.2.12/ext/soap/php_sdl.c:713
#15 0x082242e2 in zim_SoapClient_SoapClient (ht=1,
return_value=0xb7ec6ea0, return_value_ptr=0x0, this_ptr=0xb7ec6eb8,
return_value_used=0, tsrm_ls=0x8bdb050)
at /usr/src/redhat/BUILD/php-5.2.12/ext/soap/soap.c:2505
#16 0x08381c06 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff9cdf0, tsrm_ls=0x8bdb050) at
/usr/src/redhat/BUILD/php-5.2.12/Zend/zend_vm_execute.h:200
#17 0x08381221 in execute (op_array=0xb7ec7360, tsrm_ls=0x8bdb050) at
/usr/src/redhat/BUILD/php-5.2.12/Zend/zend_vm_execute.h:92
#18 0x08358fed in zend_eval_string (str=0xbffceb91 "try { $client =
new SoapClient(\"http://1.2.3.4/wsdl\"); } catch(Exception $e){ echo
\"\\n\\nNO SEG FAULT!\\n\\n\"; }", retval_ptr=0x0,
string_name=0x869af27 "Command line code", tsrm_ls=0x8bdb050) at
/usr/src/redhat/BUILD/php-5.2.12/Zend/zend_execute_API.c:1222
#19 0x0835918f in zend_eval_string_ex (str=0xbffceb91 "try { $client =
new SoapClient(\"http://1.2.3.4/wsdl\"); } catch(Exception $e){ echo
\"\\n\\nNO SEG FAULT!\\n\\n\"; }", retval_ptr=0x0,
string_name=0x869af27 "Command line code", handle_exceptions=1,
tsrm_ls=0x8bdb050) at /usr/src/redhat/BUILD/php-
5.2.12/Zend/zend_execute_API.c:1257
#20 0x083d6d39 in main (argc=3, argv=0xbff9d224) at
/usr/src/redhat/BUILD/php-5.2.12/sapi/cli/php_cli.c:1254
--
Edit bug report at http://bugs.php.net/?id=50902&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50902&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50902&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50902&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50902&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50902&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50902&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50902&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50902&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50902&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50902&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50902&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50902&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50902&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50902&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50902&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50902&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50902&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50902&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50902&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50902&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50902&r=mysqlcfg