Bug #79357 [NEW]: SOAP request segfaults when any request parameter is missing
| From: | roman dot vanicek at gmail dot com | Date: | Mon, 09 Mar 2020 10:13:24 +0000 |
| Subject: | Bug #79357 [NEW]: SOAP request segfaults when any request parameter is missing | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225966@lists.php.net to get a copy of this message | ||
From: roman dot vanicek at gmail dot com
Operating system: Linux 4.15
PHP version: 7.4.3
Package: SOAP related
Bug Type: Bug
Bug description:SOAP request segfaults when any request parameter is missing
Description:
------------
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:
---------------
<?php
ini_set('soap.wsdl_cache_enabled',0);
ini_set('soap.wsdl_cache_ttl',0);
$sc = new SoapClient('http://www.dneonline.com/calculator.asmx?WSDL');
// 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
var_dump($res);
Expected result:
----------------
Exception: SOAP-ERROR: Encoding: object has no 'intB' property
Actual result:
--------------
Segfault.
--
Edit bug report at https://bugs.php.net/bug.php?id=79357&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79357&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79357&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79357&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79357&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79357&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79357&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79357&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79357&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79357&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79357&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79357&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79357&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79357&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79357&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79357&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79357&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79357&r=mysqlcfg