[PyKDE] A little bug chasing story

Phil Thompson phil at river-bank.demon.co.uk
Fri Mar 31 20:09:24 BST 2000


Gey-Hong Gweon wrote:
> 
> Dear Phil,
> 
> Today, I have upgraded PyKDE to 0.11, and it seems to solve the parent()
> and children() problem I once reported. However, I was having a more
> subtle problem this time. Instead of posting a clueless question, I
> decided to chase this problem a little bit, so here I report what I
> found so far. I hope you will fix the problem, if you think I found a
> bug indeed.
> 
> The subtle problem I had was this: children() method would return
> perfectly sensible return values when my program started but then "after
> a while" it would return completely wrong values.
> 
> By inserting a few lines in the source codes for PyQt and sip, I noticed
> that this happens exactly when the table size of "cppPyMap" (siplib.c)
> increases from 131 to 257. At the same time, completely wrong values
> were returned by sipMapCppToSelf().
> 
> After a little bit more chasing, I discovered that the problem lies in
> the hash code (objmap.c) used to access cppPyMap. The table size has
> increased, but the hash code is still computed as cpp_address %
> table_size, which is not the same as cpp_address % old_table_size, the
> correct code for the entries that already existed before the table size
> increased.

Do you have a short script that demonstrates the problem?  Do you have
patches to SIP that show the problem occuring?

Phil




More information about the PyQt mailing list