Edit report at https://bugs.php.net/bug.php?id=64233&edit=1
ID: 64233 User updated by: andreas dot lindemann at de dot bp dot com Reported by: andreas dot lindemann at de dot bp dot com Summary: Soapserver::fault bus error on Solaris CLI/CGI/FPM Status: Open Type: Bug Package: SOAP related Operating System: Solaris 10 PHP Version: 5.4.11 Block user comment: N Private report: N New Comment: Any chance of fixing or reproducing this? If I can be of assistance, i.e. running some debug build to give more insight into the issue or so, please let me know. For now I've made a change to the soap extension to not run through the php_escape_html_entities_ex function. This is probably neither a good idea nor anywhere near a proper fix, considering that I've only got a very basic idea of C, but at least it throws the SoapFaults correctly to the client and doesn't crash the PHP process. --- ext/soap/soap.c.orig 2013-01-16 08:10:30.000000000 +0100 +++ ext/soap/soap.c 2013-03-11 12:30:34.497971000 +0100 @@ -3881,7 +3881,8 @@ if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { int new_len; xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode")); - char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); + char *str = (unsigned char*)Z_STRVAL_PP(tmp); xmlAddChild(param, node); if (fault_ns) { xmlNsPtr nsptr = encode_add_ns(node, fault_ns); @@ -3906,7 +3907,8 @@ if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { int new_len; xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL); - char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); + char *str = (unsigned char*)Z_STRVAL_PP(tmp); node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL); if (fault_ns) { xmlNsPtr nsptr = encode_add_ns(node, fault_ns); Previous Comments: ------------------------------------------------------------------------ [2013-02-21 06:09:23] andreas dot lindemann at de dot bp dot com This may be specific to Solaris 64bit. I tried to reproduce on Linux 64bit (SuSE Linux Enterprise), but no issue there as well. However no problem to reproduce this on 5 of our Solaris Sparc servers, all are showing the same bus error and backtrace. ------------------------------------------------------------------------ [2013-02-21 05:34:56] larue...@php.net no luck to reproduce this on centOS. ------------------------------------------------------------------------ [2013-02-18 12:47:42] andreas dot lindemann at de dot bp dot com Tried to reproduce on older versions: 5.4.6 fails with same error. PHP 5.3.21 however works correctly: $ ./php -v PHP 5.3.21 (cli) (built: Feb 18 2013 13:16:03) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies $ ./php -f test_script.php <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode> <faultstring>SoapServer::SoapServer(): Invalid parameters</faultstring></SOAP- ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> Something must have been broken between 5.3.21 and 5.4.6+, maybe this helps with the investigation. ------------------------------------------------------------------------ [2013-02-18 10:06:50] andreas dot lindemann at de dot bp dot com Note PHP has been compiled with 64bit. ------------------------------------------------------------------------ [2013-02-18 09:52:40] andreas dot lindemann at de dot bp dot com Description: ------------ Reproducably received a bus error/core dump when returning a Soapfault from the Soapserver on Solaris. Tried different execution paths and could reproduce on all of them: 1) PHP-CGI via Apache/mod_fcgid 2) PHP-FPM as backend for nginx 3) PHP-CLI from command line $ php -f test_script.php Bus Error (core dumped) $ uname -a SunOS testhost 5.10 Generic_147440-10 sun4u sparc SUNW,SPARC-Enterprise $ php -v PHP 5.4.11 (cli) (built: Feb 2 2013 12:02:33) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies $ php -m [PHP Modules] bcmath bz2 calendar Core ctype curl date dom ereg filter ftp gd iconv json ldap libxml mbstring oci8 openssl pcntl pcre PDO posix Reflection session SimpleXML soap sockets SPL standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlrpc xsl zip zlib Test script: --------------- <?php $options['uri'] = 'urn:someNamespace'; $server = new SoapServer(null, $options); $server->fault("Server", "message"); // <- Bus error, core Dumped Expected result: ---------------- A correctly generated Soap XML response. Actual result: -------------- Program terminated with signal 10, Bus error. Backtrace: #0 0x00000001003d0654 in php_escape_html_entities_ex () #1 0x00000001003cf830 in php_escape_html_entities () #2 0x00000001002dc170 in serialize_response_call () #3 0x00000001002d1954 in soap_server_fault_ex () #4 0x00000001002d1c88 in soap_server_fault () #5 0x00000001002d150c in zim_SoapServer_fault () #6 0x00000001005ae62c in zend_do_fcall_common_helper_SPEC () #7 0x00000001005af5fc in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER () #8 0x00000001005acc50 in execute () #9 0x000000010055e2e4 in zend_execute_scripts () #10 0x0000000100495f60 in php_execute_script () #11 0x00000001006c8294 in main () ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64233&edit=1