Bugs item #1736792, was opened at 2007-06-13 16:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1736792&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Adam Olsen (rhamphoryncus)
Assigned to: Nobody/Anonymous (nobody)
Summary: dict reentrant/threading bug

Initial Comment:
As I first mentioned in my post[1] on comp.lang.python, it seems possible to 
modify a dict while a lookup is ongoing, without causing the lookup to restart. 
 This requires the ma_table be reallocated twice (first to a new address, then 
a second time back to the original address).  This could also happen if the 
constants or behaviour relating to ma_smalltable were changed, but the current 
implementation is safe.

To fix this, I suggest two more tests be added along side the ep0 and startkey 
tests that currently restart the lookup process.

1) ma_mask.  If ma_table was reallocated, and the new allocation is smaller, 
memory corruption would result.  Checking ma_mask for changes would ensure this 
doesn't happen.

2) reallocation counter.  Increment every time ma_table is reallocated.  It 
would be technically possible to overflow this, but the circumstances would be 
exceedingly unusual.


[1] 
http://groups.google.com/group/comp.lang.python/browse_thread/thread/7f5b8fc59aadbdea/d77bdbcf5b20c056

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1736792&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to