Bug #77498 [Asn->Csd]: Custom extension Segmentation fault when declare static property

From: Date: Fri, 25 Jan 2019 10:05:36 +0000
Subject: Bug #77498 [Asn->Csd]: Custom extension Segmentation fault when declare static property
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219192@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77498&edit=1 ID: 77498 Updated by: nikic@php.net Reported by: liujingfeng dot a at yuewen dot com Summary: Custom extension Segmentation fault when declare static property -Status: Assigned +Status: Closed Type: Bug Package: Compile Failure Operating System: Linux PHP Version: 7.3.1 Assigned To: nikic Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=f78e681428a368930860162a1ea9b23b1a07666f Log: Fixed bug #77498 Previous Comments: ------------------------------------------------------------------------ [2019-01-22 03:17:50] liujingfeng dot a at yuewen dot com Description: ------------ Declare custom extension: PHP_MINIT_FUNCTION(foobar) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "FooBar", foobar_methods); foo_bar_ce = zend_register_internal_class(&ce TSRMLS_CC); zend_declare_property_long(foo_bar_ce, ZEND_STRL("test"), 1, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC TSRMLS_CC); return SUCCESS; } Test script: --------------- <?php class Test extends FooBar { } Actual result: -------------- Segmentation fault (gdb) bt #0 0x000055890ea15213 in zval_get_type (pz=0x0) at /data/website/php-7.3.1/Zend/zend_types.h:411 #1 0x000055890ea18f54 in zend_do_inheritance (ce=0x7f486b40e018, parent_ce=0x5589112786b0) at /data/website/php-7.3.1/Zend/zend_inheritance.c:904 #2 0x000055890e993961 in do_bind_inherited_class (op_array=0x7f486b479300, opline=0x7f486b485000, class_table=0x5589111552a0, parent_ce=0x5589112786b0, compile_time=1 '\001') at /data/website/php-7.3.1/Zend/zend_compile.c:1151 #3 0x000055890e993be3 in zend_do_early_binding () at /data/website/php-7.3.1/Zend/zend_compile.c:1202 #4 0x000055890e9a7403 in zend_compile_top_stmt (ast=0x7f486b47b230) at /data/website/php-7.3.1/Zend/zend_compile.c:8154 #5 0x000055890e9a7394 in zend_compile_top_stmt (ast=0x7f486b47b018) at /data/website/php-7.3.1/Zend/zend_compile.c:8142 #6 0x000055890e96c587 in zend_compile (type=2) at Zend/zend_language_scanner.l:602 #7 0x000055890e96c6da in compile_file (file_handle=0x7fffb1caf210, type=8) at Zend/zend_language_scanner.l:636 #8 0x000055890e7b6dc9 in phar_compile_file (file_handle=0x7fffb1caf210, type=8) at /data/website/php-7.3.1/ext/phar/phar.c:3344 #9 0x000055890e9c4bb1 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /data/website/php-7.3.1/Zend/zend.c:1562 #10 0x000055890e933f3f in php_execute_script (primary_file=0x7fffb1caf210) at /data/website/php-7.3.1/main/main.c:2630 #11 0x000055890ea97fd7 in do_cli (argc=2, argv=0x558911154ec0) at /data/website/php-7.3.1/sapi/cli/php_cli.c:997 #12 0x000055890ea98f4a in main (argc=2, argv=0x558911154ec0) at /data/website/php-7.3.1/sapi/cli/php_cli.c:1389 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77498&edit=1

« previous php.bugs (#219192) next »