php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63780 Segmentation fault when try to get $request
Submitted: 2012-12-15 18:06 UTC Modified: 2013-02-18 00:36 UTC
Votes:3
Avg. Score:4.3 ± 0.5
Reproduced:2 of 3 (66.7%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: php dot maks3w at virtualplanets dot net Assigned:
Status: No Feedback Package: SOAP related
PHP Version: 5.4.9 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php dot maks3w at virtualplanets dot net
New email:
PHP Version: OS:

 

 [2012-12-15 18:06 UTC] 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



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-16 11:17 UTC] 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-16 11:17 UTC] reeze@php.net
-Status: Open +Status: Feedback
 [2013-01-23 11:11 UTC] saschaprolic at googlemail dot com
I experienced the same bug. You can find my strace log at: https://gist.github.com/4604494
 [2013-02-18 00:36 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC