|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79357 SOAP request segfaults when any request parameter is missing
Submitted: 2020-03-09 10:13 UTC Modified: 2020-03-09 13:51 UTC
From: roman dot vanicek at gmail dot com Assigned: nikic (profile)
Status: Closed Package: SOAP related
PHP Version: 7.4.3 OS: Linux 4.15
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
24 + 43 = ?
Subscribe to this entry?

 [2020-03-09 10:13 UTC] roman dot vanicek at gmail dot com
Any SOAP request crashes (with segfault) when any request parameter is missing.

Normally it should throw an exception  (SOAP-ERROR: Encoding: object has no 'intB' property).

The error is tested on PHP 7.4.0-7.4.3.
It works fine in PHP 7.3.x.
The error happens in shared build of soap module, the static build is fine.

Configure line: --enable-soap=shared --without-sqlite3 --without-pdo-sqlite

GDB output: 
Program received signal SIGSEGV, Segmentation fault.
0x0000555555ad9e77 in zend_gc_delref (p=0x61445b0a0a6e4f20)
    at /var/roman/src/php/php-7.4.3/Zend/zend_types.h:1039
1039            ZEND_ASSERT(p->refcount > 0);
(gdb) bt
#0  0x0000555555ad9e77 in zend_gc_delref (p=0x61445b0a0a6e4f20)
    at /var/roman/src/php/php-7.4.3/Zend/zend_types.h:1039
#1  0x0000555555ad9fec in zval_delref_p (pz=0x7ffff3e140e0)
    at /var/roman/src/php/php-7.4.3/Zend/zend_types.h:1075
#2  0x0000555555ada765 in zval_ptr_dtor_nogc (zval_ptr=0x7ffff3e140e0)
    at /var/roman/src/php/php-7.4.3/Zend/zend_variables.h:34
#3  0x0000555555aeece9 in ZEND_HANDLE_EXCEPTION_SPEC_HANDLER ()
    at /var/roman/src/php/php-7.4.3/Zend/zend_vm_execute.h:2615
#4  0x0000555555b50afc in execute_ex (ex=0x7ffff3e14020)
    at /var/roman/src/php/php-7.4.3/Zend/zend_vm_execute.h:53889
#5  0x0000555555b54ad0 in zend_execute (op_array=0x7ffff3e84300, return_value=0x0)
    at /var/roman/src/php/php-7.4.3/Zend/zend_vm_execute.h:57913
#6  0x0000555555a779f5 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /var/roman/src/php/php-7.4.3/Zend/zend.c:1665
#7  0x00005555559d6713 in php_execute_script (primary_file=0x7fffffffca60)
    at /var/roman/src/php/php-7.4.3/main/main.c:2617
#8  0x0000555555b5760f in do_cli (argc=2, argv=0x55555678a500)
    at /var/roman/src/php/php-7.4.3/sapi/cli/php_cli.c:961
#9  0x0000555555b587d1 in main (argc=2, argv=0x55555678a500)
    at /var/roman/src/php/php-7.4.3/sapi/cli/php_cli.c:1356

Test script:


$sc = new SoapClient('');
// parameter intB is missing
$res = $sc->Add(['intA'=>1]);
// PHP 7.3 throws exception: SOAP-ERROR: Encoding: object has no 'intB' property
// PHP 7.4 (shared soap) segfaults

Expected result:
Exception: SOAP-ERROR: Encoding: object has no 'intB' property

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-09 10:30 UTC]
-Status: Open +Status: Verified
 [2020-03-09 10:30 UTC]

==21080== Conditional jump or move depends on uninitialised value(s)
==21080==    at 0x9A194F: zval_ptr_dtor_nogc (zend_variables.h:34)
==21080==    by 0x9B5F34: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER (zend_vm_execute.h:2615)
==21080==    by 0xA17DB9: execute_ex (zend_vm_execute.h:53889)
==21080==    by 0xA1BD88: zend_execute (zend_vm_execute.h:57913)
==21080==    by 0x93EFD7: zend_execute_scripts (zend.c:1665)
==21080==    by 0x8A0781: php_execute_script (main.c:2617)
==21080==    by 0xA1E99C: do_cli (php_cli.c:961)
==21080==    by 0xA1FB6C: main (php_cli.c:1356)
 [2020-03-09 13:51 UTC]
-Assigned To: +Assigned To: nikic
 [2020-03-09 14:02 UTC]
Automatic comment on behalf of
Log: Fixed bug #79357
 [2020-03-09 14:02 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 00:01:31 2024 UTC