Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!bruce!trlluna!tardis!mcf From: mcf@tardis.trl.OZ.AU (Michael Flower) Newsgroups: comp.lang.c++ Subject: Rogue Wave C++ class library bug Keywords: Rogue Wave Bug Message-ID: <3481@trlluna.trl.oz> Date: 15 May 91 00:51:26 GMT Sender: news@trlluna.trl.oz Lines: 45 I am posting this as it may be of interest to several people, and I have no direct address for the people at Rogue Wave. If you don't have Rogue Wave, then this probably isn't of much interest. There is a bug in the RWSet class of their 3.1.0.1 release. I believe that the 4.0 release is available, but don't have a copy or know if the bug has been fixed in this release. The bug is that the library can go into an infinite loop under certain circumstances when using RWSet or classes derived from it. The problem occurs when inserting and deleting from a set. Under certain circumstances the 'info' table can have no 'empty' entries causing the hash collision mechanism to search unendingly in findIndex(). The reason that there are no 'empty' entries is that the 'info' table is expanded when the value of 'items' gets to greater than 2/3 of the current table size. The problem is that 'items' should specify the number of used table entries, not the number of obeject currently inserted into the set. The bug is caused by decrementing 'items' in removeAtIndex() when an object is removed from the RWSet. This should not be done since removing an object does not free an info table slot, it marks it only marks it deleted (this is because of the way that primary collision detection is handled). Thus decrementing 'items' in this context causes the class to believe that the 'info' table is not getting full, despite the fact that all the entries have been used and thus it does not resize the table before it fills up. BUG fix: in RWset::removeAtIndex(unsigned index) delete the line items--; and the problem goes away. I hope that this is some use to somebody. Michael Flower Artificial Intelligence Systems Email: m.flower@trl.oz.au Telecom Research Laboratories Voice: +61 3 541 6179 Melbourne, AUSTRALIA Fax: +61 3 543 8863