Skip to content

Fix gmtselect -N crash with non-cylindrical projections - #9325

Merged
Esteban82 merged 1 commit into
masterfrom
fix-gmtselect-proj-segfault
Nov 26, 2026
Merged

Esteban82 merged 1 commit into
masterfrom
fix-gmtselect-proj-segfault

Conversation

@Esteban82

Copy link
Copy Markdown
Member

gmt_proj_setup left dlon/dlat at 0, so gmtselect -J<non-cylindrical> -N crashed resampling the coastline, and the -p bounding box sampled a single longitude (pseudocylindrical maps). Set both before gmtmap_init_three_D.

echo "20 47" | gmt select -R-20/60/20/60 -JW20/15c -Ns/k -Dl
Before:

gmtselect (gmtlib_lonpath): Could not reallocate memory [68719476736.00 Gb, 9223372036854775809 items of 8 bytes]
ERROR: Caught signal number 11 (Segmentation fault)

After (same as without -J):

20 47
🤖 Generated with Claude Code (Claude Opus 5.5)

gmt_proj_setup computed n_lon_nodes/n_lat_nodes but left dlon/dlat at 0
until gmt_map_setup. gmtmap_init_three_D then sampled the border at a
single longitude (wrong -p bounding box for pseudocylindrical maps), and
gmtselect -N with a non-cylindrical -J (which only calls gmt_proj_setup)
crashed in gmtlib_lonpath dividing by dlat = 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Esteban82 Esteban82 added bug Something isn't working add-changelog Add PR to the changelog labels Nov 26, 2026
@Esteban82
Esteban82 requested review from a team and joa-quim November 26, 2026 01:25
@Esteban82
Esteban82 merged commit 4b09041 into master Nov 26, 2026
18 of 19 checks passed
@Esteban82
Esteban82 deleted the fix-gmtselect-proj-segfault branch November 26, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants