[QGIS-trac] Re: [Quantum GIS] #1080: crash when loading GRASS vectors and rasters

Quantum GIS qgis at qgis.org
Wed May 21 16:39:56 EDT 2008


#1080: crash when loading GRASS vectors and rasters
--------------------------------------------------------------+-------------
        Reporter:  pcav                                       |         Owner:  nobody       
            Type:  bug                                        |        Status:  closed       
        Priority:  critical: causes crash or data corruption  |     Milestone:  Version 0.9.2
       Component:  GRASS                                      |       Version:  HEAD         
      Resolution:  fixed                                      |      Keywords:               
Platform_version:                                             |      Platform:  Debian       
        Must_fix:  No                                         |   Status_info:  0            
--------------------------------------------------------------+-------------
Changes (by jef):

  * status:  new => closed
  * resolution:  => fixed

Comment:

 Replying to [comment:2 pcav]:
 > This may be related to locale: in LOCALE=it_IT, points are replaced with
 > commas in the description of projections, thus qgis does not understand
 the
 > projections, and grass plugin crashes.  exporting LANG=C solves the
 problem.
 > Apparently the same as https://trac.osgeo.org/qgis/ticket/1079

 This diagnosis isn't quite right.  The GRASS libraries QGIS uses are not
 locale
 aware.  GRASS uses standard C library functions to parse numbers in
 strings,
 although these functions expect to see commas for certain locales (like
 it_IT
 and de_DE).

 But the GRASS files contain dots (e.g. for the default window) and
 therefore
 the parsing fails.  This lead to a fatal GRASS error which was not catched
 by
 the setjmp/longjmp trick and therefore caused the "crash" (the GRASS
 routines
 terminated the process).

 I addressed this in r8476 by setting the locale to "C" before calling the
 GRASS
 function to retrieve the SRS.  This should fix this bug, but there are
 probably
 much more places where GRASS functions should be called with locale "C"
 because
 the outerwise break. Maybe we need to wrap each and every GRASS call that
 way.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1080#comment:3>
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