Bug #74444 [Com]: multiple catch freezes in some cases
| From: | matej21 at matej21 dot cz | Date: | Fri, 14 Apr 2017 19:19:39 +0000 |
| Subject: | Bug #74444 [Com]: multiple catch freezes in some cases | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208564@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74444&edit=1
ID: 74444
Comment by: matej21 at matej21 dot cz
Reported by: matej21 at matej21 dot cz
Summary: multiple catch freezes in some cases
Status: Open
Type: Bug
Package: Scripting Engine problem
PHP Version: 7.1.4
Block user comment: N
Private report: N
New Comment:
php -d opcache.opt_debug_level=0x10000 output is more clear than phpdbg (in which extended value is
missing)
L59: V1 = NEW 0 string("RuntimeException")
L60: DO_FCALL
L61: THROW V1
L62: JMP L67
L63: CATCH string("FooEx") CV0($e) L0
L64: JMP L66
L65: CATCH string("RuntimeException") CV0($e)
L66: ECHO int(1)
L67: RETURN null
vs one more opcode
L60: V1 = NEW 0 string("RuntimeException")
L61: DO_FCALL
L62: THROW V1
L63: JMP L68
L64: CATCH string("FooEx") CV0($e) L66
L65: JMP L67
L66: CATCH string("RuntimeException") CV0($e)
L67: ECHO int(1)
L68: RETURN null
see L0 vs L66
btw, it also fails when CATCH string("FooEx") CV0($e) is on line 255 or 1023
Previous Comments:
------------------------------------------------------------------------
[2017-04-14 18:07:11] matej21 at matej21 dot cz
Description:
------------
if there is exact number of opcodes before multi-catch, php freezes. adding or removing just one
opcode fixes the issue.
relevant oplines:
L64 #58 ECHO ""
L67 #59 NEW "RuntimeException" @0
L67 #60 DO_FCALL
L67 #61 THROW @0
L67 #62 JMP J67
L68 #63 CATCH "FooEx" $e 0
L68 #64 JMP J66
L68 #65 CATCH "RuntimeException" $e 1
L69 #66 ECHO 1
L71 #67 RETURN null
Test script:
---------------
<?php
function doSth()
{
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
try {
throw new \RuntimeException();
} catch (\FooEx | \RuntimeException $e) {
echo 1;
}
}
doSth();
Expected result:
----------------
1
Actual result:
--------------
php freezes
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74444&edit=1