php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32941 Sending structured exception kills a php
Submitted: 2005-05-04 07:36 UTC Modified: 2005-06-01 16:53 UTC
From: steckovic at aarongroup dot cz Assigned: dmitry
Status: Closed Package: SOAP related
PHP Version: 5.0.4 OS: FEDORA
Private report: No CVE-ID:
 [2005-05-04 07:36 UTC] steckovic at aarongroup dot cz
Description:
------------
Hello,

I have problem with returing structured exception.
I wrote simple echoString service in Java (Axis) with following functionality:
   if argument is not equal to string "exception" same value
   is returned. If argument is equal to "exception" exception is thrown. Exception has two data fields integer and string.

If client is java program everything is working. If client is PHP
code and argument is "exception", php (last snapshot) goes down 
by signal segv, for other arguments it is working.

See following files:
 service/* - service implementation in Java
 client.php - client implementation in PHP
 request.xml - soap request 
 response.xml - response which sends PHP down by sig segv  


If it is user error, I apologize to you.

Thank you
  Petr Steckovic



 

<?php
define('WSDL_LOCATION', 'http://212.24.157.117:8080/axis/services/echo?wsdl');
if(!extension_loaded('soap')) dl('soap.so');
$client =& new SoapClient(WSDL_LOCATION, array("trace" => 1, 'exceptions' => 0));
$ahoj  = $client->echoString('exception');
echo "Echo".$ahoj."\n";
var_dump($ahoj);
?>
 

Reproduce code:
---------------
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<SOAP-ENV:Body>
		<m:echoString xmlns:m="urn:service.EchoService" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
			<e xsi:type="xsd:string">exception</e>
		</m:echoString>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

---- Response ----

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<soapenv:Body>
		<soapenv:Fault>
			<faultcode>soapenv:Server.userException</faultcode>
			<faultstring>service.EchoServiceException</faultstring>
			<detail>
				<service.EchoServiceException xsi:type="ns1:EchoServiceException" xmlns:ns1="urn:service.EchoService">
					<intParameter xsi:type="xsd:int">105</intParameter>
					<parameter xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">string param</parameter>
				</service.EchoServiceException>
				<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">steckovic</ns2:hostname>
			</detail>
		</soapenv:Fault>
	</soapenv:Body>
</soapenv:Envelope>



Expected result:
----------------
Correctly working with response. No SIGSEGV.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-05 11:23 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

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.


 [2005-05-05 15:48 UTC] steckovic at aarongroup dot cz
I can't found any excute statememt (I try 2000 calls back) Core dump has 33MB Do you want to send it to you?


#0  0x0816a248 in attr_is_equal_ex (node=0x8457540, name=0x831bf18 "href", ns=0x0)
    at /home/src/php/php5-200505030430/ext/soap/php_xml.c:212
#1  0x0816a363 in get_attribute_ex (node=0x8457540, name=0x831bf18 "href", ns=0x0)
    at /home/src/php/php5-200505030430/ext/soap/php_xml.c:246
#2  0x08141d99 in check_and_resolve_href (data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2753
#3  0x081408fe in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2289
#4  0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#5  0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#6  0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#7  0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#8  0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#9  0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#10 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#11 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#12 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#13 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#14 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#15 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#16 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#17 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#18 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#19 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#20 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#21 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#22 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#23 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#24 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#25 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#26 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#27 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#28 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#29 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#30 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#31 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#32 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#33 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#34 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#35 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#36 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#37 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#38 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#39 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#40 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
#41 0x08138fb5 in master_to_zval_int (encode=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:327
#42 0x08140ad6 in guess_zval_convert (type=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2337
#43 0x08141abc in sdl_guess_convert_zval (enc=0x8455b1c, data=0x8457500) at /home/src/php/php5-200505030430/ext/soap/php_encoding.c:2616
 [2005-05-27 12:46 UTC] dmitry@php.net
I cannot access WSDL file 'http://212.24.157.117:8080/axis/services/echo?wsdl' and cannot reprodoce and fix bug without it.
 [2005-06-01 07:15 UTC] steckovic at aarongroup dot cz
Test server is behind a firewall. I haven't rights to allow access to this server. I can send to you complete implementation of webservice which kills the PHP.
Thank you
 Petr Steckovic
 [2005-06-01 16:53 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_0.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 21:01:55 2014 UTC