From:             marco dot cova at gmail dot com
Operating system: 
PHP version:      5.2.1
PHP Bug Type:     Scripting Engine problem
Bug description:  zend_ts_hash_clean not thread-safe

Description:
------------
It seems that zend_ts_hash_clean is not actually thread-safe: it
delegates to zend_hash_clean without first acquiring the write lock on
the hashtable.

The following patch should fix this.

--- zend_ts_hash.c.orig 2007-04-16 10:27:24.000000000 -0700
+++ zend_ts_hash.c      2007-04-16 10:28:44.000000000 -0700
@@ -90,8 +90,10 @@

 ZEND_API void zend_ts_hash_clean(TsHashTable *ht)
 {
+       begin_write(ht);
        ht->reader = 0;
        zend_hash_clean(TS_HASH(ht));
+       end_write(ht);
 }

 ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey,
uint nK
eyLength, void *pData, uint nDataSize, void **pDest, int flag
ZEND_FILE_LINE_DC
)


-- 
Edit bug report at http://bugs.php.net/?id=41134&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41134&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41134&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41134&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41134&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41134&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41134&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41134&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41134&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41134&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41134&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41134&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41134&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41134&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41134&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41134&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41134&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41134&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41134&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41134&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41134&r=mysqlcfg

Reply via email to