php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70334 Php SoapServer crashed after second SoapFault
Submitted: 2015-08-23 12:47 UTC Modified: 2021-08-10 15:33 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: miracle at rpz dot name Assigned: cmb (profile)
Status: Closed Package: SOAP related
PHP Version: 5.6.12 OS: Any
Private report: No CVE-ID: None
 [2015-08-23 12:47 UTC] miracle at rpz dot name
Description:
------------
On first SoapFault server respond with status 500 (expected behavior).
On next fault server crashed.

Reproduced on windows and linux, with all 5.6.* versions, php-cli and mod_php, works fine on 5.5 and 5.4.


client.php:

<?php
        $client = new SoapClient(null, ['uri' => 'http://test-uri', 'location' => 'http://127.0.0.1:8081/server.php']);

        try {
            $client->unknownMethod(); // expected exception
        } catch (Exception $e) {
            var_dump($e->getMessage());
        }
 
        // any "normal" requests here
        
        try {
            $client->unknownMethod(); // server crashed here
        } catch (Exception $e) {
            var_dump($e->getMessage());
        }
?>

$./php ./client.php
string(38) "Function 'unknownMethod' doesn't exist"
string(27) "Error Fetching http headers"

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

server.php:

<?php
        $srv = new SoapServer(null, ['uri' => 'http://test-uri/']);
        $srv->handle();

?>

$ ./php -S 127.0.0.1:8081 -t /tmp/php-soapserver


PHP 5.6.12 Development Server started at Tue Aug 18 20:28:09 2015
Listening on http://127.0.0.1:8081
Document root is /tmp/php-soapserver
Press Ctrl-C to quit.
[Tue Aug 18 20:28:11 2015] 127.0.0.1:59246 [500]: /server.php - Function 'unknownMethod' doesn't exist in /tmp/php-soapserver/server.php on line 3
Segmentation fault (core dumped)

(gdb)bt
#0  0x00000000008ca757 in zend_std_object_get_class (object=0x7f3b34a0dc28) at /tmp/php-soapserver/php-5.6.12/Zend/zend_object_handlers.c:1528
#1  0x000000000089001d in zend_get_class_entry (zobject=0x7f3b34a0dc28) at /tmp/php-soapserver/php-5.6.12/Zend/zend_API.c:238
#2  0x00000000006b4c84 in soap_error_handler (error_num=8192, error_filename=0xd58393 "Unknown", error_lineno=0, 
    format=0xd43178 "Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input"..., args=0x7fff26f74920)
    at /tmp/php-soapserver/php-5.6.12/ext/soap/soap.c:2145
#3  0x000000000088dc11 in zend_error (type=8192, 
    format=0xd43178 "Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input"...) at /tmp/php-soapserver/php-5.6.12/Zend/zend.c:1133
#4  0x0000000000809669 in php_default_post_reader () at /tmp/php-soapserver/php-5.6.12/main/php_content_types.c:75
#5  0x000000000080363f in sapi_read_post_data () at /tmp/php-soapserver/php-5.6.12/main/SAPI.c:247
#6  0x0000000000803ff0 in sapi_activate () at /tmp/php-soapserver/php-5.6.12/main/SAPI.c:482
#7  0x00000000007f7f4e in php_request_startup () at /tmp/php-soapserver/php-5.6.12/main/main.c:1632
#8  0x000000000094c626 in php_cli_server_request_startup (server=0x10896c0 <server>, client=0x2dc21b0)
    at /tmp/php-soapserver/php-5.6.12/sapi/cli/php_cli_server.c:2100
#9  0x000000000094c932 in php_cli_server_dispatch (server=0x10896c0 <server>, client=0x2dc21b0)
    at /tmp/php-soapserver/php-5.6.12/sapi/cli/php_cli_server.c:2170
#10 0x000000000094d157 in php_cli_server_recv_event_read_request (server=0x10896c0 <server>, client=0x2dc21b0)
    at /tmp/php-soapserver/php-5.6.12/sapi/cli/php_cli_server.c:2372
#11 0x000000000094d4ea in php_cli_server_do_event_for_each_fd_callback (_params=0x7fff26f74d30, fd=4, event=1)
    at /tmp/php-soapserver/php-5.6.12/sapi/cli/php_cli_server.c:2463
#12 0x00000000009489bf in php_cli_server_poller_iter_on_active (poller=0x10896c8 <server+8>, opaque=0x7fff26f74d30, 
    callback=0x94d2af <php_cli_server_do_event_for_each_fd_callback>) at /tmp/php-soapserver/php-5.6.12/sapi/cli/php_cli_server.c:960
#13 0x000000000094d560 in php_cli_server_do_event_for_each_fd (server=0x10896c0 <server>, 
    rhandler=0x94d060 <php_cli_server_recv_event_read_request>, whandler=0x94d17e <php_cli_server_send_event>)
---Type <return> to continue, or q <return> to quit---)
    at /tmp/php-soapserver/php-5.6.12/sapi/cli/php_cli_server.c:2484
#14 0x000000000094d5c4 in php_cli_server_do_event_loop (server=0x10896c0 <server>)
    at /tmp/php-soapserver/php-5.6.12/sapi/cli/php_cli_server.c:2494
#15 0x000000000094d904 in do_cli_server (argc=5, argv=0x2c0f710) at /tmp/php-soapserver/php-5.6.12/sapi/cli/php_cli_server.c:2595
#16 0x000000000094236c in main (argc=5, argv=0x2c0f710) at /tmp/php-soapserver/php-5.6.12/sapi/cli/php_cli.c:1381


Duplicate for #70271


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-09 10:31 UTC] m dot zygmuntowicz at onet dot pl
I've got a similar experience - my soap server function was a simple one returning a string. Every few calls the server crashes. After looking at the provided backtrace, I have disabled the "Automatically populating $HTTP_RAW_POST_DATA.." in php ini and the problem seems to be gone now (at least in my case).
Maybe this tip will help to narrow down the problem.
 [2016-02-05 18:49 UTC] miracle at rpz dot name
Maybe fixed in #70979
 [2021-07-29 11:54 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-07-29 11:54 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-08-08 04:22 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 "Re-Opened". Thank you.
 [2021-08-10 15:33 UTC] miracle at rpz dot name
-Status: No Feedback +Status: Closed
 [2021-08-10 15:33 UTC] miracle at rpz dot name
$HTTP_RAW_POST_DATA is no longer available since 7.0. Issue was "fixed" :)
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Dec 07 00:03:19 2022 UTC