[gdal-dev] Nested recursion in RasterIO and IRasterIO

Andrew C Aitchison andrew at aitchison.me.uk
Wed Feb 24 06:44:23 PST 2021


This is because of a bug, or bugs in my driver code, so feel free to say 
"not interested", but if you think my experience could help others ...

I have written a driver (actually two) which supports read but not write
of overviews via GetOverviewCount() and GetOverview(int) (but not 
HasArbitraryOverviews()). I believe I have failed to distinguish between
overview rasterbands and the full-scale bands.

As a result of this, I can get into a position where GetOverviewCount and
GetOverview are called on an overview band. When I try to run 
gdal_translate to shrink one of my images and convert to (say) tiff,
my return values from these routines ended up with RasterIO and IRasterIO
calling each other until the stack runs out of memory - the gdb stack 
strace shows me nearly 30000 functions deep.

When I first looked at this some weeks ago I thought that I saw
a mutex or similar being optimized out by clang++, but I am not sure.

Is anyone interested in a (partial?) stacktrace or other debugging
to track down and stop RasterIO and IRasterIO from calling each other to 
death ?

Thanks,

-- 
Andrew C. Aitchison					Kendal, UK
 			andrew at aitchison.me.uk


More information about the gdal-dev mailing list