php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75588 Segmentation fault with recursive class constant definition
Submitted: 2017-11-29 10:51 UTC Modified: 2017-11-29 11:02 UTC
From: diacomltd at mail dot ru Assigned:
Status: Feedback Package: Scripting Engine problem
PHP Version: 7.1.12 OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-11-29 10:51 UTC] 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]


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-29 11:03 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2017-11-29 11:03 UTC] nikic@php.net
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?
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC