ID:               25329
 Updated by:       [EMAIL PROTECTED]
 Reported By:      firepages at firepages dot com dot au
-Status:           Open
+Status:           Verified
 Bug Type:         SQLite related
 Operating System: win XP
-PHP Version:      4.3.3
+PHP Version:      5.0.0b2-dev, 4.3.3
 New Comment:

PECL_4_3:

/usr/src/web/php/php4_3/Zend/zend_hash.c(544) : ht=0x08212634 is being
destroyed
/usr/src/web/php/php4_3/Zend/zend_hash.c(108) : Bailed out without a
bailout address!

HEAD:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (runnable)]
_efree (ptr=0x0) at /usr/src/web/php/php5/Zend/zend_alloc.c:257
257             CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb) bt
#0  _efree (ptr=0x0) at /usr/src/web/php/php5/Zend/zend_alloc.c:257
#1  0x816cdfb in _zval_ptr_dtor (zval_ptr=0x4029bac4) at
/usr/src/web/php/php5/Zend/zend_execute.h:67
#2  0x80b80c2 in php_sqlite_callback_invalidator (funcs=0x4029babc) at
/usr/src/web/php/php5/ext/sqlite/sqlite.c:288
#3  0x80b8110 in php_sqlite_callback_dtor (pDest=0x4029babc) at
/usr/src/web/php/php5/ext/sqlite/sqlite.c:310
#4  0x817a738 in zend_hash_destroy (ht=0x4029b8ec) at
/usr/src/web/php/php5/Zend/zend_hash.c:513
#5  0x80b813c in php_sqlite_db_dtor (rsrc=0x4029b95c) at
/usr/src/web/php/php5/ext/sqlite/sqlite.c:321
#6  0x817bb4d in list_entry_destructor (ptr=0x4029b95c) at
/usr/src/web/php/php5/Zend/zend_list.c:178
#7  0x817a89e in zend_hash_apply_deleter (ht=0x8349f10, p=0x4029b924)
at /usr/src/web/php/php5/Zend/zend_hash.c:568
#8  0x817a9da in zend_hash_graceful_reverse_destroy (ht=0x8349f10) at
/usr/src/web/php/php5/Zend/zend_hash.c:634
#9  0x817bc56 in zend_destroy_rsrc_list (ht=0x8349f10) at
/usr/src/web/php/php5/Zend/zend_list.c:234
#10 0x816cc93 in shutdown_executor () at
/usr/src/web/php/php5/Zend/zend_execute_API.c:279
#11 0x817555f in zend_deactivate () at
/usr/src/web/php/php5/Zend/zend.c:795
#12 0x8149224 in php_request_shutdown (dummy=0x0) at
/usr/src/web/php/php5/main/main.c:1197
#13 0x81ab61e in main (argc=2, argv=0xbffff694) at
/usr/src/web/php/php5/sapi/cli/php_cli.c:1013
#14 0x401b19cb in __libc_start_main (main=0x81aa848 <main>, argc=2,
argv=0xbffff694, init=0x8070368 <_init>, 
    fini=0x81abbe4 <_fini>, rtld_fini=0x4000aea0 <_dl_fini>,
stack_end=0xbffff68c)
    at ../sysdeps/generic/libc-start.c:92



Previous Comments:
------------------------------------------------------------------------

[2003-08-31 00:00:32] firepages at firepages dot com dot au

Description:
------------
when trying to use sqlite_create_function() & passing a class method of
$this apache dies orribly (appreciate it may be an apache issue)

Win XP Pro / php 4.3.3 compiled (MSVC) against apache 2.0.47

eg 
sqlite_create_function($this->db, 'link_keywords', array(
$this,'linkers' ) , 1);
/*OR*/
sqlite_create_function($this->db, 'link_keywords', array(
&$this,'linkers' ) , 1);

note that calling an external class method or normal function
[array($ext_class,$method)]gives no problem , just methods of $this

not tested on apache 1.* 



Reproduce code:
---------------
class sqlite_help{
        function sqlite_help(){
                $this->db = sqlite_open('e:/phpdev/cp/my_admin.sqldb.eng', 0666,
$sqliteerror);
                sqlite_create_function($this->db, 'link_keywords', array( $this ,
'linkers') , 1);
                return $this->db;
        }
        function get_single( $key ){
                $res = sqlite_query( $this->db,"SELECT link_keywords(var) FROM
my_admin WHERE key = '$key'" );
                $r = sqlite_fetch_array( $res , SQLITE_NUM );
                return $r[0];
        }
        function linkers( $str ){
                $keywords = array('phpmyadmin'=>'<a
href="http://localhost/phpmyadmin/index.php"";>phpMyAdmin</a>');
                foreach($keywords as $k=>$v){$str = str_replace( $k , $v , $str );}
                return nl2br( $str );
        }
}
$yaks=new sqlite_help();
echo $yaks->get_single('general');

Expected result:
----------------
str_replaced data from DB

works if function is external or external class method

Actual result:
--------------
an MS 'Apache has encountered an ....' etc Dialog no apache error log
available , no PHP error logged.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25329&edit=1

Reply via email to