Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2078 closed bug (fixed)

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

Reported by: pcav Owned by: rugginoso
Priority: critical: causes crash or data corruption Milestone: Version 1.5.0
Component: GRASS Version: Trunk
Keywords: Cc: rblazek
Must Fix for Release: No Platform: Windows
Platform Version: Awaiting user input: no

Description

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

Change History (19)

comment:1 by lutra, 14 years ago

confirmed in r12280

comment:2 by lutra, 14 years ago

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

comment:3 by lutra, 14 years ago

Cc: rblazek added

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

[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\plugins\grass\qgsgrassselect.cpp(34) : (QgsGrassSelect::QgsGrassSelect) QgsGrassSelect() type = 2
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\plugins\grass\qgsgrassselect.cpp(203) : (QgsGrassSelect::setMapsets) setMapsets()
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\plugins\grass\qgsgrassselect.cpp(245) : (QgsGrassSelect::setMaps) setMaps()
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\providers\grass\qgsgrass.cpp(759) : (QgsGrass::rasters) entered.
[2744] 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
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\plugins\grass\qgsgrassselect.cpp(340) : (QgsGrassSelect::setLayers) setLayers()
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\plugins\grass\qgsgrassselect.cpp(203) : (QgsGrassSelect::setMapsets) setMapsets()
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\plugins\grass\qgsgrassselect.cpp(245) : (QgsGrassSelect::setMaps) setMaps()
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\providers\grass\qgsgrass.cpp(759) : (QgsGrass::rasters) entered.
[2744] 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
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\plugins\grass\qgsgrassselect.cpp(340) : (QgsGrassSelect::setLayers) setLayers()
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\plugins\grass\qgsgrassselect.cpp(340) : (QgsGrassSelect::setLayers) setLayers()
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\core\qgsmaplayer.cpp(55) : (QgsMapLayer::QgsMapLayer) lyrname is 'teste'
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\core\qgsmaplayer.cpp(61) : (QgsMapLayer::QgsMapLayer) layerName is 'teste'
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\core\raster\qgsrastershader.cpp(25) : (QgsRasterShader::QgsRasterShader) called.
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\core\raster\qgsrastershaderfunction.cpp(24) : (QgsRasterShaderFunction::QgsRasterShaderFunction) entered.
[2744] d:\progs\c\qgis-build\src\qgis\qgis_unstable\src\core\qgsmaplayer.cpp(106) : (QgsMapLayer::setLayerName) new name is 'teste'

comment:4 by rblazek, 14 years ago

Please check with new data provider in trunk r12880 .

comment:5 by lutra, 14 years ago

Tested r12883 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.

in reply to:  5 comment:6 by rblazek, 14 years ago

Replying to lutra:

Tested r12883 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 r12885.

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 r12886.

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.

comment:7 by rblazek, 14 years ago

I have got working an old PC with XP today, I have downloaded fresh nightly build r12883 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?

comment:8 by lutra, 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

comment:9 by lutra, 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.

comment:10 by lutra, 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.

in reply to:  9 ; comment:11 by rblazek, 14 years ago

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

in reply to:  11 ; comment:12 by lutra, 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.

in reply to:  12 comment:13 by rblazek, 14 years ago

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

comment:14 by lutra, 14 years ago

Hi, I just updated to r12891. 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.

comment:15 by rblazek, 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

in reply to:  15 ; comment:16 by lutra, 14 years ago

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

comment:17 by lutra, 14 years ago

Resolution: fixed
Status: newclosed

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.

in reply to:  16 comment:18 by lutra, 14 years ago

Replying to lutra:

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

comment:19 by lutra, 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.

Note: See TracTickets for help on using tickets.