xyz2grd crashes python with large grids
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先,在受支持的环境中运行提供的 pygmt.xyz2grd Python 和 NumPy 最小示例,该示例使用 11520 × 23040 的大型数组。跟踪 xyz2grd 调用及其与 GMT 的交互,以确定 invalid free 的来源。完成标准是该示例不再导致 Python 崩溃,并且仍能生成预期的网格。
由索引模型根据 Issue 内容生成。
描述
Description of the problem
I am trying to create a grd file using pygmt's xyz2grd with a numpy array. The numpy array is large (64 pixels per degree corresponding to 11520 x 23040). Running the xyz2grd command kills the python kernel and gives the following result
python3.12(11590,0x1e10f1c40) malloc: *** error for object 0x3ff142fe20000000: pointer being freed was not allocated
python3.12(11590,0x1e10f1c40) malloc: *** set a breakpoint in malloc_error_break to debug
[1] 11590 abort ipython
I have the same problem on macOS and on Fedora linux (though on fedora, I don't think a error is reported, it just crashes).
Minimal Complete Verifiable Example
import numpy as np
import pygmt
nlat = 180 * 64
nlon = 360 * 64
array = np.empty((nlat, nlon))
spacing = 1/64
grd = pygmt.xyz2grd(array, spacing=spacing, region=[0, 360, -90, 90], registration='p')
Full error message
python3.12(11590,0x1e10f1c40) malloc: *** error for object 0x3ff142fe20000000: pointer being freed was not allocated
python3.12(11590,0x1e10f1c40) malloc: *** set a breakpoint in malloc_error_break to debug
[1] 11590 abort ipython
System information
PyGMT information:
version: v0.11.0
System information:
python: 3.12.1 | packaged by conda-forge | (main, Dec 23 2023, 08:01:35) [Clang 16.0.6 ]
executable: /Users/lunokhod/miniconda3/envs/py312/bin/python
machine: macOS-14.3-arm64-arm-64bit
Dependency information:
numpy: 1.26.3
pandas: 2.1.4
xarray: 2023.12.0
netCDF4: 1.6.5
packaging: 23.2
contextily: None
geopandas: None
ipython: None
rioxarray: None
ghostscript: 10.02.1
GMT library information:
binary version: 6.5.0
cores: 10
grid layout: rows
image layout:
library path: /Users/lunokhod/miniconda3/envs/py312/lib/libgmt.dylib
padding: 2
plugin dir: /Users/lunokhod/miniconda3/envs/py312/lib/gmt/plugins
share dir: /Users/lunokhod/miniconda3/envs/py312/share/gmt
version: 6.5.0
- 主要语言
- Python
- 星标
- 882
- 派生
- 261
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 29
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GenericMappingTools/pygmt 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
GenericMappingTools/pygmt#5014 · 1 条评论 ·
维护者通常 1 天内回复
-
discussions documentation
难度 1/5 1 小时以内 新手友好度 78/100
GenericMappingTools/pygmt#4992 ·
维护者通常 1 天内回复
-
Improve reporting the GMT version via "pygmt.show_versions()"可能已有人在做 @yvonnefroehlich 于 113 天前认领。 未关闭maintenance
难度 2/5 1-3 小时 新手友好度 68/100
GenericMappingTools/pygmt#4812 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
GenericMappingTools/pygmt#4765 ·
维护者通常 1 天内回复
-
Add an AGENTS.md file可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭discussions
难度 2/5 1-3 小时 新手友好度 75/100
GenericMappingTools/pygmt#4677 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
查看 GenericMappingTools/pygmt 的全部 Issue
相似的 Issue
-
accepted
难度 2/5 1-3 小时 新手友好度 67/100
future-agi/future-agi#5274 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
w3c/feedvalidator#204 ·
-
[BUG][Low–Medium] founder_numbers.py silently reads a SAFE discount or pool target given as a fraction (0.2) as 0.2%可能已有人在做 @sumitkhond111-del 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
bmad-code-org/BMAD-METHOD#3358 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
open-mmlab/mmcv#3352 ·
-
难度 1/5 1 小时以内 新手友好度 68/100
OpenGithubs/weekly#263 ·
维护者通常 1 天内回复