Bug report #2078

[Windows] adding a GRASS raster created with r.external crashes QGIS

Added by Paolo Cavallini over 14 years ago. Updated about 14 years ago.

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

Description

In r 12078, windows XP only (in deb all ok)

History

#1 Updated by Giovanni Manghi over 14 years ago

confirmed in 29ca1a23 (SVN r12281)

#2 Updated by Giovanni Manghi over 14 years ago

I created a GRASS raster using r.external pointing to the raster available in the qgis sample dataset. Called it "teste". Under windows xp qgis crashes when adding it. The output returned by DebugView for Windows is the following

 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\plugins\\grass\\qgsgrassselect.cpp(34) : (QgsGrassSelect::QgsGrassSelect) [[QgsGrassSelect]]() type = 2
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\plugins\\grass\\qgsgrassselect.cpp(203) : (QgsGrassSelect::setMapsets) setMapsets()
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\plugins\\grass\\qgsgrassselect.cpp(245) : (QgsGrassSelect::setMaps) setMaps()
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\providers\\grass\\qgsgrass.cpp(759) : (QgsGrass::rasters) entered.
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\providers\\grass\\qgsgrass.cpp(796) : (QgsGrass::rasters) mapsetPath = C:/Documents and Settings/Gio/Desktop/qgis_sample_data/qgis_sample_data/grassdata/alaska/demo
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\plugins\\grass\\qgsgrassselect.cpp(340) : (QgsGrassSelect::setLayers) setLayers()
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\plugins\\grass\\qgsgrassselect.cpp(203) : (QgsGrassSelect::setMapsets) setMapsets()
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\plugins\\grass\\qgsgrassselect.cpp(245) : (QgsGrassSelect::setMaps) setMaps()
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\providers\\grass\\qgsgrass.cpp(759) : (QgsGrass::rasters) entered.
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\providers\\grass\\qgsgrass.cpp(796) : (QgsGrass::rasters) mapsetPath = C:/Documents and Settings/Gio/Desktop/qgis_sample_data/qgis_sample_data/grassdata/alaska/demo
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\plugins\\grass\\qgsgrassselect.cpp(340) : (QgsGrassSelect::setLayers) setLayers()
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\plugins\\grass\\qgsgrassselect.cpp(340) : (QgsGrassSelect::setLayers) setLayers()
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\core\\qgsmaplayer.cpp(55) : (QgsMapLayer::QgsMapLayer) lyrname is 'teste'
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\core\\qgsmaplayer.cpp(61) : (QgsMapLayer::QgsMapLayer) layerName is 'teste'
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\core\
aster\\qgsrastershader.cpp(25) : (QgsRasterShader::QgsRasterShader) called.
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\core\
aster\\qgsrastershaderfunction.cpp(24) : (QgsRasterShaderFunction::QgsRasterShaderFunction) entered.
 d:\\progs\\c\\qgis-build\\src\\qgis\\qgis_unstable\\src\\core\\qgsmaplayer.cpp(106) : (QgsMapLayer::setLayerName) new name is 'teste'

#3 Updated by Redmine Admin about 14 years ago

Please check with new data provider in trunk 728ecc69 (SVN r12881) .

#4 Updated by Giovanni Manghi about 14 years ago

Tested under XP and still crashes.

The curios thing is that qgis crashes if you try add the raster from the grass browser but doesn't crash if you add the raster from the qgis grass toolbar. Nevertheless the raster doesn't show correctly and qgis shows the following message:

Cannot draw raster
Cannot start module
command: C:/OSGeo4W/apps/qgis-dev/./grass/modules/qgis.d.rast.exe map=teste1@demo window=-7.1176e+06,1.33306e+06,4.89704e+06,7.80968e+06,1170,631<br><br>ERRO:Unable to locate symbol <GDALAllRegister>

The resulting raster is all grey and in the properties shows no color bands.

As raster to test I used the one in the qgis demo dataset.

#5 Updated by Redmine Admin about 14 years ago

Replying to [comment:5 lutra]:

Tested under XP and still crashes.

Thanks for testing.

The curios thing is that qgis crashes if you try add the raster from the grass browser but doesn't crash if you add the raster from the qgis grass toolbar.

That is OK, I just forgot to use the new driver also in browser and module, fixed in a132e79d (SVN r12886).

Nevertheless the raster doesn't show correctly and qgis shows the following message:

> Cannot draw raster
> Cannot start module
> command: C:/OSGeo4W/apps/qgis-dev/./grass/modules/qgis.d.rast.exe map=teste1@demo window=-7.1176e+06,1.33306e+06,4.89704e+06,7.80968e+06,1170,631<br><br>ERRO:Unable to locate symbol <GDALAllRegister>

It seems that GRASS libs are compiled with GDAL but the module qgis.d.rast.exe was not compiled with GDAL libs. I have added GDAL_LIBRARY into CMakeLists.txt in 8ed95c64 (SVN r12887).

The resulting raster is all grey and in the properties shows no color bands.

It just draws the gray rectangle if the GRASS module fails.

No we have to wait until tomorrow for the new build.

#6 Updated by Redmine Admin about 14 years ago

I have got working an old PC with XP today, I have downloaded fresh nightly build via osgeo4w and it works!

Lutra, are you sure your installation is not broken? Maybe qgis-dev was built with newer version of libs? Could you try to reinstall from scratch?

