php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77549 SOAP crashes PHP
Submitted: 2019-01-31 11:31 UTC Modified: 2019-02-08 00:49 UTC
From: doug_luppi at hotmail dot com Assigned: cmb (profile)
Status: Closed Package: SOAP related
PHP Version: 7.3.1 OS: Windows Server 2012 R2
Private report: No CVE-ID: None
 [2019-01-31 11:31 UTC] doug_luppi at hotmail dot com
Description:
------------
When calling a method by _soapCall, PHP 7.3.1 (XAMPP) crashes without logging any error, even in the framework (CodeIgniter) or in isolated script, returning ERR_CONNECTION_RESET error.

PHP log in XAMPP don't have anything too.

It doesn't happen with every wsdl and not with every method.

Doing the same request by SoapUI, everything goes fine.
Doing the same request in PHP 5.6.31 (WAMP), everything goes fine.

OBS: Sorry about all these catches, I was desperate for handling some error.

Test script:
---------------
<?php
  // sleep(30);

  $objEnvio = array(
    'arg0' => array( 
      'status' => '',
       'canal' => 'TELEFONE',
       'dataCriacaoOrigem' => '2019-01-30',
       'dataRecebimento' => '2019-01-30',
       'dataFarmacovigilancia' => '2019-01-30',
       'tipoRelato' => 'ESNP',
       'sistemaOrigem' => '',
       'codOrigem' => '201900013/201',
       'codPais' => 'BR',
       'descricaoInicial' => 'Atendente SAC: Leonardo Coelho TESTE xD! ',
       'descricao' => '',
       'historiaMedica' => '',
       'autorizaContato' => '',
       'relator' => array(
          'email' => array(
            'email' => 'marcos_correa@hotmail.com',
            'tipo' => 'PROFISSIONAL',
          ),
        'endereco' => array ( 'tipo' => 'COMERCIAL', 'cep' => '76280-000', 'logradouro' => 'AV BRASILIA,100', 'numero' => '', 'complemento' => '', 'bairro' => 'CENTRO', 'cidade' => 'Britânia', 'estado' => 'GO', ), 'nome' => 'MARCOS CORREA', 'telefone' => array ( 'tipo' => 'COMERCIAL', 'ddd' => '', 'numero' => '(19) 3863-2632', 'complemento' => '', ), 'instituicao' => array ( 'email' => array ( 'email' => '', 'tipo' => 'PROFISSIONAL', ), 'endereco' => array ( 'tipo' => 'COMERCIAL', 'cep' => '76280-000', 'logradouro' => 'AV BRASILIA,100', 'numero' => '', 'complemento' => '', 'bairro' => 'CENTRO', 'cidade' => 'Britânia', 'estado' => 'GO', ), 'nome' => 'MUNICIPIO DE BRITANIA', 'telefone' => array ( 'tipo' => 'COMERCIAL', 'ddd' => '', 'numero' => '0156233831233', 'complemento' => '', ), ), 'profissao' => '', 'sexo' => 'M', ), 'paciente' => array ( 'email' => array ( 'email' => '', 'tipo' => '', ), 'endereco' => array ( 'tipo' => '', 'cep' => '', 'logradouro' => '', 'numero' => '', 'complemento' => '', 'bairro' => '', 'cidade' => '', 'estado' => '', ), 'nome' => 'TESTE', 'telefone' => array ( 'tipo' => '', 'ddd' => '', 'numero' => '', 'complemento' => '', ), 'instituicao' => array ( ), 'profissao' => '', 'sexo' => 'M', 'aceitaContato' => '', 'altura' => '179', 'alturaNI' => false, 'contracepcao' => array ( 'intervaloAplicacoes' => '', 'descricaoPausa' => '', 'houveEsquecimento' => '', 'usaOutrosMetodos' => '', 'descricaoOutrosMetodos' => '', ), 'dataNascimento' => '1996-05-11', 'dataNascimentoNI' => false, 'etnia' => '', 'gestacao' => array ( 'dataProvavelParto' => '', 'ultimaMenstruacao' => '', ), 'gestante' => '', 'idade' => 22, 'idadeNI' => false, 'iniciais' => 'T.', 'peso' => '77', 'pesoNI' => false, ), 'concomitante' => array ( ), 'eventoAdverso' => array ( 0 => array ( 'tipoEvento' => 'SUS_INE_TER', 'reacaoAdversa' => '', 'tipoReacaoAdversa' => '', 'inicio' => '', 'termino' => '', 'inicioStr' => '28/01/2019', 'inicioNI' => false, 'terminoStr' => '', 'terminoNI' => true, 'eventoPermanece' => 'S', 'previsibilidade' => '', 'gravidade' => 'GRAVE', 'intensidade' => '', 'criterioGravidade' => array ( ), 'cedeuAposSuspensao' => '', 'reapareceu' => '', 'emTratamento' => 'NI', 'descricaoTratamento' => '', 'intervaloAposUso' => '', 'causalidadeNaranjo' => '', 'causalidadeInformante' => '', 'medicamentoSuspeito' => array ( 'apresentacao' => array ( 'nome' => 'KOLLAGENASE 0,6U/g Pom Derm. - 1 bis. X 10g + esp.', 'codigo' => '46.3396', 'codigoProduto' => '46.3396', 'nomeProduto' => 'KOLLAGENASE S/ CLORANF', 'principioAtivo' => 'COLAGENASE T-248 BIOTECNOLOGIA', 'fabricante' => '', ), 'lote' => '0', 'fabricacao' => '', 'validade' => '', 'inicio' => '', 'termino' => '', 'fabricacaoStr' => '', 'validadeStr' => '00/00/0000', 'inicioStr' => '28/01/2019', 'inicioNI' => false, 'terminoStr' => '00/00/0000', 'terminoNI' => true, 'duracao' => '', 'doseDiaria' => '', 'posologia' => '', 'posologiaNI' => true, 'indicacao' => '', 'indicacaoNI' => true, 'viaAdministracao' => '', 'viaAdministracaoNI' => true, 'comPrescricao' => 'S', 'prescritorNotificado' => 'NI', 'interrompeuUso' => 'N', ), 'evolucao' => array ( ), 'visita' => array ( ), ), ), 'patologia' => array ( ), ), );

  $soapClient = new SoapClient('http://zulu:9090/sis/Relato?wsdl', ['trace' => TRUE, 'exceptions' => TRUE]);

  
  try {
    $r = $soapClient->__soapCall('registraRelato', array($objEnvio));
    //$r = $soapClient->registraRelato($objEnvio);
  }
  catch(Throwable $e) {
    var_dump($e); die;
  }
  catch(SoapFault $e) {
    var_dump($e); die;
  }
  catch(Exception $e) {
    var_dump($e); die;
  }
  catch(\Throwable $e) {
    var_dump($e); die;
  }
  catch(\SoapFault $e) {
    var_dump($e); die;
  }
  catch(\Exception $e) {
    var_dump($e); die;
  }

  var_dump($r); die;
