Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#1080 closed bug (fixed)

crash when loading GRASS vectors and rasters

Reported by: pcav Owned by: nobody
Priority: critical: causes crash or data corruption Milestone:
Component: GRASS Version: Trunk
Keywords: Cc: lami@…, msieczka
Must Fix for Release: Yes Platform: Linux
Platform Version: Awaiting user input: no

Description

I'm unable to load GRASS raster or vectors (0.10 from debian.gfoss.it). This seems related to the proj k problem pointed out by Maciek. Seems a major bug, as GRASS is unusable with all projections with a k parameter (and more). All the best. pc ============================ VECTORS

error_routine (fatal = 0): Unable to initialise PROJ.4 with the following parameter list: +proj=tmerc +lat_0=0 +lon_0=9 +k=0.999600 +x_0=1500000 +y_0=0 +no_defs +a=6378388 +b=6378388 error_routine (fatal = 0): The error message: k <= 0 error_routine (fatal = 0): Can't parse GRASS PROJ_INFO file Critical: QgsSpatialRefSys::createFromWkt -- theWkt is uninitialised, operation failed Warning: No valid projection. Unable to set map units. Raster Algebra: renderTest called! QgsGrass::vectors() QgsGrass::vectors() QgsGrass::vectors() error_routine (fatal = 1): default region is invalid line 4: <south: -28513.88928299> Cannot open GRASS vector: default region is invalid line 4: <south: -28513.88928299>

then segfault ============================ RASTERS

Warning: QgsSpatialRefSys::getRecord failed : select * from tbl_srs where parameters='+proj=longlat +a=6378137 +b=6356733.855704698 +towgs84=0.000,0.000,0.000 +no_defs' Warning: QgsSpatialRefSys::findMatchingProj will only work if prj acr ellipsoid acr and proj4string are set!... Warning: No valid projection. Unable to set map units. Warning: QPainter::begin: Painter already active Warning: QPainter::begin: Painter already active Warning: QPainter::begin: Painter already active Raster Algebra: renderTest called! QgsGrassPlugin::addRaster QgsGrass::rasters() QgsGrass::rasters() QgsGrass::rasters() ERROR 4: `/home/Documenti/datigrassMondo_LatLong/leo/cellhd/carta_tempo' not recognised as a supported file format.

then segfault

Change History (5)

comment:1 by leolami, 15 years ago

Cc: lami@… added
Milestone: Version 1.0

I tried it in QGIS 0.10 for Windows build by Marco Pasetti and it works fine. I thin the gdal version is the same, rigth? Any other ideas?

Leonardo

comment:2 by pcav, 15 years ago

Milestone: Version 1.0Version 0.9.2

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

in reply to:  2 comment:3 by jef, 15 years ago

Resolution: fixed
Status: newclosed

Replying to 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.

comment:4 by msieczka, 15 years ago

Cc: msieczka added
Must Fix for Release: NoYes
Platform: DebianLinux

comment:5 by (none), 13 years ago

Milestone: Version 0.9.2

Milestone Version 0.9.2 deleted

Note: See TracTickets for help on using tickets.