Grdimage aborted due to: double free or corruption (out)

Hello,

I am trying to plot a geotiff using grdimage that I produced in matlab. The command I am running is:

gmt grdimage geotiff.geo.tif -Q -Cvel.cpt -V

However, I keep receiving the following (in verbose mode):

grdimage [INFORMATION]: File geotiff.geo.tif reads with GDAL driver GTiff
grdimage [INFORMATION]: Round-off patrol changed geographic grid increment for latitude from 0.014999999999999996 to 0.0149999999999999994
grdimage [INFORMATION]: Read header from file geotiff.geo.tif
grdimage [INFORMATION]: File geotiff.geo.tif reads with GDAL driver GTiff
grdimage [INFORMATION]: Round-off patrol changed geographic grid increment for latitude from 0.014999999999999996 to 0.0149999999999999994
grdimage [INFORMATION]: Central meridian not given, default to 53.5
grdimage [INFORMATION]: Map scale is 153.393 km per cm or 1:1.53393e+07.
grdimage [INFORMATION]: Allocate and read data from file geotiff.geo.tif
grdimage [INFORMATION]: Reading grid from file geotiff.geo.tif
grdimage [INFORMATION]: Read band(s): 1
grdimage [INFORMATION]: Set boundary condition for left edge: natural
grdimage [INFORMATION]: project grid files
grdimage [INFORMATION]: Grid projection from size 1361x1038 to 1361x1038
grdimage [INFORMATION]: gmt_grd_project: Output grid extrema [-inf/inf] exceed extrema of input grid [-inf/60.7006] due to resampling
grdimage [INFORMATION]: gmt_grd_project: See option -n+c to clip resampled output range to given input range
double free or corruption (out)
./geotiff_plot.gmt: line 34: 21041 Aborted (core dumped) gmt grdimage geotiff.geo.tif -Q -Cvel.cpt -V

Is there a fix for this, or is it related to how I produced the tiff in matlab?

Thanks,
Jess

Can you post a small geotiff image that reproduces the issue (make a zip out of it and attach it to the post)

I have gotten around the issue by using matlab to convert the tif to a grd file:

% load input tif
[lon,lat,data,~,~] = read_geotiff(in_file);

% write output grd
grdwrite2(lon,lat,data,out_file);

OK, but that does not help us fixing the crash.

The compressed geotiff is too large to attach but can be found at this link: https://drive.google.com/drive/folders/1v4ZA8m85t1fbZXiqWicxkvwEnBzltTym?usp=sharing

What is your GMT version? I can plot that file with no problems.

I am using GMT 6.1.0 64 bit on RHEL 8 OS

Ah, you should have said that before. Bug reports (almost) only make sense when using latest version. And that bug has been fixed.