[Qgis-developer] qgsrasterblock setcolor index out of range error message

Theuns Heydenrych theunsheydenrych at gmail.com
Thu Jun 18 08:00:43 PDT 2015


Hi List

The problem in the end was that I hit the 2Gig virtual memory address space
for a 32bit application. The application was build with debug libraries of
Qt and QGis, when fully loaded, the virtual memory was on 1.8Gig, and when
using the application, some of the GIS layers came on when zooming in, it
just crashed in the tiff layer. A weeks earlier, i saw that some of the
layers when zooming in just did not load, and that jobs was just removed
from the joblist when rendering. Jobs was removed due to the fact that a
QImage could not be allocated, for the layer, thus removed from the
joblist.
It was very misleading because according to the task manager, there was
still loads of memory for the task to create these QImages.

The solution for this was to make the application LARGEADDRESSAWARE , to do
this I have to build the application with the *-Wl,--large-address-aware*
linker option. (this is for MinGW, dont know what you have to use for MSVC
builds)
I also have to run "bcdedit /set IncreaseUserVA 3072" (without the quotes)
in a cmd prompt with administrator privileges, to get access to 3Gig of
virtual address space for my process, and allows me to run
the application in debug mode, without any crashes.

Here is link to the memory limits of windows
https://msdn.microsoft.com/en-us/library/windows/desktop/aa366778(v=vs.85).aspx


When building  my application and libraries and QGis with release versions
of the libraries, it performs well and there is no crashes.
The virtual memory for the process then comes in at 700 - 800mb

Regards
Theuns Heydenrych


On Mon, 15 Jun 2015 at 19:12 Theuns Heydenrych <theunsheydenrych at gmail.com>
wrote:

> HI
> I have written a Qt application using the QGis libraries.
> I have setup a QGis project in Qgis(downloaded version 2.6) itself, and
> loads the project from my application.
> In the project is a tiff raster image of 1.2Gig that have external
> pyramids created with QGis.
>
> While using the QGis project in my application by zooming in and out, I
> get the following error in the qgsrasterblock code. Its keep scrolling the
> following.
> *src\core\raster\qgsrasterblock.cpp: 381: (setColor) index  out of range*
>
>
> I have captured the output from where it starts with the error and pasted
> it on pastebin. http://pastebin.com/MUBd1Uq2
>
> What I have noticed is that on line no.8 the "item" is twice the size of
> the "img" is the correct, could this happen?
> *8: "src\gui\qgsmapcanvasmap.cpp: 52: (paint) map paint DIFFERENT: sIZE:
> img 1553,972  item 3106,1944"*
>
> After this on line no.47 the paint device returned no engine error.
> *47: "QPainter::begin: Paint device returned engine == 0, type: 3"*
>
> A bit further on, on line no.66 the "img" is 0,0 in width and height, and
> the "item" is the correct size (*1553,972*)
> *66: "src\gui\qgsmapcanvasmap.cpp: 52: (paint) map paint DIFFERENT: sIZE:
> img 0,0  item 1553,972"*
>
> After that on line no.122 it start to get index out of bounds errors, and
> the looks like the application is hanging.
>
> *122: src\core\raster\qgsrasterblock.cpp: 381: (setColor) index 0 out of
> range*
>
> Has anyone seen behaviour like this, so that I can have and idea where to
> look?
>
> Thank  you, in advance.
> Theuns Heydenrych
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150618/f64a738e/attachment-0001.html>


More information about the Qgis-developer mailing list