Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#3871 closed defect (fixed)

GDALGetOpenDatasets broken (1.7 and 1.8dev)

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords:


The method GDALDataset::GetOpenDatasets?() is broken and returns a list of pointers to things that are *not* datasets. This bug was discovered in GDAL svn trunk and it also appears to exist in 1.7.

Change History (4)

comment:1 Changed 10 years ago by warmerdam

Resolution: fixed
Status: newclosed

Corrected in trunk (r21209) and 1.7 branch (r21210).

Basically I assume this function has been completely broken since things were reworked to use a hash list for the open dataset list. It is rarely used and so apparently no one has noticed.

comment:2 Changed 10 years ago by Even Rouault

Actually, since the dataset handle was inserted into a hashlist at the time of GDAL 1.6.0. But to fix #2897, the dataset handle was not any longer inserted, but it was a structure instead (r16616). I realized a bit later that it broke GDALDumpOpenSharedDataset(), which was fixed in 16983. But I didn't realize that GDALDataset::GetOpenDatasets?() was affected (as I think it isn't used by any GDAL utility, I didn't notice...) So GDAL 1.6.X where X >=1 is also affected and your fix would be theoretically necessary there too.

After closer review of all use of phAllDatasetSet in gdaldataset.cpp, after your fix, I'm pretty confident we're OK as far as the use of phAllDatasetSet is concerned.

comment:3 Changed 10 years ago by warmerdam

Thanks Even - fix backported to 1.6 branch (r21212).

comment:4 Changed 7 years ago by Even Rouault

Milestone: 1.7.4

Milestone 1.7.4 deleted

Note: See TracTickets for help on using tickets.