Le 21/07/2014 19:52, Glenn Sams a écrit :
> Hello,
>
> I am having a really hard time figuring out why this is throwing a segment
> fault.
"s" expect 2 arg, a char ** and a a in * (for length)
char *input_file = NULL;
char *output_file = NULL;
int input_len, output_len;
zend_bool formatoutput = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b",
&input_file, &input_len,
&output_file, &outpût_len,
&formatoutput) == FAILURE) {
Remi.
>
> 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?
>
--
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php