Bug #75675 [Opn]: Uncatchable Fatal error

From: Date: Wed, 20 Dec 2017 22:37:49 +0000
Subject: Bug #75675 [Opn]: Uncatchable Fatal error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213195@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75675&edit=1

 ID:                 75675
 Updated by:         nikic@php.net
 Reported by:        fabien dot papet at gmail dot com
 Summary:            Uncatchable Fatal error
 Status:             Open
 Type:               Bug
 Package:            *General Issues
 Operating System:   Windows
 PHP Version:        7.1.12
 Block user comment: N
 Private report:     N

 New Comment:

Thanks for checking!

I misread your initial output -- I thought execution aborts after the error, while what happens is
that the exception is caught, but the error is also printed. The reason why it's printed for
you (but was not for me) is probably that you have log_errors=1 set. I can now reproduce the same
result.

I will backport the previously mentioned commit to 7.1 and 7.2. This will remove the fatal error,
but calls to the error handler for warnings may remain.


Previous Comments:
------------------------------------------------------------------------
[2017-12-20 22:05:52] fabien dot papet at gmail dot com

tested in another computer with php 7.1.11

<?php
echo 'start'.PHP_EOL;

var_dump(extension_loaded('xdebug'));

try {
    $client = new SoapClient('http://thisaddressdoesnotexists',
['exceptions' => true, 'trace' => 0]);
} catch (SoapFault $exception) {
    var_dump('Exception: '.$exception->getMessage());
} catch (Exception $exception) {
    var_dump('Exception: '.$exception->getMessage());
}
echo 'end';



php test.php
start
bool(false)
PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://thisaddressdoesnotexists' : failed to
load external entity "http://thisaddressdoesnotexists"
 in C:\Users\fabie\Desktop\test.php on line 7
string(157) "Exception: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://thisaddressdoesnotexists' : failed to
load external entity "http://thisaddressdoesnotexists"
"
end

------------------------------------------------------------------------
[2017-12-20 20:26:39] nikic@php.net

Can somebody who has this issue please check whether they have XDebug enabled and whether disabling
it fixes the issue?

If this is the case I can backport https://github.com/php/php-src/commit/1dfcd1af9aab9b760d971ceeac18e9e83c85f80f
to 7.1, but I'd like to know whether this is the cause of the issue first.

------------------------------------------------------------------------
[2017-12-13 11:26:09] nikic@php.net

Please check if you have XDebug enabled. This code does not reproduce on vanilla PHP.

------------------------------------------------------------------------
[2017-12-13 11:18:39] spam2 at rhsoft dot net

BTW: in PHP7 "catch(Throwable $exception)" is the way to go in PHP7, it catches even parse
errors in case of eval and so on

------------------------------------------------------------------------
[2017-12-13 11:16:10] spam2 at rhsoft dot net

this is *not* a general issue - it's the SOAP extension

i reported that more than a year ago - it's hard to understand why this behvaior don't get
fixed at all because you can't write any sane code based on SOAP requests where it's
naturally that the remote side may not be reachable and you can't handle errors at all the way
it works currently

https://bugs.php.net/bug.php?id=73451

[2017-04-08 10:36 UTC] nikic@php.net
Looks like fatal erros in SOAP were for some reason not part of https://wiki.php.net/rfc/throw_error_in_extensions
-- probably because SOAP uses non-standard macros to generate them.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=75675


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


Thread (8 messages)

« previous php.bugs (#213195) next »