[gdal-dev] OpenJPEG2000 issues when reading blocks at a time

Even Rouault even.rouault at mines-paris.org
Wed Jun 22 09:03:13 EDT 2011


Le mardi 14 juin 2011 16:49:58, Cole, Derek a écrit :

Derek,

I'm not sure how you have implemented your multi-threading code, but you 
should never call the GDAL API on the same dataset/raster bands handle from 
several threads. This is true for all GDAL drivers.

If you want to do multi-threading, you have to open a distinct dataset 
(possibly on the same file) for each thread. See 
http://gdal.org/gdal_8h.html#e97be045eb4701183ad332ffce29745b

Best regards,

Even

> Sorry to spam the list, but I am wondering if this is related to the
> threading perhaps? I have tried to run this identical code in a
> single-threaded fashion, and it seems to work OK. Does the library perhaps
> have something going on that is signaling the file has been read
> prematurely? I have watchers that are waiting on a finished signal, which
> I have tested that they are (and this works for a non-compressed image).
> Most of the image tiles are coming back zeros, which makes me think it is
> somehow initializing some memory, and signaling it is done before the
> arrays have actually been populated?
> 
> Derek
> ________________________________
> From: gdal-dev-bounces at lists.osgeo.org [gdal-dev-bounces at lists.osgeo.org]
> on behalf of Cole, Derek [dcole at integrity-apps.com] Sent: Tuesday, June
> 14, 2011 10:28 AM
> To: Chaitanya kumar CH
> Cc: gdal-dev at lists.osgeo.org
> Subject: RE: [gdal-dev] OpenJPEG2000 issues when reading blocks at a time
> 
> I am afraid I won't be able to post a screenshot, or the original image
> that is causing this issue.
> 
> I will also note, occaisionally the image fails to load at all, and I get a
> dump like this:
> 
> ERROR 1: Marker is not compliant with its position
> 
> ERROR 1: opj_read_header() failed
> ERROR 1: IReadBlock failed at X offset 1, Y offset 0
> ERROR 1: GetBlockRef failed at X block offset 1, Y block offset 0
> Segmentation Fault
> 
> 
> Googling for those error message reveals about 2 results, and this email
> thread is one of them =\ ________________________________
> From: Chaitanya kumar CH [chaitanya.ch at gmail.com]
> Sent: Monday, June 13, 2011 11:13 PM
> To: Cole, Derek
> Cc: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] OpenJPEG2000 issues when reading blocks at a time
> 
> Derek,
> 
> Can you provide a screenshot of the displayed image. Especially the
> scrambled blocks.


More information about the gdal-dev mailing list