[PHP4BETA] SET_VAR_STRINGL causes SIGSEGV
| From: | Thies C. Arntzen | Date: | Wed, 26 May 1999 09:57:21 +0000 |
| Subject: | [PHP4BETA] SET_VAR_STRINGL causes SIGSEGV | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1060@lists.php.net to get a copy of this message | ||
gdb-trace at the bottom.
in php.h:
#define SET_VAR_STRING(n,v) { \
{ \
pval var; \
char *str=v; /* prevent 'v' from being evaluated more than
once */ \
var.value.str.val = (str); \
var.value.str.len = strlen((str)); \
var.type = IS_STRING; \
_php3_hash_update(&EG(symbol_table), (n), strlen((n))+1,
&var, sizeof(pval),NULL); \
} \
i think this should be looking like this:
#define SET_VAR_STRING(n,v) { \
{ \
pval *var = emalloc(sizeof(pval)); \
char *str=v; /* prevent 'v' from being evaluated more than
once */ \
var->value.str.val = (str); \
var->value.str.len = strlen((str)); \
var->type = IS_STRING; \
var->refcount = 1; \
var->is_ref = 0; \
_php3_hash_update(&EG(symbol_table), (n), strlen((n))+1,
&var, sizeof(pval*),NULL); \
} \
}
var should be a pval* shouln't it??
but making this change doesn't help!
so, is there any sample how to create, read & update variables from the
current php-scope?
regards,
tc
using ora_bind:
Program received signal SIGSEGV, Segmentation fault.
0x32780 in zval_ptr_dtor (zval_ptr=0xd63e4) at zend_execute_API.c:202
202 (*zval_ptr)->refcount--;
(gdb) where
#0 0x32780 in zval_ptr_dtor (zval_ptr=0xd63e4) at zend_execute_API.c:202
#1 0x39e44 in zend_hash_add_or_update (ht=0xb0d70, arKey=0xd6168 "__L__userid",
nKeyLength=12, pData=0xefff9718, nDataSize=16, pDest=0x0, flag=1)
at zend_hash.c:146
#2 0x4c4dc in ora_set_param_values (cursor=0x3d4e60, isout=1) at oracle.c:1792
#3 0x4ad0c in php3_Ora_Exec (ht=4017764, return_value=0xefff9858, list=0xb0dfc, plist=0xb0e28) at
oracle.c:970
#4 0x4154c in execute (op_array=0x13ac78) at zend_execute.c:1328
#5 0x41670 in execute (op_array=0x145d18) at zend_execute.c:1354
#6 0x41670 in execute (op_array=0x1462c0) at zend_execute.c:1354
#7 0x41670 in execute (op_array=0x11f6a8) at zend_execute.c:1354
#8 0x41670 in execute (op_array=0x3788d0) at zend_execute.c:1354
#9 0x41670 in execute (op_array=0xcbf40) at zend_execute.c:1354
#10 0x23af0 in php_execute_script (primary_file=0xeffff920) at main.c:1203
#11 0x29538 in main (argc=2, argv=0xeffff9a4) at cgi_main.c:431
(gdb) p **zval_ptr
$1 = {value = {lval = 0, dval = 0, str = {val = 0x0, len = 0}, chval = 0 '\000', ht = 0x0,
obj = {ce = 0x0, properties = 0x0}}, type = 0 '\000',
is_ref = 0 '\000', refcount = 0}
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany
--
PHP 4 Beta