Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#6552 closed defect (fixed)

GDALGridCreate() hangs with NULL or GDALDummyProgress functions.

Reported by: Kyle Shannon Owned by: warmerdam
Priority: normal Milestone: 2.1.1
Component: Algorithms Version: 2.1.0
Severity: normal Keywords:
Cc:

Description

GDALGridCreate() hangs when the pfnProgress isn't the term progress. Happens in trunk.

Reproduction:

#include "gdal_alg.h"

int main() {

    double x[4] = {1, 2, 3, 4};
    double y[4] = {1, 2, 3, 4};
    double z[4] = {10, 20, 30, 40};
    double g[25];
    GDALDriverH hDrv = 0;
    GDALDatasetH hDS = 0;
    GDALRasterBandH hBand = 0;
    int rc = 0;
    GDALGridNearestNeighborOptions options;

    GDALAllRegister();

    memset(&options, 0, sizeof(options));
    options.dfNoDataValue = -1.0;
    /*
    ** Passing 0 as the pfnProgress also hangs (probably the same thing)
    ** Using GDALTermProgress runs fine.
    */
    rc = GDALGridCreate(GGA_NearestNeighbor, &options, 4, x, y, z, 0, 5, 0, 5,
                        5, 5, GDT_Float64, g, GDALDummyProgress, 0);
    if(rc == CE_None) {
        hDrv = GDALGetDriverByName("GTiff");
        hDS = GDALCreate(hDrv, "grid.tif", 5, 5, 1, GDT_Float64, 0);
        hBand = GDALGetRasterBand(hDS, 1);
        rc = GDALRasterIO(hBand, GF_Write, 0, 0, 5, 5, g, 5, 5, GDT_Float64, 0, 0);
        GDALFlushCache(hDS);
        GDALClose(hDS);
    }
    return rc;
}

Change History (2)

comment:1 Changed 17 months ago by Even Rouault

Milestone: 2.2.02.1.1
Resolution: fixed
Status: newclosed
Version: svn-trunk2.1.0

trunk r34392, branches/2.1 r34393 "GDALGridCreate(): fix hang in multi-threaded case when pfnProgress is NULL or GDALDummyProgress (#6552)"

comment:2 Changed 17 months ago by Kyle Shannon

Thanks Even.

Note: See TracTickets for help on using tickets.