Repository navigation
Conversation
|
I think the generic message it's good enough. If we were to be specific that another one should be issued for bad column grids. But I emphasize, this failure on Windows start short time ago. |
…d_prep_io A netCDF grid with one row and no y:actual_range (as written by GDAL) is read with y range 0/0, so y_inc is 0 and n_rows is 0. gmt_adjust_loose_wesn returns that error, but gmtnc_grd_prep_io only printed it and went on, and the read crashed (an assertion in gmtnc_pad_grid in Debug builds, a segfault in Release builds). Return the error so the read fails instead. gmt_nc_read_grd now passes the error code up unchanged instead of turning it into GMT_RUNTIME_ERROR, which has no entry in gmt_error_string, so the caller printed "(null)". The message is now the same kind as for other read errors: "grdtrend (gmtapi_import_grid): Grid y increment <= 0.0 [file]". Add a test that writes such a grid with GDAL. Fixes the crash reported in #9261. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ok, I will not change the message. |
|
Updated the test in the last push. The previous version failed on the Windows CI: it wrote the 1-row grid with |
|
I am confused with this But |
The test times out on the macOS CI (480 s, three attempts) while it passes on Linux and Windows. Keep only the fix. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
In the second block I removed the new test. Only the fix is left. |
|
Now the test |
A netCDF grid with one row and no
y:actual_range(as GDAL writes it) is read with y range 0/0, and the read crashed becausegmtnc_grd_prep_ioonly printed the error and went on. It now returns it, so the module stops with the usual read error.Tested with:
Before:
Grid y increment <= 0.0and a segfault. After: the same message plusGMT_GRID_READ_ERROR, no crash. New test:test/gdal/gdal_1row_netcdf.sh.Question
The message is the generic one GMT uses for read errors. Would a clearer one be better, e.g. "Grid bad.nc has a single row and no y actual_range attribute, so its y range and increment are unknown"?
Refs #9261 (the crash only).
Reviewed with Claude Opus 5.5. Written with Claude Sonnet 5.5.