Article View: comp.windows.interviews
Article #666Possible bug IVbeta3 Tables (include/OS/table.h)
From: Bill Poitras
Date: Wed, 14 Oct 1992 01:56
Date: Wed, 14 Oct 1992 01:56
23 lines
1677 bytes
1677 bytes
After running purify (a program for helping detect memory leaks) over an
interviews program, it indicated that some already freed memory was being
read during a table iterator next call. The code which causes this
problem looks as follows:
for(TableIterator(TableMethodsImpl) i(*_table); i.more(); i.next())
_table->remove(i.cur_key());
The memory is freed in Table(TableMethodsImpl)::remove and then
accessed very soon afterwards. It occurs before anything else is freed.
It is accessed in TableIterator(TableMethodsImpl)::next. The obvious
problem is deleting memory while using an iterator. As I am not very
good at debugging problems like this, I would appreciate some way to
solve this problem. One way would be a properly written Table::clear
routine, rather than implmenting it myself.
--
+-----------------+-------------------------------+-------------------------+
| Bill Poitras | Molecular Simulations Inc. | Tel (408)522-9229 |
| (bill) | Sunnyvale, CA USA | |
| | FAX (408)732-0831 | bill@msi.com |
+-----------------+-------------------------------+-------------------------+
Technical Details
Message-ID:
<1992Oct14.015601.12256@msi.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!spool.mu.edu!sgiblab!msi!snoopy!billShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!spool.mu.edu!sgiblab!msi!snoopy!bill From: bill@snoopy (Bill Poitras) Subject: Possible bug IVbeta3 Tables (include/OS/table.h) Message-ID: <1992Oct14.015601.12256@msi.com> Sender: usenet@msi.com (USENET) Reply-To: bill@msi.com Organization: Molecular Simulations, Inc. X-Newsreader: Tin 1.1 PL5 Date: Wed, 14 Oct 1992 01:56:01 GMT Lines: 24