Bug #75588 [Opn->Fbk]: Segmentation fault with recursive class constant definition

From: Date: Wed, 29 Nov 2017 11:03:02 +0000
Subject: Bug #75588 [Opn->Fbk]: Segmentation fault with recursive class constant definition
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212798@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75588&edit=1

 ID:                 75588
 Updated by:         nikic@php.net
 Reported by:        diacomltd at mail dot ru
 Summary:            Segmentation fault with recursive class constant
                     definition
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   any
 PHP Version:        7.1.12
 Block user comment: N
 Private report:     N

 New Comment:

This throws an exception in all recent versions of PHP: https://3v4l.org/caUW0

Also, the code as you wrote it will never even start to recurse, as the constant is never used.

Can you please double-check that there is no additional code required to trigger the crash? Also,
can you try running using "php -n" to check whether an extension is responsible for the
different behavior?


Previous Comments:
------------------------------------------------------------------------
[2017-11-29 10:51:36] diacomltd at mail dot ru

Description:
------------
PHP interpreter stops with segmentation fault when it comes into recursive class constant
definition.

Test script:
---------------
<?php

class SomeConstants
{   
	const RECURSIVE_CONSTANT = self::RECURSIVE_CONSTANT;
}

Expected result:
----------------
It would be better if PHP interpreter stopped with helpful error message about recursive definition.

Actual result:
--------------
Nov 28 19:04:00 homestead kernel: [  194.868150] traps: php-fpm7.1[2753] general protection
ip:565383b93854 sp:7fffcdf87b30 error:0 in php-fpm7.1[565383958000+3cf000]



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



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


Thread (3 messages)

« previous php.bugs (#212798) next »