[fdo-trac] #214: Crash possible from stale pointer in FdoGeometry object

FDO trac_fdo at osgeo.org
Wed Jan 9 15:01:29 EST 2008


#214: Crash possible from stale pointer in FdoGeometry object
---------------------------+------------------------------------------------
   Reporter:  gavincramer  |       Owner:  gavincramer
       Type:  defect       |      Status:  new        
   Priority:  major        |   Milestone:  3.3.0      
  Component:  FDO API      |     Version:  3.3.0      
   Severity:  2            |    Keywords:             
External_id:               |  
---------------------------+------------------------------------------------
 Create a geometry object that inherits from FdoIGeometry (e.g.
 FdoILineString).  Do not release the geometry object, but initiate
 shutting down the thread.  Then release the geometry object.  There may be
 a crash.  It is very rare, but can happen.

 This occurs because the geometry object has a lightweight pointer to the
 geometry factory that created it.  This pointer is supposed to be NULL
 under normal circumstances.  It should only be non-NULL when calling code
 specifically asks for a factory with a private object pool.  However, the
 non-NULL case is always in effect.  The default factory, in thread-local-
 storage, could be released first during thread shut-down.

 This is a straightforward coding oversight.  When there is no private
 object pool, the geometry objects should have no connection to a factory.
 The "Create..." methods in FdoFgfGeometryFactory need to be changed to
 pass NULL instead of 'this' when there is no private object pool.  Some
 geometry object code also has obsolete NULL checks that need to be
 removed, since NULL is a valid value.

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/214>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list