Re: pfLinux memory weirdness

New Message Reply Date view Thread view Subject view Author view

From: Allan Schaffer (allan++at++sgi.com)
Date: 08/29/2000 14:05:47


[Quite an old message now, but finally figured it out]

On Jul 18, 10:55am, Paul John Rajlich wrote:
> I'm having problems deleting pfGeoSets in pfLinux. [...]
>
> for (int i=0; i<1000; i++) {
> cout << i << " ";
> cout.flush();
> pfGeoSet *g = pfdNewSphere(10000, pfGetSharedArena());
> geode->addGSet(g);
> geode->removeGSet(geode->getGSet(0));
> delete g;
> }

This turned out to be a pretty hard-to-find bug.

There's a reference-counting problem in the Linux version of Performer
[2.3, 2.3.1], where the 'unref' done in any pfMemory-derived object
doesn't actually decrement the reference count -- it hits another
field in the pfMemory header, yikes! So, the pfDelete() ends up
doing nothing since the object reference count never goes back down
to zero.

Luckily that other field being clobbered isn't used in the
single-process Performer codebase [2.3.x], so no corruption occurs
beyond a never-decremented refcount.

This is now fixed for the next version, 2.4, coming soon. :-)

Allan

-- 
Allan Schaffer                                            allan++at++sgi.com
Silicon Graphics                           http://reality.sgi.com/allan


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Aug 29 2000 - 14:05:53 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.