?>

Expected result:
----------------
CASE SUCCESS

object(stdClass)[2]
  public 'return' => 
    object(stdClass)[3]
      public 'code' => string 'SUCCESS' (length=7)
      public 'codOrigem' => string '201900013/201' (length=13)
      public 'relatoId' => int 94845
      public 'message' => string 'Relato criado com sucesso em 2000ms' (length=35)

CASE FAIL (empty parameter for example)

object(SoapFault)[5]
  protected 'message' => string 'java.lang.NullPointerException' (length=30)
  private 'string' (Exception) => string '' (length=0)
  protected 'code' => int 0
  protected 'file' => string 'E:\wamp\www\src\teste_sis.php' (length=29)
  protected 'line' => int 30
  private 'trace' (Exception) => 
    array (size=1)
      0 => 
        array (size=6)
          'file' => string 'E:\wamp\www\src\teste_sis.php' (length=29)
          'line' => int 30
          'function' => string '__soapCall' (length=10)
          'class' => string 'SoapClient' (length=10)
          'type' => string '->' (length=2)
          'args' => 
            array (size=2)
              0 => string 'registraRelato' (length=14)
              1 => 
                array (size=0)
                  empty
  private 'previous' (Exception) => null
  public 'faultstring' => string 'java.lang.NullPointerException' (length=30)
  public 'faultcode' => string 'S:Server' (length=8)
  public 'detail' => 
    object(stdClass)[2]
      public 'exception' => 
        object(stdClass)[3]
          public 'stackTrace' => 
            object(stdClass)[4]
              public 'frame' => 
                array (size=39)
                  0 => string '' (length=0)
                  1 => string '' (length=0)
                  2 => string '' (length=0)
                  3 => string '' (length=0)
                  4 => string '' (length=0)
                  5 => string '' (length=0)
                  6 => string '' (length=0)
                  7 => string '' (length=0)
                  8 => string '' (length=0)
                  9 => string '' (length=0)
                  10 => string '' (length=0)
                  11 => string '' (length=0)
                  12 => string '' (length=0)
                  13 => string '' (length=0)
                  14 => string '' (length=0)
                  15 => string '' (length=0)
                  16 => string '' (length=0)
                  17 => string '' (length=0)
                  18 => string '' (length=0)
                  19 => string '' (length=0)
                  20 => string '' (length=0)
                  21 => string '' (length=0)
                  22 => string '' (length=0)
                  23 => string '' (length=0)
                  24 => string '' (length=0)
                  25 => string '' (length=0)
                  26 => string '' (length=0)
                  27 => string '' (length=0)
                  28 => string '' (length=0)
                  29 => string '' (length=0)
                  30 => string '' (length=0)
                  31 => string '' (length=0)
                  32 => string '' (length=0)
                  33 => string '' (length=0)
                  34 => string '' (length=0)
                  35 => string '' (length=0)
                  36 => string '' (length=0)
                  37 => string '' (length=0)
                  38 => string '' (length=0)
  public 'xdebug_message' => string '<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> SoapFault: java.lang.NullPointerException in E:\wamp\www\src\teste_sis.php on line <i>30</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0021</td><td bgcolor='#eeeeec' align='right'>268544</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='E:\wamp\www\src\teste_sis.php' bgcolor='#eeeeec'>...\teste_sis.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0026</td><td bgcolor='#eeeeec' align='right'>398760</td><td bgcolor='#eeeeec'><a href='http://www.php.net/SoapClient.--soapCall' target='_new'>__soapCall</a>
