Re: [PHP-DEV] Seg fault when using active_symbol_table called from userspace function.

2009-11-01 Thread Mark Skilbeck
Scott MacVicar wrote: On 1 Nov 2009, at 21:41, Mark Skilbeck wrote: Scott MacVicar wrote: On 1 Nov 2009, at 21:09, Mark Skilbeck wrote: [snip] There is no symbol table as there are no variables. You should check if it's NULL before using zend_hash_exists. Scott Hi, Scott. I'm having trou

Re: [PHP-DEV] Seg fault when using active_symbol_table called from userspace function.

2009-11-01 Thread Scott MacVicar
On 1 Nov 2009, at 21:41, Mark Skilbeck wrote: Scott MacVicar wrote: On 1 Nov 2009, at 21:09, Mark Skilbeck wrote: [snip] There is no symbol table as there are no variables. You should check if it's NULL before using zend_hash_exists. Scott Hi, Scott. I'm having trouble - I added the che

Re: [PHP-DEV] Seg fault when using active_symbol_table called from userspace function.

2009-11-01 Thread Mark Skilbeck
Scott MacVicar wrote: On 1 Nov 2009, at 21:09, Mark Skilbeck wrote: [snip] There is no symbol table as there are no variables. You should check if it's NULL before using zend_hash_exists. Scott Hi, Scott. I'm having trouble - I added the check to see if the symbol table i available, ye

Re: [PHP-DEV] Seg fault when using active_symbol_table called from userspace function.

2009-11-01 Thread Mark Skilbeck
Scott MacVicar wrote: On 1 Nov 2009, at 21:09, Mark Skilbeck wrote: [snip] There is no symbol table as there are no variables. You should check if it's NULL before using zend_hash_exists. Scott Ah - of course. Thanks for that, Scott. -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] Seg fault when using active_symbol_table called from userspace function.

2009-11-01 Thread Scott MacVicar
On 1 Nov 2009, at 21:09, Mark Skilbeck wrote: Can you explain to me why the following causes a segfault: [code] PHP_FUNCTION(sample_var_a_exists) { if (!zend_hash_exists(EG(active_symbol_table), "a", sizeof("a"))) { RETURN_BOOL(0); } RETURN_BOOL(1); } [/code] Note: the segfaul

[PHP-DEV] Seg fault when using active_symbol_table called from userspace function.

2009-11-01 Thread Mark Skilbeck
Can you explain to me why the following causes a segfault: [code] PHP_FUNCTION(sample_var_a_exists) { if (!zend_hash_exists(EG(active_symbol_table), "a", sizeof("a"))) { RETURN_BOOL(0); } RETURN_BOOL(1); } [/code] Note: the segfault only occurs when the sa