#7 Updated by Giovanni Manghi about 14 years ago

Hi,

I'm putting together several notes about the results of your last commits. I'll check this ticket again in the next minutes and then I'll leave further feedback.

Thanks in advance

#8 Updated by Giovanni Manghi about 14 years ago

Hi again,

under xp I removed, cleaned and reinstalled everything. In my case the result is the same as above, and so is under Vista 32bit (I made a fresh install of the OS).

In both cases the windows OS are installed in virtual machines.

To test I used the "landcover.img" raster in the qgis demo dataset.

Under linux is ok.

#9 Updated by Giovanni Manghi about 14 years ago

PS
I'm available to further tests as many times as necessary, but I will need a little insight about Dbgview.exe in order to produce outputs that can help solve this problems.

#10 Updated by Redmine Admin about 14 years ago

Replying to [comment:9 lutra]:

To test I used the "landcover.img" raster in the qgis demo dataset.

landcover.img? Aren't we talking about GRASS? I am testing with gtopo30 from demo mapset in alaska GRASS location from demo dataset.

PS I'm available to further tests as many times as necessary, but I will need a little insight about Dbgview.exe in order to produce outputs that can help solve this problems.

You can try to just get working the C:/OSGeo4W/apps/qgis-dev/grass/modules/qgis.d.rast.exe from GRASS shell and check with something like ldd and nm for Windows why GDALAllRegister cannot be found.

#11 Updated by Giovanni Manghi about 14 years ago

landcover.img? Aren't we talking about GRASS? I am testing with gtopo30 from demo mapset in alaska GRASS location from demo dataset.

Yes, I'm just importing the image in a mapset with r.in. By the way is the same raster you find in mapset in the qgis demo dataset. By the way the results (for me) are the same when using directly the data inside the mapset of the qgis demo dataset.

I'll try to do what you suggest and the report back.

In any case as for you is working I would suggest to test some other windows installation, maybe are just mine that are giving problems.

#12 Updated by Redmine Admin about 14 years ago

Replying to [comment:12 lutra]:

Sorry, I have overlooked we are in r.external bug, there were many tickets about GRASS rasters. I thought that even native GRASS rasters don't work.

I have inspected qgis.d.rast.exe with dependency walker and it indeed does not depend on gdal, so if the map needs to read external data via GDAL it obviously fails.

Let us wait until tomorrow to see if the change in CMakeLists.txt helped.

#13 Updated by Giovanni Manghi about 14 years ago

Hi, I just updated to 4be3de4b (SVN r12892). As expected now there is no more crash when adding a raster created with r.external. Nevertheless I'm always getting qgis warnings like

Cannot draw raster
Cannot start module
command: C:/OSGeo4W/apps/qgis-dev/./grass/modules/qgis.d.rast.exe map=land@demo window=-7.1176e+06,1.32961e+06,4.89704e+06,7.80968e+06,1184,639<br><br>
GRASS_INFO_ERROR(2864,1): Unable to locate symbol <GDALAllRegister>
GRASS_INFO_END(2864,1)
Cannot query raster 
Cannot start module
command: C:/OSGeo4W/apps/qgis-dev/./grass/modules/qgis.g.info.exe info=query rast=land@demo coor=-3.89397e+06,5.61803e+06<br><br>
GRASS_INFO_ERROR(1596,1): Unable to locate symbol <GDALAllRegister>
GRASS_INFO_END(1596,1)

on both XP and Vista, and the raster is rendered all grey with no color bands. Always using "landcover.img" as test image.

#14 Updated by Redmine Admin about 14 years ago

I have got the same error with GRASS / OSGeo4W. So please, fill first a bug report for GRASS project and once it is working in GRASS / OSGeo4W and not in QGIS / OSGeo4W make a new comment here.

It is most probably also the reason why it was crashing QGIS when loaded via GDAL, but there could be other problems with circular reference, GDAL was reading data from GRASS which was reading data through GDAL: QGIS->GDAL->GRASS->GDAL->data

#15 Updated by Giovanni Manghi about 14 years ago

Replying to [comment:15 rblazek]:

I have got the same error with GRASS / OSGeo4W. So please, fill first a bug report for GRASS project and once it is working in GRASS / OSGeo4W and not in QGIS / OSGeo4W make a new comment here.

done

https://trac.osgeo.org/grass/ticket/913

#16 Updated by Giovanni Manghi about 14 years ago

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

Closing as the bug that crashed qgis is fixed and the following one (see comment 14) is not in qgis but seems to be in GRASS for windows (both osgeo4w packages and standalone installer).

See
https://trac.osgeo.org/grass/ticket/913

reopen if necessary.

#17 Updated by Giovanni Manghi about 14 years ago

Replying to [comment:16 lutra]:

Replying to [comment:15 rblazek]:

I have got the same error with GRASS / OSGeo4W. So please, fill first a bug report for GRASS project and once it is working in GRASS / OSGeo4W and not in QGIS / OSGeo4W make a new comment here.

done

https://trac.osgeo.org/grass/ticket/913

see also

https://trac.osgeo.org/grass/ticket/885

#18 Updated by Giovanni Manghi about 14 years ago

O, I noticed that today GRASS was updated in the osgeo4w installer. I then tested r.external and all seems to works fine now.

Also available in: Atom PDF