Date: 06/26/98
- Next message: shane: "[PHP-DEV] CVS update: php31/ext/standard"
- Previous message: Shane Caraveo: "RE: [PHP-DEV] php 3.1 status"
- In reply to: Rasmus Lerdorf: "Re: [PHP-DEV] Error in php3_hash / memory manager?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Rasmus Lerdorf wrote:
>
> > [Fri Jun 26 13:16:40 1998] [error] Possible PHP3 memory leak detected
> > (harmless): 1428392 bytes from :1508864
>
> Whoa.. Looks like some pretty screwed up pointers here!
>
> > #0 shutdown_memory_manager () at alloc.c:362
> > 362 snprintf(memory_leak_buf,512,"Possible
> > PHP3 memory leak detected (harmless): %d bytes from
> > %s:%d",t->size,t->filename,t->lineno);
>
> So, t->size is invalid, t->filename looks like it is blank and t->lineno
> is messed up as well.
>
> Looks like the php3_Ora_Bind() is messing with memory somewhere. I am
> looking at it, but I don't see anything obvious. It is emalloc'ing a
> bunch of stuff and it does't look like it is very careful about free'ing
> things. Of course, that shouldn't cause a core dump. Maybe something in
> the way you are manipulating the cursor->params hash table.
If you mean the memory manager warnings: That's not me! as far as I can
tell,
it is in _php3_hash_get_current_key() where not a pointer to the key but
a copy
is returned. Maybe Zeev should have a look into this.
>
> Or perhaps this bit of code:
>
> if((paramname = estrndup(argv[1]->value.str.val,
> argv[1]->value.str.len)) == NULL){
> php3_error(E_WARNING, "Out of memory for parametername");
> efree(newparam);
> RETURN_FALSE;
> }
>
> if (_php3_hash_add(cursor->params, paramname, argv[1]->value.str.len +
> 1, newparam, sizeof(oraParam), (void **)¶mptr) == FAI
> LURE) {
> /* XXX _php3_hash_destroy */
> efree(paramname);
> efree(newparam);
> php3_error(E_ERROR, "Could not make parameter placeholder");
> RETURN_FALSE;
> }
>
> You are passing a length of value.str.len+1 into the hash_add function,
> but you have only allocated value.str.len. I don't think this is the
> problem either though because of the way hash_add works.
>
> Keep hunting...
>
At the time of writing ora_bind I digged a little bit into the hash
functions.
To my understanding hash_add duplcates the passed data and I wanted to
have
a trailing \0 on the string for the oci functions.
-Andreas
- Next message: shane: "[PHP-DEV] CVS update: php31/ext/standard"
- Previous message: Shane Caraveo: "RE: [PHP-DEV] php 3.1 status"
- In reply to: Rasmus Lerdorf: "Re: [PHP-DEV] Error in php3_hash / memory manager?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