(  )</td><td title='E:\wamp\www\src\teste_sis.php' bgcolor='#eeeeec'>...\teste_sis.php<b>:</b>30</td></tr>
' (length=1182)

Actual result:
--------------
Report for php__PID__8708__Date__01_31_2019__Time_08_32_47AM__677__Second_Chance_Exception_C0000005.dmp

Type of Analysis Performed   Combined Crash/Hang Analysis 
Machine Name   ZULU 
Operating System   Windows Server 2012 
Number Of Processors   8 
Process ID   8708 
Process Image   E:\xampp\php\php.exe 
Command Line   php.exe E:\wamp\www\src\teste_sis.php 
System Up-Time   15 day(s) 11:32:27 
Process Up-Time   00:00:40 
Processor Type   X86 
Process Bitness   32-Bit 

Top 5 Threads by CPU time

Note - Times include both user mode and kernel mode for each thread 
Thread ID: 0     Total CPU Time: 00:00:00.124     Entry Point for Thread: php!mainCRTStartup 
Thread ID: 1     Total CPU Time: 00:00:00.000     Entry Point for Thread: mswsock!Tcpip4_WSHGetWildcardSockaddr+150 

CLR Information

Thread Report

Thread 0 - System ID 10816

Entry point   php!mainCRTStartup 
Create time   31/01/2019 08:32:15 
Time spent in user mode   0 Days 00:00:00.031 
Time spent in kernel mode   0 Days 00:00:00.093 

This thread is not fully resolved and may or may not be a problem. Further analysis of these threads may be required.

