[mapguide-trac] #1961: MgServer crashes by previewing a layer from a Raster data connection without CS specified

MapGuide Open Source trac_mapguide at osgeo.org
Thu Mar 8 21:20:31 EST 2012


#1961: MgServer crashes by previewing a layer from a Raster data connection
without CS specified
-----------------------+----------------------------------------------------
   Reporter:  wuma     |       Owner:  wuma 
       Type:  defect   |      Status:  new  
   Priority:  high     |   Milestone:  2.4  
  Component:  Server   |     Version:  2.1.0
   Severity:  major    |    Keywords:       
External_id:  1451912  |  
-----------------------+----------------------------------------------------

Comment(by wuma):

 Following line is executed in StylizeLayers() function:
 {{{
 STRING layerWkt = layerCs->ToString();
 }}}
 '''{{{layerCs}}}''' will be '''{{{NULL}}}''' if there is no CS or CS
 override specified for the feature source. Then '''{{{NULL}}}''' pointer
 exception will happen in above line. On Windows, there is a macro
 '''{{{MG_CATCH_AND_RELEASE()}}}''' to catch this exception and simply
 continue the logic.
 {{{
 #define MG_CATCH_AND_RELEASE() \
 } \
 catch (MgException* e) \
 { \
 mgException = e; \
 } \
 catch (...) \
 { \
 }
 }}}
 However, on Linux, '''{{{NULL}}}''' pointer will lead to Segmentation
 Fault, which cannot be caught by '''{{{catch (...)}}}''' and will crash
 the application directly. So the pointer has to be verified before calling
 any methods of the pointer to avoid Segmentation Fault crash on Linux

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


More information about the mapguide-trac mailing list