[Qgis-developer] Re: Segmentation fault while reading raster maps

JJL buggerone at gmail.com
Thu Feb 12 17:17:10 EST 2009


Hello,

First, thanks for answering.

2009/2/12 Peter Ersts <ersts at amnh.org>:
>
> Howdy JJL.
>
> mColorShadingAlgorithm is an enum so it will always be initialized. Your
> suggested fix works because you have effectively just "turned off" shading.
Hum, sounds quite strange to me. If I dump the value of
mColorShadingAlgorithm at the beginning of setColorShadingAlgorithm, I
have 0 or very weird values (see attached txt file) Just before the
crash, its value is 3, the same as theShadingAlgorithm
Also the attached c++ code give me strange results.
But I'm not a C++ developer, only a C one. So I'm really lost with all
this C++ stuff (and qgis is huge). Surely I missed something.

> The little code snipped you sent in the previous message seems to work fine
> with valid rasters, three band as well as paletted.
I do not have the crash every run of the test. I have to read many
times the same file. When I found the "right" number of reading for a
file, it always crashes.

> I am inclined to believe that the problem has to do with your data being
> recognized as a paletted image, but the color table is missing, which we
> should be able to gracefully deal with no matter. Any chance that  one of
> your layers has a .qml associated with it?
No I only have the .kap files.
Maybe you can find more details in the full debug output (qgis 1.0 in
ubuntu) available here :
http://kubuntu.free.fr/tmp/qgis_debug.gz

> If you possible, could you send me a link to where I could get a copy of one
> of your images that is causing the segfaults?
Yes, as they're not freely available, I send you the link in a private mail.
I also have the same crash with kap files from NOAA, for example :
python testRead.py testmaps/11009_1.KAP testmaps/11009_1.KAP
testmaps/11009_1.KAP testmaps/11009_1.KAP testmaps/11009_1.KAP

best regards
JJL

-- 
http://kubuntu.free.fr/blog
-------------- next part --------------
# QGIS trunk with debug symbols
# QgsDebugMsg call at the begining of setColorShadingAlgorithm has been modified to dump also mColorShadingAlgorithm
# QgsDebugMsg( "called with [" + QString::number( theShadingAlgorithm ) + "] mColorShadingAlgorithm="+ QString::number( mColorShadingAlgorithm )  );
# in qgis I use my rasterCatalog plugin and click 2 times on "Start scan"
# this will create 4 QgsRatserLayer on 4 files
Debug: /tmp/qgis_unstable/src/core/raster/qgsrasterlayer.cpp: 3158: (setColorShadingAlgorithm) called with [3] mColorShadingAlgorithm=1633906287
Debug: /tmp/qgis_unstable/src/core/raster/qgsrasterlayer.cpp: 3158: (setColorShadingAlgorithm) called with [3] mColorShadingAlgorithm=1885958755
Debug: /tmp/qgis_unstable/src/core/raster/qgsrasterlayer.cpp: 3158: (setColorShadingAlgorithm) called with [3] mColorShadingAlgorithm=146991392
Debug: /tmp/qgis_unstable/src/core/raster/qgsrasterlayer.cpp: 3158: (setColorShadingAlgorithm) called with [3] mColorShadingAlgorithm=1885958755
# second click on Start Scan
Debug: /tmp/qgis_unstable/src/core/raster/qgsrasterlayer.cpp: 3158: (setColorShadingAlgorithm) called with [3] mColorShadingAlgorithm=0
Debug: /tmp/qgis_unstable/src/core/raster/qgsrasterlayer.cpp: 3158: (setColorShadingAlgorithm) called with [3] mColorShadingAlgorithm=1885958755
Debug: /tmp/qgis_unstable/src/core/raster/qgsrasterlayer.cpp: 3158: (setColorShadingAlgorithm) called with [3] mColorShadingAlgorithm=3
## here happend the segmentation fault
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testEnum.cpp
Type: text/x-c++src
Size: 475 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090212/2c514fa1/testEnum.bin


More information about the Qgis-developer mailing list