php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40609 Segfaults when using more than one SoapVar in a request
Submitted: 2007-02-23 17:12 UTC Modified: 2007-02-26 11:24 UTC
From: robin dot harvey at chaptereight dot com Assigned: dmitry
Status: Closed Package: SOAP related
PHP Version: 5.2.1 OS: Linux - Ubuntu
Private report: No CVE-ID:
 [2007-02-23 17:12 UTC] robin dot harvey at chaptereight dot com
Description:
------------
I've got a very simple soap service (written in Java/Tomcat/Axis) which simply accepts and logs the XML of a soap request.  I need to post complex XML to the server (an XSL stylesheet) and I'm using SoapVar with XSD_ANYXML and dealing with the XSL as a string in PHP.  When I try to add more than one SoapVar object encoded in this way, PHP segfaults.  It's happy with 1 param as a SoapVar, and with both as simple strings.

Reproduce code:
---------------
<?php
$s = new SoapClient('http://192.168.1.79:8080/axis2/services/BuddyTestService?wsdl');
$data1 = <<<XML
<meta>
    <properties>
        <of>the transform go here!</of>
    </properties>
</meta>
XML;

$data2 = <<<XML
<more>
    <nice>Random content</nice>
    <being>sent to the soap server</being>
</more>
XML;

$tdata = new SoapVar($data1, XSD_ANYXML);
$t = new SoapVar($data2, XSD_ANYXML);

$data = array('TransformData' => $tdata, 'Transform' => $t);
//$data = array('TransformData' => 'foo', 'Transform' => 'bar');
$s->examine($data);
?>

Expected result:
----------------
NULL.  The service is 'In only'

Actual result:
--------------
robin@robin-desktop:~/projects/buddy/tomcat/soap2$ php test-client-joe.php 
Segmentation fault (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-23 17:48 UTC] rrichards@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 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.

An accessible WSDL might also be helpful
 [2007-02-24 14:08 UTC] robin dot harvey at chaptereight dot com
Hi,

I've uploaded the Soap service to an accessible site, and produced a backtrace, as requested.  I've not used dbg before, so please let me know if i've done something wrong.  I recompiled php with --enable-debug: heres the configure line:
'./configure' \
'--with-apxs2=/usr/bin/apxs2' \
'--with-zlib' \
'--with-bz2' \
'--with-pdo-mysql' \
'--with-pdo-pgsql' \
'--with-xsl' \
'--with-pear' \
'--enable-soap' \
'--enable-ftp' \
'--with-gd' \
'--enable-mbstring' \
'--enable-sockets' \
'--with-mcrypt' \
'--enable-debug'

Here's a copy of the php script I'm using:
<?php
$xml1 = <<<XML
<this>
    <might>be nice for a <while/> old chum</might>
</this>
XML;

$xml2 = <<<XML
<ok>
    Run it through <dbg/> to see what's going on
</ok>
XML;

$c = new SoapClient('http://bluelines.org:8080/axis2/services/StockQuoteService?wsdl');
$sv1 = new SoapVar($xml1, XSD_ANYXML);
$sv2 = new SoapVar($xml2, XSD_ANYXML);

$c->update(array('symbol' => $sv1, 'price' => $sv2));
?>

...and the dbg session, with a backtrace...


(gdb) set args /home/robin/tmp/40609.php
(gdb) run
Starting program: /usr/local/bin/php /home/robin/tmp/40609.php
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 46912533505280 (LWP 23881)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912533505280 (LWP 23881)]
0x0000000000642c51 in encode_add_ns ()
(gdb) bt
#0  0x0000000000642c51 in encode_add_ns ()
#1  0x0000000000639c62 in to_zval_user ()
#2  0x0000000000639f42 in to_zval_user ()
#3  0x000000000063a71d in to_zval_user ()
#4  0x00000000006420d5 in sdl_guess_convert_xml ()
#5  0x0000000000634b37 in master_to_xml ()
#6  0x000000000062c8c6 in add_soap_fault ()
#7  0x000000000062c781 in add_soap_fault ()
#8  0x000000000062ba97 in add_soap_fault ()
#9  0x0000000000624448 in zim_SoapClient_SoapClient ()
#10 0x0000000000625f40 in zim_SoapClient___call ()
#11 0x00000000007fd2f8 in zend_call_function ()
#12 0x0000000000827112 in zend_call_method ()
#13 0x0000000000830aca in zend_std_call_user_call ()
#14 0x0000000000834ecd in execute ()
#15 0x0000000000835daa in execute ()
#16 0x0000000000834912 in execute ()
#17 0x000000000080c9e8 in zend_execute_scripts ()
#18 0x00000000007ae109 in php_execute_script ()
#19 0x000000000089170a in main ()


Many thanks,
--Robin
 [2007-02-25 13:25 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_2.
Thanks to Rob.

 [2007-02-26 11:24 UTC] robin dot harvey at chaptereight dot com
Thanks for sorting this out so quickly guys - the fix works perfectly!

--Robin
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 05:03:21 2014 UTC