ID:          41134
 Updated by:  [EMAIL PROTECTED]
 Reported By: marco dot cova at gmail dot com
-Status:      Open
+Status:      Closed
 Bug Type:    Scripting Engine problem
 PHP Version: 5.2.1
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




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

[2007-04-18 15:11:58] marco dot cova at gmail dot com

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 this bug report at http://bugs.php.net/?id=41134&edit=1

Reply via email to