[mapguide-trac] #462: Server Crash and Unresponsive using OSGeo.Gdal FDO provider

MapGuide Open Source trac_mapguide at osgeo.org
Fri Mar 27 03:03:42 EDT 2009


#462: Server Crash and Unresponsive using OSGeo.Gdal FDO provider
----------------------+-----------------------------------------------------
 Reporter:  zspitzer  |         Owner:          
     Type:  defect    |        Status:  reopened
 Priority:  medium    |     Milestone:  2.0     
Component:  General   |       Version:  2.0.2   
 Severity:  blocker   |    Resolution:          
 Keywords:            |   External_id:          
----------------------+-----------------------------------------------------
Comment (by jbirch):

 There are (at least) three problems with raster in 2.0.2.

 The first is a memory leak that has since been fixed in 2.1.

 The second is (my non-technical description) writing to unallocated
 memory. (see [attachment:ticket:462:mapguide_raster_unalloc.5.patch
 mapguide_raster_unalloc.5.patch])

 The third is a defect in the way that !MapGuide deals with single-threaded
 providers.  The attachment
 [attachment:ticket:462:mapguide_raster_stability.patch
 mapguide_raster_stability.patch] provides a workaround for this defect in
 conjunction with the GDAL provider.

 However, this could conceptually happen with other providers.  Haris is
 looking into the problem more in depth, but in the meantime explained the
 problem to me as follows, referencing the code around
 [/mapguide/browser/trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp#L660
 Line 660 of MappingUtil.cpp] :

 Assume two Raster layers accessed at same time.

  1. Raster connection to Layer 1 created
  1. !ExecuteRasterQuery executed, class Georaster created which keeps
 pointer to connection ( not adding ref count)
  1. That threads goes into Stylize Layers
  1. Second thread goes into !ExecuteRasterQuery, but is accessing another
 raster layer so can't use the same connection
  1. Second thread creates new connection to raster provider, but because
 the pool size for single-threaded providers is limited to 1 (and also
 because gdal provider didn't ref count++) the connection manager deletes
 the first thread's connection
  1. First thread which now in !StylizeGridLayer finds that its connection
 was deleted and the pointer is gone

 Result:  Exception and corrupted memory

-- 
Ticket URL: <https://trac.osgeo.org/mapguide/ticket/462#comment:15>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list