Bug #63780 [Com]: Segmentation fault when try to get $request
Edit report at https://bugs.php.net/bug.php?id=63780&edit=1
ID: 63780
Comment by: saschaprolic at googlemail dot com
Reported by: php dot maks3w at virtualplanets dot net
Summary: Segmentation fault when try to get $request
Status: Feedback
Type: Bug
Package: SOAP related
PHP Version: 5.4.9
Block user comment: N
Private report: N
New Comment:
I experienced the same bug. You can find my strace log at: https://gist.github.com/4604494
Previous Comments:
------------------------------------------------------------------------
[2012-12-16 11:17:29] reeze@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.
------------------------------------------------------------------------
[2012-12-15 18:06:17] php dot maks3w at virtualplanets dot net
Description:
------------
Situation: Custom class which extend from SoapClient and override "public
function __doRequest($request, $location, $action, $version, $one_way = null)"
$request can't be used to compare strings, instead throw a Segmentation Fault
error.
$request looks like a C Pointer or any other type instead of a PHP String type
As workaround you can filter the variable passing the value through a function
which return basically the same value of the argument passed as input (like
ltrim) after that it's possible save the returned value and now is a normal PHP
String and can be compared.
Test script:
---------------
FAILING CODE:
public $lastRequest;
function __doRequest($request, $location, $action, $version, $one_way = 0) {
$this->lastRequest = $request;
}
$this->assertEquals('SomeContent', $this->lastRequest); // Segmentation Faul.
WORKAROUND:
public $lastRequest;
function __doRequest($request, $location, $action, $version, $one_way = 0) {
$this->lastRequest = ltrim($request); // Pass $request through a function
}
$this->assertEquals('SomeContent', $this->lastRequest); // Works
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63780&edit=1
Thread (4 messages)