Bug report #1080

crash when loading GRASS vectors and rasters

Added by Paolo Cavallini almost 16 years ago. Updated over 14 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:GRASS
Affected QGIS version: Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11140

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/datigrass//Mondo_LatLong/leo/cellhd/carta_tempo' not
recognised as a supported file format.

then segfault

History

#1 Updated by leolami - almost 16 years ago

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

#2 Updated by Paolo Cavallini almost 16 years ago

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

#3 Updated by Jürgen Fischer almost 16 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

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 61e3fe93 (SVN r8477) 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.

#4 Updated by Anonymous over 14 years ago

Milestone Version 0.9.2 deleted

Also available in: Atom PDF