Bug #69832 [NEW]: Assertion failed in zend_compile_const_expr_magic_const

From: Date: Mon, 15 Jun 2015 00:23:24 +0000
Subject: Bug #69832 [NEW]: Assertion failed in zend_compile_const_expr_magic_const
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193494@lists.php.net to get a copy of this message
From:             bugs dot php dot net at majkl578 dot cz
Operating system: Linux x86_64
PHP version:      7.0Git-2015-06-15 (Git)
Package:          Reproducible crash
Bug Type:         Bug
Bug description:Assertion failed in zend_compile_const_expr_magic_const

Description:
------------
PHP built from 6cb7b48846d129f088b50c4a8c4b00b7dc886f5c in DEBUG mode.

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

class Test
{
	public static $foo = [
		self::A => 'foo',
		self::B => [__CLASS__, 'foo'],
	];
}

Expected result:
----------------
No crash.

Actual result:
--------------
Crash, assertion failed:
php: /build/php/php-src/Zend/zend_compile.c:6743: void
zend_compile_const_expr_magic_const(zend_ast **): Assertion `ast->attr
== 373 && (compiler_globals.active_class_entry) &&
((compiler_globals.active_class_entry)->ce_flags & 0x80) != 0' failed.

Backtrace:
Program received signal SIGABRT, Aborted.
0x00007ffff0906107 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56	../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
#0  0x00007ffff0906107 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff09074e8 in __GI_abort () at abort.c:89
#2  0x00007ffff08ff226 in __assert_fail_base (fmt=0x7ffff0a35948
"%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x124ec2b "ast->attr == 373 &&
(compiler_globals.active_class_entry) &&
((compiler_globals.active_class_entry)->ce_flags & 0x80) != 0", 
    file=file@entry=0x124d4e9 "/build/php/php-src/Zend/zend_compile.c",
line=line@entry=6743, function=function@entry=0x124ed5b "void
zend_compile_const_expr_magic_const(zend_ast **)") at assert.c:92
#3  0x00007ffff08ff2d2 in __GI___assert_fail (assertion=0x124ec2b
"ast->attr == 373 && (compiler_globals.active_class_entry) &&
((compiler_globals.active_class_entry)->ce_flags & 0x80) != 0", 
    file=0x124d4e9 "/build/php/php-src/Zend/zend_compile.c", line=6743,
function=0x124ed5b "void zend_compile_const_expr_magic_const(zend_ast
**)") at assert.c:101
#4  0x0000000000be02f3 in zend_compile_const_expr_magic_const
(ast_ptr=0x7fffeb2781a8) at Zend/zend_compile.c:6741
#5  0x0000000000be040c in zend_compile_const_expr
(ast_ptr=0x7fffeb2781a8) at Zend/zend_compile.c:6775
#6  0x0000000000c50379 in zend_ast_apply (ast=0x7fffeb2781a0,
fn=0xbe0340 <zend_compile_const_expr>) at Zend/zend_ast.c:514
#7  0x0000000000be0421 in zend_compile_const_expr
(ast_ptr=0x7fffeb2781c8) at Zend/zend_compile.c:6778
#8  0x0000000000c50325 in zend_ast_apply (ast=0x7fffeb2781b8,
fn=0xbe0340 <zend_compile_const_expr>) at Zend/zend_ast.c:509
#9  0x0000000000be0421 in zend_compile_const_expr
(ast_ptr=0x7fffeb278220) at Zend/zend_compile.c:6778
#10 0x0000000000c50379 in zend_ast_apply (ast=0x7fffeb278218,
fn=0xbe0340 <zend_compile_const_expr>) at Zend/zend_ast.c:514
#11 0x0000000000be0421 in zend_compile_const_expr
(ast_ptr=0x7fffeb278138) at Zend/zend_compile.c:6778
#12 0x0000000000c50325 in zend_ast_apply (ast=0x7fffeb278120,
fn=0xbe0340 <zend_compile_const_expr>) at Zend/zend_ast.c:509
#13 0x0000000000be0421 in zend_compile_const_expr
(ast_ptr=0x7fffffff9d40) at Zend/zend_compile.c:6778
#14 0x0000000000bd44ed in zend_const_expr_to_zval
(result=0x7fffffff9d70, ast=0x7fffeb278120) at Zend/zend_compile.c:6788
#15 0x0000000000bd99b2 in zend_compile_prop_decl (ast=0x7fffeb278248) at
Zend/zend_compile.c:4762
#16 0x0000000000bd5671 in zend_compile_stmt (ast=0x7fffeb278248) at
Zend/zend_compile.c:6899
#17 0x0000000000bd77a3 in zend_compile_stmt_list (ast=0x7fffeb278060) at
Zend/zend_compile.c:4195
#18 0x0000000000bd5563 in zend_compile_stmt (ast=0x7fffeb278060) at
Zend/zend_compile.c:6840
#19 0x0000000000bd3d23 in zend_compile_class_decl (ast=0x7fffeb278278)
at Zend/zend_compile.c:5106
#20 0x0000000000bd569b in zend_compile_stmt (ast=0x7fffeb278278) at
Zend/zend_compile.c:6908
#21 0x0000000000bdb807 in zend_compile_top_stmt (ast=0x7fffeb278278) at
Zend/zend_compile.c:6818
#22 0x0000000000bdb7e9 in zend_compile_top_stmt (ast=0x7fffeb278018) at
Zend/zend_compile.c:6813
#23 0x0000000000ba0992 in compile_file (file_handle=0x7fffffffdfa8,
type=8) at Zend/zend_language_scanner.l:607
#24 0x00000000008b4a12 in phar_compile_file (file_handle=0x7fffffffdfa8,
type=8) at ext/phar/phar.c:3310
#25 0x0000000000c04420 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at Zend/zend.c:1383
#26 0x0000000000b5a052 in php_execute_script
(primary_file=0x7fffffffdfa8) at main/main.c:2475
#27 0x0000000000cf6f3a in do_cli (argc=2, argv=0x15fad80) at
sapi/cli/php_cli.c:967
#28 0x0000000000cf5e3a in main (argc=2, argv=0x15fad80) at
sapi/cli/php_cli.c:1334

-- 
Edit bug report at https://bugs.php.net/bug.php?id=69832&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69832&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69832&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69832&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69832&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69832&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69832&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69832&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69832&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69832&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69832&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69832&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69832&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69832&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69832&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69832&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69832&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69832&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69832&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69832&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69832&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#193494) next »