Skip to content

Commit

Permalink
[gdal] Add upstream TIFF fix (microsoft#34586)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored Oct 19, 2023
1 parent 85f2afa commit ff8e58c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions ports/gdal/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
fix-gdal-target-interfaces.patch
libkml.patch
fix-jpeg.patch
upstream-b5858ed.diff
)
# `vcpkg clean` stumbles over one subdir
file(REMOVE_RECURSE "${SOURCE_PATH}/autotest")
Expand Down
21 changes: 21 additions & 0 deletions ports/gdal/upstream-b5858ed.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/frmts/gtiff/geotiff.cpp b/frmts/gtiff/geotiff.cpp
index ed79c0972e0..33846d66513 100644
--- a/frmts/gtiff/geotiff.cpp
+++ b/frmts/gtiff/geotiff.cpp
@@ -2886,8 +2886,16 @@ static void ThreadDecompressionFunc(void *pData)
psJob->nXBlock, psJob->nYBlock);
if (apoBlocks[i] == nullptr)
{
+ // Temporary disabling of dirty block fushing, otherwise
+ // we can be in a deadlock situation, where the
+ // GTiffDataset::SubmitCompressionJob() method waits for jobs
+ // to be finished, that can't finish (actually be started)
+ // because this task and its siblings are taking all the
+ // available workers allowed by the global thread pool.
+ GDALRasterBlock::EnterDisableDirtyBlockFlush();
apoBlocks[i] = poDS->GetRasterBand(iBand)->GetLockedBlockRef(
psJob->nXBlock, psJob->nYBlock, TRUE);
+ GDALRasterBlock::LeaveDisableDirtyBlockFlush();
if (apoBlocks[i] == nullptr)
return false;
}
1 change: 1 addition & 0 deletions ports/gdal/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "gdal",
"version-semver": "3.7.2",
"port-version": 1,
"description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data",
"homepage": "https://gdal.org",
"license": null,
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2830,7 +2830,7 @@
},
"gdal": {
"baseline": "3.7.2",
"port-version": 0
"port-version": 1
},
"gdcm": {
"baseline": "3.0.22",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gdal.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3931fc54de192cbee6b4683bc2261b2f3093130f",
"version-semver": "3.7.2",
"port-version": 1
},
{
"git-tree": "d01864aaa21a85e1e8f7bb6748d607e953c52e77",
"version-semver": "3.7.2",
Expand Down

0 comments on commit ff8e58c

Please sign in to comment.