Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#2300 closed defect (fixed)

Thin Plate Spline Initialization Error

Reported by: warmerdam Owned by: warmerdam
Priority: high Milestone: 1.4.5
Component: GDAL_Raster Version: svn-trunk
Severity: major Keywords: tps thinplatespline
Cc:

Description

In some circumstances I was getting erroneous results from the gdaltransform commandline program when using the thin plate spline algorithm. Review with valgrind indicated use of uninitialized values which I traced to rhs[0][2] in alg/thinplatespline.cpp.

A careful review of the lifespan of rhs[] seems to indicate that values rhs[][0-2] are never actually set, but are used when evaluating equations.

A modification to VizGeorefSpline2D::grow_points() to initialize these values to zero seemed to correct the results and fix the uninitialized memory error. I *suspect* that rhs used to be guaranteed initialized to zero (perhaps using new) but this was lost in the conversion to use VSIMalloc(). I have not tried to confirm this with a deeper analysis.

I *suspect* this is at the core of our very unreliable thin plate spline results.

Change History (2)

comment:1 by warmerdam, 16 years ago

Priority: normalhigh
Resolution: fixed
Severity: normalmajor
Status: newclosed

Patch applied in trunk (r14117), 1.5 (r14118) and 1.4 (r14119) branches.

I'm closing, but comments indicating if this resolves older TPS stability problems would be appreciated.

comment:2 by hamish, 15 years ago

This seems to have had a positive effect on bug #864.

i.e. I get segfaults with gdalwarp 1.5.0, but not with the latest SVN/trunk.

hooray!

thanks, Hamish

Note: See TracTickets for help on using tickets.