Bug #70951 [Com]: Segmentation fault on invalid WSDL cache

From: Date: Fri, 13 Oct 2017 20:56:45 +0000
Subject: Bug #70951 [Com]: Segmentation fault on invalid WSDL cache
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211681@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70951&edit=1

 ID:                 70951
 Comment by:         alvaroguimaraes at gmail dot com
 Reported by:        bostjan at teon dot si
 Summary:            Segmentation fault on invalid WSDL cache
 Status:             Open
 Type:               Bug
 Package:            SOAP related
 Operating System:   Linux
 PHP Version:        5.6.15
 Block user comment: N
 Private report:     N

 New Comment:

I just had this.

We had invalid cache files because of a full disk incident before.

+1 on invalidate+delete behaviour suggested.

PHP 5.6.31-6+ubuntu16.04.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Kernel: 4.4.0-96-generic #119-Ubuntu SMP


Previous Comments:
------------------------------------------------------------------------
[2017-10-05 12:22:54] nikic@php.net

I'm not able to reproduce the segfault on master.

------------------------------------------------------------------------
[2015-11-20 23:19:02] bostjan at teon dot si

Additional info, just figured it out:
That wsdl cache file was left over when migration from 32bit to 64bit CentOS happened. It works on
32bit platforms.

In my opinion this should not produce a segmentation fault, but cache file should be
invalidated+deleted and recreated. Thoughts?

------------------------------------------------------------------------
[2015-11-20 22:57:03] bostjan at teon dot si

Description:
------------
When instantiating SOAP client, if WSDL cache exists and is "inappropriate" (either
corrupted, or sth similar), PHP crashes.

This was tested with:
- php 5.6.15 (remi's CentOS repos)
- php 5.6.13 (custom built)
- php 5.5.9 (ubuntu default)
- php 5.3.3 (centos 6 - I think it was originally created with this one)

Test script:
---------------
git clone https://github.com/bostjan/php-bug-soap-segfault.git
cd php-bug-soap-segfault
./run.sh


/*
 * Essentialy what script does:
 * 1. runs the soap-client.php for the first time, to create wsdl cache file
 * 2. replaces OK cache file with corrupted one
 * 3. reruns soap-client.php which now segfaults
 *
 * Content of soap-client.php:
 * ----------------------------------
 * <?php
 * ini_set('soap.wsdl_cache_enabled', true);
 * ini_set('soap.wsdl_cache_dir', __DIR__);
 * $soap = new SoapClient ("./services.wsdl");
 * echo "no segfault";
 * ?>
 * ----------------------------------
 */


Expected result:
----------------
### Now the output will be 'no segfault':
no segfault

### Installing 'inappropriate' cache file...done.

### Now there will be segmentation fault:
no segfault


/* Essentially no segmentation fault. */


Actual result:
--------------
### Now the output will be 'no segfault':
no segfault

### Installing 'inappropriate' cache file...done.

### Now there will be segmentation fault:
./run.sh: line 23: 19892 Segmentation fault      php ./soap-client.php



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



--
Edit this bug report at https://bugs.php.net/bug.php?id=70951&edit=1


Thread (6 messages)

« previous php.bugs (#211681) next »