php_soap!to_xml_object+104 
php_soap!sdl_guess_convert_xml+81 
php_soap!master_to_xml_int+78a 
php_soap!model_to_xml_object+430 
php_soap!model_to_xml_object+1b3 
php_soap!to_xml_object+2ec 
php_soap!sdl_guess_convert_xml+81 
php_soap!master_to_xml_int+78a 
php_soap!to_xml_object+119 
php_soap!sdl_guess_convert_xml+81 
php_soap!master_to_xml_int+78a 
php_soap!model_to_xml_object+430 
php_soap!model_to_xml_object+1b3 
php_soap!to_xml_object+2ec 
php_soap!sdl_guess_convert_xml+81 
php_soap!master_to_xml_int+78a 
php_soap!model_to_xml_object+430 
php_soap!model_to_xml_object+1b3 
php_soap!to_xml_object+2ec 
php_soap!sdl_guess_convert_xml+81 
php_soap!master_to_xml_int+78a 
php_soap!serialize_zval+cc 
php_soap!serialize_parameter+e2 
php_soap!serialize_function_call+296 
php_soap!do_soap_call+578 
0x06fce3f8 
php7ts!zend_parse_parameters+1c 
php_soap!zim_SoapClient___call+2b2 
php7ts!execute_internal+1c 
php_xdebug+5cf6 

Thread 1 - System ID 15252

Entry point   mswsock!Tcpip4_WSHGetWildcardSockaddr+150 
Create time   31/01/2019 08:32:45 
Time spent in user mode   0 Days 00:00:00.000 
Time spent in kernel mode   0 Days 00:00:00.000 

This thread is not fully resolved and may or may not be a problem. Further analysis of these threads may be required.

ntdll!ZwRemoveIoCompletion+c 
kernel32!BaseThreadInitThunk+24 
ntdll!RtlInitializeExceptionChain+8f 
ntdll!RtlInitializeExceptionChain+5a 

Exception Information

PHP_SOAP!TO_XML_OBJECT+104In php__PID__8708__Date__01_31_2019__Time_08_32_47AM__677__Second_Chance_Exception_C0000005.dmp the assembly instruction at php_soap!to_xml_object+104 in E:\xampp\php\ext\php_soap.dll from The PHP Group has caused an access violation exception (0xC0000005) when trying to write to memory location 0x6c6d3d24 on thread 0

Module Information 

Image Name: E:\xampp\php\ext\php_soap.dll   Symbol Type:  PDB 
Base address: 0x00905a4d   Time Stamp:  Wed Jan 09 21:25:53 2019  
Checksum: 0x00000000   Comments:  Thanks to Brad Lafountain, Shane Caraveo, Dmitry Stogov 
COM DLL: False   Company Name:  The PHP Group 
ISAPIExtension: False   File Description:  SOAP 
ISAPIFilter: False   File Version:  7.3.1 
Managed DLL: False   Internal Name:  SOAP extension 
VB DLL: False   Legal Copyright:  Copyright © 1997-2018 The PHP Group 
Loaded Image Name:  php_soap.dll   Legal Trademarks:  PHP 
Mapped Image Name:     Original filename:  php_soap.dll 
Module name:  php_soap   Private Build:   
Single Threaded:  False   Product Name:  PHP 
Module Size:  228 KBytes   Product Version:  7.3.1 
Symbol File Name:  e:\xampp\php\php_debug\php_soap.pdb   Special Build:  & 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-31 12:32 UTC] doug_luppi at hotmail dot com
Doing the same request in PHP 7.2.14 (XAMPP), everything goes fine.
 [2019-02-02 19:21 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-02-02 19:21 UTC] cmb@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

In this case the complete reproduce script should contain a (or
link to a publicly available) WSDL that exhibits the broken
behavior, and the respective SOAP call.
 [2019-02-04 14:02 UTC] doug_luppi at hotmail dot com
-Status: Feedback +Status: Assigned
 [2019-02-04 14:02 UTC] doug_luppi at hotmail dot com
Test script is already in the initial comment of the bug report.

I can not up the webservice to the external web due company compliance.

I can not get more information about the WSDL beyond what's below, because the webservice is owned by a third party company.

WSDL Informations:
https://www.writeurl.com/text/gpqu4ltovdvw0dwvyvrl/x7ac3ekeg1joqlzwbv2e
 [2019-02-04 22:23 UTC] cmb@php.net
-Status: Assigned +Status: Open -Assigned To: cmb +Assigned To:
 [2019-02-04 22:23 UTC] cmb@php.net
Thanks!
 [2019-02-07 16:43 UTC] doug_luppi at hotmail dot com
Doing the same request in PHP 7.3.2 (XAMPP), everything goes fine.
 [2019-02-08 00:49 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2019-02-08 00:49 UTC] cmb@php.net
Then I assume that the issue has been resolved.
Please (re-)open if it is not.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC