Windows CI: a 1-row netCDF grid is read back with a collapsed y range (test/grdtrend/trend_xy_plot.sh)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
The bug is in gmtnc_grd_info in src/gmt_nc.c, where the y range of a 1-row grid comes only from actual_range (around lines 774-803). Reproduce with gmt grdmath to make row.grd, then gmt grdinfo -C row.grd, and compare with test/grdtrend/trend_xy_plot.sh. Done means a 1-row grid reads back with y range -0.2/0.2 on the Windows CI build, without the #pragma optimize workaround. The maintainers have not chosen a fix yet, so confirm the approach first.
由索引模型根据 Issue 内容生成。
描述
I asked Claude to look for a solution to the failure of this test in the Windows CI, and this is its analysis. I am posting it to ask what you prefer to do about it.
test/grdtrend/trend_xy_plot.sh fails only in the Windows CI (MSVC 14.51.36231, Visual Studio 2026 image, Release /O2 /Ob2 /DNDEBUG, vcpkg netCDF 4.9.3): grdtrend prints Grid y increment <= 0.0 [data.grd] and crashes. I would like to ask what you prefer for this one, because I could not find the root cause.
What fails. The grid written by grdmath is valid and reads fine on Linux and through GDAL, but on the Windows CI the same call reads a 6x1 grid with y range 0/0:
gmt grdmath -R-1.2/1.2/-0.2/0.2 -I0.4 -r 0.5 X ADD X X MUL ADD X 3 POW ADD = row.grd
gmt grdinfo -C row.grd
- good:
row.grd -1.2 1.2 -0.2 0.2 -0.5 3.5 0.4 0.4 6 1 1 0 - CI:
row.grd -1.2 1.2 0 0 -0.5 3.5 0.4 0 6 0 1 0(y range 0/0, y_inc 0, 0 rows)
It fails when the test runs alone (no -j4), and also outside the test (https://github.com/GenericMappingTools/gmt/actions/runs/38145255398). A 1-column x 6-row grid reads fine, GDAL reads y#actual_range={-0.2,0.2} fine, and the only netcdf.dll copies on PATH are vcpkg's. For a 1-row grid the y range comes only from actual_range (there is no usable y vector), in the y block of gmtnc_grd_info (src/gmt_nc.c, around lines 774-803); the x block has the same structure.
What I tried.
- Any debug print inside
gmtnc_grd_info, even a passive one, makes the failure disappear. #pragma optimize("", off)aroundgmtnc_grd_infoonly, with nothing else changed, makes the test pass (https://github.com/GenericMappingTools/gmt/actions/runs/38176185877).- ASAN and UBSAN builds on Linux find nothing in this path, and I found no undefined behaviour by reading it.
- A
gmt 6.8.0_f6039ecbuild from September on a Windows 10 PC reads the grid correctly, but I don't know its toolset or flags.gmtnc_grd_infois identical to the one in master.
So it looks like an optimizer problem (compiler bug or an undefined behaviour that /O2 exploits), but I could not prove either.
Questions.
- Does anyone with a local MSVC 14.50 or 14.51 build reproduce the
grdinfooutput above? - The 6.7.0 Windows binaries were linked with MSVC 14.50. Does the official 6.7.0 binary read the 1-row grid correctly? If not, users are affected and not only the test.
- How do you prefer to handle it: (a) the
#pragma optimizechange above, guarded by_MSC_VER(I have a 6-line patch ready), (b) mark the test with# GMT_KNOWN_FAILURE_WINDOWS, or (c) something else?
Reviewed with Claude Opus 5.5 (read-only review of the analysis). Written with Claude Sonnet 5.5.
- 主要语言
- C
- 星标
- 985
- 派生
- 414
- 平均合并
- 22 小时 51 分钟
- 30 天内合并 PR
- 35
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GenericMappingTools/gmt 的其他 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 62/100
GenericMappingTools/gmt#5767 · 15 条评论 ·
维护者通常 1 天内回复
-
A method to find image height similar to mapproject -Wh可能已有人在做 @Esteban82 于 4 天前认领。 未关闭feature request
难度 3/5 1-2 天 新手友好度 55/100
GenericMappingTools/gmt#9256 · 已指派 1 人 ·
维护者通常 1 天内回复
-
feature request
难度 4/5 3-5 天 新手友好度 48/100
GenericMappingTools/gmt#9225 · 1 条评论 ·
维护者通常 1 天内回复
-
inset: Specifing the region using -Dxmin/xmax/ymin/ymax doesn't work可能已有人在做 @Esteban82 于 21 天前认领。 未关闭bug
GenericMappingTools/gmt#9224 · 已指派 1 人 ·
维护者通常 1 天内回复
-
histogram: Support density histograms and more可能已有人在做 @Esteban82 于 29 天前认领。 未关闭feature request
GenericMappingTools/gmt#9212 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 GenericMappingTools/gmt 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
ChrisTitusTech/dwm-titus#397 ·
维护者通常 1 天内回复
-
good first issue help wanted language:fr translation
难度 1/5 1-3 小时 新手友好度 85/100
mrvi0/cli-cheatsheet#160 ·
-
Test modules use volatile int for cross-thread flags instead of atomics可能已有人在做 @rahimuddin140 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
valkey-io/valkey#4899 · 1 条评论 ·
维护者通常 2 天内回复
-
Profiler (Remotery) leaks a socket for every connection that fails the WebSocket handshake可能已有人在做 @rthery 今天认领。 未关闭triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复