Seg Fault on zend_parse_parameters
| From: | Glenn Sams | Date: | Mon, 21 Jul 2014 17:52:29 +0000 |
| Subject: | Seg Fault on zend_parse_parameters | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-12062@lists.php.net to get a copy of this message | ||
Hello,
I am having a really hard time figuring out why this is throwing a segment
fault.
char *input_file = NULL;
char *output_file = NULL;
zend_bool formatoutput = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &input_file,
&output_file, &formatoutput) == FAILURE) {
zend_throw_exception(NULL, "Function expects 2 or 3 argument", 0 TSRMLS_CC);
}
when I watch php through gdb is see this in the stack trace:
#0 0x082446c1 in ?? ()
#1 0x082456a0 in zend_parse_parameters ()
#2 0xb73f4b6e in zif_phpless_parse (ht=2, return_value=0x858198c,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at
/root/php_less/phpless.cpp:134
#3 0x0828c36d in ?? ()
#4 0x08264bca in execute ()
#5 0x0823a2bd in zend_execute_scripts ()
#6 0x081e2168 in php_execute_script ()
#7 0x082c8b5d in ?? ()
#8 0x419d6ebc in __libc_star
if I remove the parse params and just hard code the vars it does work just
fine.
Anyone got any ideas?