|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41134 zend_ts_hash_clean not thread-safe
Submitted: 2007-04-18 15:11 UTC Modified: 2007-05-11 12:21 UTC
From: marco dot cova at gmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.2.1 OS:
Private report: No CVE-ID:
 [2007-04-18 15:11 UTC] marco dot cova at gmail dot com
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;
+       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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-11 12:21 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Tue Oct 13 18:01:32 2015 UTC