Repository navigation
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description of the problem
I'm experiencing a free(): invalid next size (fast) error when I run pygmt.filter1d. I've tested lots of environment variations with the below Minimal Complete Verifiable Examples. I can reliably reproduce the issues with an environment made with:
mamba env create -n pygmt_mkl python==3.14.3 numpy==2.4.3 pandas==3.0.1 pygmt==0.18.0 liblapack=*=*mkl
while an environment made with the below works as expected:
mamba env create -n pygmt_openblas python==3.14.3 numpy==2.4.3 pandas==3.0.1 pygmt==0.18.0 liblapack=*=*openblas
These seems to indicate it's a similar issue to #4038.
Outputs from working environment:
PyGMT information:
version: v0.18.0
System information:
python: 3.14.3 | packaged by conda-forge | (main, Feb 9 2026, 21:56:02) [GCC 14.3.0]
executable: /home/sungw937/miniforge3/envs/pygmt_openblas/bin/python
machine: Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39
Dependency information:
numpy: 2.4.3
pandas: 3.0.1
xarray: 2026.2.0
packaging: 26.0
contextily: None
geopandas: None
IPython: None
pyarrow: None
rioxarray: None
gdal: 3.12.3
ghostscript: 10.06.0
GMT library information:
version: 6.6.0
padding: 2
share dir: /home/sungw937/miniforge3/envs/pygmt_openblas/share/gmt
plugin dir: /home/sungw937/miniforge3/envs/pygmt_openblas/lib/gmt/plugins
library path: /home/sungw937/miniforge3/envs/pygmt_openblas/lib/libgmt.so
cores: 8
grid layout: rows
image layout:
binary version: 6.6.0
pygmt-session [DEBUG]: Revised options: @GMTAPI@-S-I-D-V-T-N-000000 -Fg1000 -N0 -Vd ->@GMTAPI@-S-O-D-D-A-Y-000001
filter1d [DEBUG]: Look for file 1000 in /home/sungw937/.gmt
filter1d [DEBUG]: Look for file 1000 in /home/sungw937/.gmt/cache
filter1d [DEBUG]: Look for file 1000 in /home/sungw937/.gmt/server
filter1d [INFORMATION]: Processing input table data
filter1d [DEBUG]: gmtapi_init_import: Passed family = Data Table and geometry = Line
filter1d [DEBUG]: gmtapi_init_import: Added 1 new sources
filter1d [DEBUG]: GMT_Init_IO: Returned first Input object ID = 0
filter1d [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
filter1d [DEBUG]: gmtapi_import_dataset: Passed ID = -1 and mode = 0
filter1d [INFORMATION]: Referencing data table from user 2 column arrays of length 1000
filter1d [DEBUG]: Object ID 2 : Registered Data Table Memory Reference 55a874c98030 as an Input resource with geometry Point [n_objects = 3]
filter1d [DEBUG]: gmtapi_import_dataset processed 1 resources
filter1d [DEBUG]: GMT_End_IO: Input resource access is now disabled
filter1d [DEBUG]: gmtapi_init_export: Passed family = Data Table and geometry = Line
filter1d [DEBUG]: gmtapi_init_export: Added 1 new destination
filter1d [DEBUG]: GMT_Init_IO: Returned first Output object ID = 1
filter1d [DEBUG]: GMT_Begin_IO: Mode value 1 not considered (ignored)
filter1d [DEBUG]: GMT_Begin_IO: Initialize record-by-record access for Output
filter1d [DEBUG]: gmtapi_next_io_source: Selected object 1
filter1d [INFORMATION]: Writing Data Table to memory copy supplied by pointer
filter1d [DEBUG]: GMT_Begin_IO: Output resource access is now enabled [record-by-record]
filter1d [DEBUG]: GMTAPI: GMT_Set_Geometry called but no object available
filter1d [INFORMATION]: Filter the data columns
filter1d [INFORMATION]: Read 1000 records from table 0, segment 0
filter1d [INFORMATION]: F width: 1000 Resolution: 10.01 Start: 500.501 Stop: 9499.5
filter1d [DEBUG]: GMTAPI: GMT_Put_Record (double) called before any segments declared
filter1d [DEBUG]: GMT memory: Initialize 2 temporary column double arrays, each of length : 0
filter1d [DEBUG]: Object ID 3 : Registered Data Table Memory Reference 55a874960570 as an Output resource with geometry Point|Line|Poly [n_objects = 4]
filter1d [DEBUG]: GMT_End_IO: Output resource access is now disabled
filter1d [DEBUG]: gmtlib_garbage_collection: Destroying object: C=0 A=0 ID=2 W=Input F=Data Table M=Memory Reference S=Used P=55a874c98030 N=(null)
filter1d [DEBUG]: GMTAPI_Garbage_Collection freed 1 memory objects
filter1d [DEBUG]: gmtlib_unregister_io: Unregistering object no 2 [n_objects = 3]
filter1d [DEBUG]: gmtlib_unregister_io: Unregistering object no 3 [n_objects = 2]
filter1d [DEBUG]: GMT memory: Free 2 temporary column arrays, each of length : 2097152
Minimal Complete Verifiable Example
import pandas as pd
import pygmt
import numpy as np
import faulthandler
faulthandler.enable()
data = pd.DataFrame(
data={
"distance_along_line": np.linspace(0,10000,1000),
"Free_air":np.linspace(100, 10000, 1000),
},
)
print(pygmt.show_versions())
filtered = pygmt.filter1d(
data[["distance_along_line", "Free_air"]],
end=False,
time_col=0,
filter_type="g1000",
verbose="debug",
)
print(filtered)Full error message
pygmt-session [DEBUG]: Revised options: @GMTAPI@-S-I-D-V-T-N-000000 -Fg1000 -N0 -Vd ->@GMTAPI@-S-O-D-D-A-Y-000001
filter1d [DEBUG]: Look for file 1000 in /home/sungw937/.gmt
filter1d [DEBUG]: Look for file 1000 in /home/sungw937/.gmt/cache
filter1d [DEBUG]: Look for file 1000 in /home/sungw937/.gmt/server
filter1d [INFORMATION]: Processing input table data
filter1d [DEBUG]: gmtapi_init_import: Passed family = Data Table and geometry = Line
filter1d [DEBUG]: gmtapi_init_import: Added 1 new sources
filter1d [DEBUG]: GMT_Init_IO: Returned first Input object ID = 0
filter1d [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
filter1d [DEBUG]: gmtapi_import_dataset: Passed ID = -1 and mode = 0
filter1d [INFORMATION]: Referencing data table from user 2 column arrays of length 1000
filter1d [DEBUG]: Object ID 2 : Registered Data Table Memory Reference 55e628994960 as an Input resource with geometry Point [n_objects = 3]
filter1d [DEBUG]: gmtapi_import_dataset processed 1 resources
filter1d [DEBUG]: GMT_End_IO: Input resource access is now disabled
filter1d [DEBUG]: gmtapi_init_export: Passed family = Data Table and geometry = Line
filter1d [DEBUG]: gmtapi_init_export: Added 1 new destination
filter1d [DEBUG]: GMT_Init_IO: Returned first Output object ID = 1
filter1d [DEBUG]: GMT_Begin_IO: Mode value 1 not considered (ignored)
filter1d [DEBUG]: GMT_Begin_IO: Initialize record-by-record access for Output
filter1d [DEBUG]: gmtapi_next_io_source: Selected object 1
filter1d [INFORMATION]: Writing Data Table to memory copy supplied by pointer
filter1d [DEBUG]: GMT_Begin_IO: Output resource access is now enabled [record-by-record]
filter1d [DEBUG]: GMTAPI: GMT_Set_Geometry called but no object available
filter1d [INFORMATION]: Filter the data columns
filter1d [INFORMATION]: Read 1000 records from table 0, segment 0
filter1d [INFORMATION]: F width: 1000 Resolution: 10.01 Start: 500.501 Stop: 9499.5
filter1d [DEBUG]: GMTAPI: GMT_Put_Record (double) called before any segments declared
filter1d [DEBUG]: GMT memory: Initialize 2 temporary column double arrays, each of length : 0
filter1d [DEBUG]: Object ID 3 : Registered Data Table Memory Reference 55e628a8fd20 as an Output resource with geometry Point|Line|Poly [n_objects = 4]
filter1d [DEBUG]: GMT_End_IO: Output resource access is now disabled
filter1d [DEBUG]: gmtlib_garbage_collection: Destroying object: C=0 A=0 ID=2 W=Input F=Data Table M=Memory Reference S=Used P=55e628994960 N=(null)
filter1d [DEBUG]: GMTAPI_Garbage_Collection freed 1 memory objects
filter1d [DEBUG]: gmtlib_unregister_io: Unregistering object no 2 [n_objects = 3]
filter1d [DEBUG]: gmtlib_unregister_io: Unregistering object no 3 [n_objects = 2]
filter1d [DEBUG]: GMT memory: Free 2 temporary column arrays, each of length : 2097152
free(): invalid next size (fast)
Aborted (core dumped)System information
PyGMT information:
version: v0.18.0
System information:
python: 3.14.3 | packaged by conda-forge | (main, Feb 9 2026, 21:56:02) [GCC 14.3.0]
executable: /home/sungw937/miniforge3/envs/pygmt_mkl/bin/python
machine: Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39
Dependency information:
numpy: 2.4.3
pandas: 3.0.1
xarray: 2026.2.0
packaging: 26.0
contextily: None
geopandas: None
IPython: None
pyarrow: None
rioxarray: None
gdal: 3.12.3
ghostscript: 10.06.0
GMT library information:
version: 6.6.0
padding: 2
share dir: /home/sungw937/miniforge3/envs/pygmt_mkl/share/gmt
plugin dir: /home/sungw937/miniforge3/envs/pygmt_mkl/lib/gmt/plugins
library path: /home/sungw937/miniforge3/envs/pygmt_mkl/lib/libgmt.so
cores: 8
grid layout: rows
image layout:
binary version: 6.6.0Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
weiji14 commentedon Mar 26, 2026
Oof, this mkl vs openblas situation again. I was fighting this a couple of week ago at conda-forge/lapack-feedstock#81 (comment) (try not to go down the rabbit hole), and my general impression is that even though these different blas variants should be compatible (https://conda-forge.org/docs/maintainer/knowledge_base/#blas), the whole situation is still a mess. Can you share the output of
conda list | grep mklfor yourpygmt_mklenvironment, andconda list | grep blasfor thepygmt_openblasenvironment? Want to check what versions of blas dependent libraries are installed.Cc @seisman who might know a bit more if there's an issue with the C code as well.
mdtanker commentedon Mar 27, 2026
Yeah I think I'll stay out of that rabbit hole 😂
Here's the output from the
pygmt_mklenv:and the output from the
pygmt_openblasenv:weiji14 commentedon Mar 31, 2026
Hmm yeah, I can reproduce the segfault on my Linux computer with your
mamba env create -n pygmt_mkl ...+ Python commands. The error goes away if I do amamba install "libblas=3.11.*=*openblas"(could be a temporary workaround) to use the openblas variant.I also tried upgrading to the GMT dev version using
mamba install -c conda-forge/label/dev gmt=6.7.0.dev2+8931e47, and got the same error. So might be something that needs to be fixed upstream in GMT, similar to what was done in GenericMappingTools/gmt#8755, but somewhere else?