Bug #70773 [Opn->Fbk]: Segmentation fault (core dumped)

From: Date: Fri, 23 Oct 2015 12:22:11 +0000
Subject: Bug #70773 [Opn->Fbk]: Segmentation fault (core dumped)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196769@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70773&edit=1 ID: 70773 Updated by: laruence@php.net Reported by: svein at vip dot qq dot com Summary: Segmentation fault (core dumped) -Status: Open +Status: Feedback Type: Bug Package: Scripting Engine problem Operating System: Linux 2.6.33.15 PHP Version: 7.0.0RC5 Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2015-10-23 04:09:20] laruence@php.net use: size_t function_name_len = 0; ------------------------------------------------------------------------ [2015-10-23 03:52:23] svein at vip dot qq dot com Description: ------------ I wrote a PHP extension function my_test: PHP_FUNCTION(my_test) { long type = 0; char *function_name = NULL; int function_name_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &type ,&function_name,&function_name_len) == FAILURE) { zend_error(E_ERROR, "my_test zend_parse_parameters error"); } RETURN_LONG(1); } when i call this function in a php file php crash with Segmentation fault (core dumped) but when i modify mytest to: PHP_FUNCTION(my_test) { long type = 0; char *function_name = NULL; int function_name_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &type ,&function_name,&function_name_len) == FAILURE) { zend_error(E_ERROR, "my_test zend_parse_parameters error"); } } or PHP_FUNCTION(my_test) { long type = 0; char *function_name = NULL; int function_name_len = 0; RETURN_LONG(1); } php run ok Test script: --------------- PHP_FUNCTION(my_test) { long type = 0; char *function_name = NULL; int function_name_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &type ,&function_name,&function_name_len) == FAILURE) { zend_error(E_ERROR, "my_test zend_parse_parameters error"); } RETURN_LONG(1); } Expected result: ---------------- ok Actual result: -------------- Segmentation fault (core dumped) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70773&edit=1

« previous php.bugs (#196769) next »