|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-11-21 08:03 UTC] felipe@php.net
[2008-11-21 18:02 UTC] jawed@php.net
[2008-11-22 04:46 UTC] jawed@php.net
[2008-11-22 16:37 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 16:00:01 2025 UTC |
Description: ------------ I've fixed the ZTS build, and the redeclaration of tsrm_ls variable, when using TSRMLS_FETCH_FROM_CTX is used inside SO_METHOD. And when instantiating OAuth class I saw a segfault, because the variable wasn't initialized for the optional argument. Fixing this, I saw a memory leak, because this: if(OAUTH(soo_exception_ce)==NULL) { OAUTH(soo_exception_ce) = (zend_class_entry *)emalloc(sizeof(zend_class_entry)); } ... OAUTH(soo_exception_ce) = zend_register_internal_class_ex(&soo_ex_ce,zend_exception_get_default(TSRMLS_C),NULL TSRMLS_CC); See the code below. var_dump($x); still needing a fix. Patch: http://felipe.ath.cx/diff/oauth-zts-segfault-memleak.diff Reproduce code: --------------- <?php $x = new oauth(1,1); /* segfault + memory leak */ var_dump($x); /* still needing a fix */ Actual result: -------------- #0 0x00000000 in ?? () #1 0x082b6e59 in php_var_dump (struc=0x85ee388, level=1, tsrm_ls=0x84d6050) at /home/felipe/dev/php5_2/ext/standard/var.c:135 #2 0x082b719a in zif_var_dump (ht=1, return_value=0x85f9a08, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0, tsrm_ls=0x84d6050) at /home/felipe/dev/php5_2/ext/standard/var.c:186 #3 0x0838a4a2 in zend_do_fcall_common_helper_SPEC (execute_data=0xbf8d8210, tsrm_ls=0x84d6050) at /home/felipe/dev/php5_2/Zend/zend_vm_execute.h:200