ID:               37850
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jeremiahh at allstardirectories dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         SOAP related
 Operating System: Linux
 PHP Version:      5.1.4
 New Comment:

I am looking for a short but complete reproduce script, which I could
copy/paste and reproduce the problem.


Previous Comments:
------------------------------------------------------------------------

[2006-07-03 18:25:27] jeremiahh at allstardirectories dot com

I'm not sure what more you need to reproduce it.  The code I gave
should be enough to reproduce the problem.  For obvious reasons I can
not fill in the arguments to the methods since they are user specific. 
What exactly are you looking for?

------------------------------------------------------------------------

[2006-06-27 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2006-06-19 18:03:42] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.



------------------------------------------------------------------------

[2006-06-19 18:00:06] jeremiahh at allstardirectories dot com

It is important to note that this bug only seems to happen in the case
where a single SoapHeader object is passed to __setSoapHeaders().  If
you pass an array of SoapHeaders, such as array(soapHeaderObj) then the
problem is non-existent.  When you pass it in an array the reference
counting happens automatically by the array constructor.

Also, this problem does not exist in the SoapHeader()::__call method
which correctly adds a reference when a single SoapHeader object is
passed:

ZVAL_ADDREF(headers);

------------------------------------------------------------------------

[2006-06-19 17:46:03] jeremiahh at allstardirectories dot com

Description:
------------
The undocumented method SoapClient::__setSoapHeaders() incorrectly
handles reference counting when a single SoapHeader object is passed.

Reproduce code:
---------------
function someMethod()
{
  $headers = new SoapHeader(...);
  $client = new SoapClient(...);
  $client->__setSoapHeaders($headers);

  $this->saved_client = $client;
}

function someOtherMethod()
{
  $client = $this->saved_client;
  $client->__soapCall(...);
}

Expected result:
----------------
For the code

$obj->someMethod();
$obj->someOtherMethod();

you would expect the call $client->__soapCall() to succeed with the
appropriate soap headers.

Actual result:
--------------
It crashes.  If one does a print_r($this->saved_client) in both methods
the problem is obvious.  The reference count for $headers is not
incremented in __setSoapHeaders() and so when  someMethod() finished
the object is destroyed while the SoapClient object is still
referencing it.  Then in someOtherMethod() the SoapHeader object is no
longer available.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37850&edit=1

Reply via email to