[QGIS-trac] Re: [Quantum GIS] #1900: Qgis crashes after closing a GRASS mapset and removing a GRASS layer from the legend

Quantum GIS qgis at qgis.org
Thu Jan 7 07:38:00 EST 2010


#1900: Qgis crashes after closing a GRASS mapset and removing a GRASS layer from
the legend
--------------------------------------------------------------+-------------
        Reporter:  lutra                                      |         Owner:  rugginoso    
            Type:  bug                                        |        Status:  closed       
        Priority:  critical: causes crash or data corruption  |     Milestone:  Version 1.5.0
       Component:  GRASS                                      |       Version:  HEAD         
      Resolution:  fixed                                      |      Keywords:               
Platform_version:                                             |      Platform:  All          
        Must_fix:  Yes                                        |   Status_info:  0            
--------------------------------------------------------------+-------------
Changes (by rblazek):

 * cc: rblazek (added)
  * status:  new => closed
  * resolution:  => fixed

Comment:

 There are 2 problems here:

 1) Bug in GDAL GRASS provider (http://trac.osgeo.org/gdal/ticket/3313), if
 MAPSET is unset, the next attempt to read GRASS raster data results in
 GRASS fatal error. I have written a patch for GDAL (waiting for approval)
 and temporal fix for QGIS in changeset:12687.

 2) Another proble is, how GRASS fatal errors are handled and that is quite
 interesting. It is possible to set a routine which handles GRASS errors
 with G_set_error_routine. The problem is, that both QGIS GRASS plugin and
 GDAL GRASS driver do it. GDAL sets Grass2CPLErrorHook while GRASS
 QgsGrass::error_routine. When an error happens in GDAL it does not call
 the Grass2CPLErrorHook but QgsGrass::error_routine because the routine was
 reset in the mean time by QGIS GRASS plugin. QgsGrass::error_routine
 throws QgsGrass::Exception but that is not caught by raster layer renderer
 (right, it is expecting error from GDAL) and thus qgis crashes. Isn't it
 nice!?

 I don't know how to solve this at moment, but I close this bug as 1) is
 resolved and I create a new ticket for 2) : #2347

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1900#comment:12>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list