Bug #70773 [Fbk->NoF]: Segmentation fault (core dumped)
| From: | php-bugs at lists dot php dot net | Date: | Sun, 01 Nov 2015 04:22:21 +0000 |
| Subject: | Bug #70773 [Fbk->NoF]: Segmentation fault (core dumped) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-196954@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: php-bugs@lists.php.net
Reported by: svein at vip dot qq dot com
Summary: Segmentation fault (core dumped)
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Scripting Engine problem
Operating System: Linux 2.6.33.15
PHP Version: 7.0.0RC5
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
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