polartoolkit icon indicating copy to clipboard operation
polartoolkit copied to clipboard

Kernel crashing with certain plotting elements

Open mdtanker opened this issue 8 months ago • 8 comments

Describe the bug I've been experiencing lots of crashing of kernel with certain aspects of maps.plot_grd, mostly with hist=True or even with show_region. It appears to be an issue with some dependency. I can reliably recreate the crash with the below code:

from polartoolkit import fetch, maps, profiles, regions
import os
os.environ["POLARTOOLKIT_HEMISPHERE"] = "south"

ibcso = fetch.ibcso(
    layer="bed",
    region=(-40e3, 110e3, -1600e3, -1400e3),
)
fig = maps.plot_grd(
    ibcso,
    show_region=(-40e3, 110e3, -1600e3, -1400e3),
    fig_height=10,
    title="Bathymetry",
    hist=True,
    cmap="rain",
    reverse_cpt=True,
    cbar_label="elevation (m)",
    robust=True,
)
fig.savefig("ibcso_bed.png", dpi=300)
double free or corruption (out)
Aborted (core dumped)

The main differences between the environment that works and the one that doesn't seems to be:

  • good env has cartopy 0.24, bad env doesn't have cartopy
  • good env has geopandas 1.0.1, bad env has 0.14.4
  • good env has zarr 2.18.7, bad env has 3.0.7
Fails with this environment:
     _openmp_mutex                     4.5             3_kmp_llvm                      conda-forge
  adjusttext                        1.3.0           pyhd8ed1ab_0                    conda-forge
  affine                            2.4.0           pyhd8ed1ab_1                    conda-forge
  aiobotocore                       2.21.1          pyhd8ed1ab_0                    conda-forge
  aiohappyeyeballs                  2.6.1           pyhd8ed1ab_0                    conda-forge
  aiohttp                           3.11.18         py312h178313f_0                 conda-forge
  aioitertools                      0.12.0          pyhd8ed1ab_1                    conda-forge
  aiosignal                         1.3.2           pyhd8ed1ab_0                    conda-forge
  alembic                           1.15.2          pyhd8ed1ab_0                    conda-forge
  alsa-lib                          1.2.14          hb9d3cd8_0                      conda-forge
  anyio                             4.9.0           pyh29332c3_0                    conda-forge
  aom                               3.9.1           hac33072_0                      conda-forge
  argon2-cffi                       23.1.0          pyhd8ed1ab_1                    conda-forge
  argon2-cffi-bindings              21.2.0          py312h66e93f0_5                 conda-forge
  arrow                             1.3.0           pyhd8ed1ab_1                    conda-forge
  astroid                           3.3.9           py312h7900ff3_0                 conda-forge
  asttokens                         3.0.0           pyhd8ed1ab_1                    conda-forge
  async-lru                         2.0.5           pyh29332c3_0                    conda-forge
  attr                              2.5.1           h166bdaf_1                      conda-forge
  attrs                             25.3.0          pyh71513ae_0                    conda-forge
  aws-c-auth                        0.9.0           h094d708_2                      conda-forge
  aws-c-cal                         0.8.9           hada3f3f_0                      conda-forge
  aws-c-common                      0.12.2          hb9d3cd8_0                      conda-forge
  aws-c-compression                 0.3.1           hc2d532b_4                      conda-forge
  aws-c-event-stream                0.5.4           h8170a11_5                      conda-forge
  aws-c-http                        0.9.5           hca9d837_2                      conda-forge
  aws-c-io                          0.18.0          h7b13e6b_1                      conda-forge
  aws-c-mqtt                        0.12.3          h773eac8_2                      conda-forge
  aws-c-s3                          0.7.15          h46af1f8_1                      conda-forge
  aws-c-sdkutils                    0.2.3           hc2d532b_4                      conda-forge
  aws-checksums                     0.2.5           hc2d532b_1                      conda-forge
  aws-crt-cpp                       0.32.4          h7d42c6f_0                      conda-forge
  aws-sdk-cpp                       1.11.510        h5b777a2_5                      conda-forge
  azure-core-cpp                    1.14.0          h5cfcd09_0                      conda-forge
  azure-identity-cpp                1.10.0          h113e628_0                      conda-forge
  azure-storage-blobs-cpp           12.13.0         h3cf044e_1                      conda-forge
  azure-storage-common-cpp          12.8.0          h736e048_1                      conda-forge
  azure-storage-files-datalake-cpp  12.12.0         ha633028_1                      conda-forge
  babel                             2.17.0          pyhd8ed1ab_0                    conda-forge
  beautifulsoup4                    4.13.4          pyha770c72_0                    conda-forge
  bleach                            6.2.0           pyh29332c3_4                    conda-forge
  bleach-with-css                   6.2.0           h82add2a_4                      conda-forge
  blosc                             1.21.6          he440d0b_1                      conda-forge
  bokeh                             3.7.2           pyhd8ed1ab_1                    conda-forge
  botocore                          1.37.1          pyge310_1234567_0               conda-forge
  boule                             0.5.0           pyhd8ed1ab_1                    conda-forge
  bounded-pool-executor             0.0.3           pyhd8ed1ab_0                    conda-forge
  branca                            0.8.1           pyhd8ed1ab_0                    conda-forge
  brotli                            1.1.0           hb9d3cd8_2                      conda-forge
  brotli-bin                        1.1.0           hb9d3cd8_2                      conda-forge
  brotli-python                     1.1.0           py312h2ec8cdc_2                 conda-forge
  bzip2                             1.0.8           h4bc722e_7                      conda-forge
  c-ares                            1.34.5          hb9d3cd8_0                      conda-forge
  ca-certificates                   2025.1.31       hbd8a1cb_1                      conda-forge
  cached-property                   1.5.2           hd8ed1ab_1                      conda-forge
  cached_property                   1.5.2           pyha770c72_1                    conda-forge
  cairo                             1.18.4          h3394656_0                      conda-forge
  certifi                           2025.1.31       pyhd8ed1ab_0                    conda-forge
  cf_xarray                         0.10.5          pyhd8ed1ab_0                    conda-forge
  cffi                              1.17.1          py312h06ac9bb_0                 conda-forge
  cfgv                              3.3.1           pyhd8ed1ab_1                    conda-forge
  cftime                            1.6.4           py312hc0a28a1_1                 conda-forge
  charset-normalizer                3.4.1           pyhd8ed1ab_0                    conda-forge
  choclo                            0.3.2           pyhd8ed1ab_0                    conda-forge
  click                             8.1.8           pyh707e725_0                    conda-forge
  click-plugins                     1.1.1           pyhd8ed1ab_1                    conda-forge
  cligj                             0.7.2           pyhd8ed1ab_2                    conda-forge
  cloudpickle                       3.1.1           pyhd8ed1ab_0                    conda-forge
  cmocean                           4.0.3           pyhd8ed1ab_1                    conda-forge
  colorama                          0.4.6           pyhd8ed1ab_1                    conda-forge
  colorlog                          6.9.0           pyh707e725_1                    conda-forge
  colorspacious                     1.1.2           pyhecae5ae_1                    conda-forge
  comm                              0.2.2           pyhd8ed1ab_1                    conda-forge
  contourpy                         1.3.2           py312h68727a3_0                 conda-forge
  cpython                           3.12.10         py312hd8ed1ab_0                 conda-forge
  crc32c                            2.7.1           py312h66e93f0_1                 conda-forge
  cuda-crt-tools                    12.8.93         ha770c72_3                      conda-forge
  cuda-cudart                       12.8.90         h5888daf_1                      conda-forge
  cuda-cudart_linux-64              12.8.90         h3f2d84a_1                      conda-forge
  cuda-cuobjdump                    12.8.90         hbd13f7d_1                      conda-forge
  cuda-cupti                        12.8.90         h5888daf_1                      conda-forge
  cuda-nvcc-tools                   12.8.93         he02047a_3                      conda-forge
  cuda-nvdisasm                     12.8.90         hbd13f7d_1                      conda-forge
  cuda-nvrtc                        12.8.93         h5888daf_1                      conda-forge
  cuda-nvtx                         12.8.90         h5888daf_1                      conda-forge
  cuda-nvvm-tools                   12.8.93         he02047a_3                      conda-forge
  cuda-version                      12.8            h5d125a7_3                      conda-forge
  cudnn                             9.8.0.87        h81d5506_1                      conda-forge
  curl                              8.13.0          h332b0f4_0                      conda-forge
  cycler                            0.12.1          pyhd8ed1ab_1                    conda-forge
  cyrus-sasl                        2.1.27          h54b06d7_7                      conda-forge
  cytoolz                           1.0.1           py312h66e93f0_0                 conda-forge
  dask                              2025.4.0        pyhd8ed1ab_0                    conda-forge
  dask-core                         2025.4.0        pyhd8ed1ab_0                    conda-forge
  dav1d                             1.2.1           hd590300_0                      conda-forge
  dbus                              1.13.6          h5008d03_3                      conda-forge
  dcw-gmt                           2.2.0           ha770c72_0                      conda-forge
  debugpy                           1.8.14          py312h2ec8cdc_0                 conda-forge
  decorator                         5.2.1           pyhd8ed1ab_0                    conda-forge
  defusedxml                        0.7.1           pyhd8ed1ab_0                    conda-forge
  deprecated                        1.2.18          pyhd8ed1ab_0                    conda-forge
  deprecation                       2.1.0           pyh9f0ad1d_0                    conda-forge
  dill                              0.4.0           pyhd8ed1ab_0                    conda-forge
  distlib                           0.3.9           pyhd8ed1ab_1                    conda-forge
  distributed                       2025.4.0        pyhd8ed1ab_0                    conda-forge
  docrep                            0.3.2           pyh44b312d_0                    conda-forge
  donfig                            0.8.1.post1     pyhd8ed1ab_1                    conda-forge
  double-conversion                 3.3.1           h5888daf_0                      conda-forge
  earthaccess                       0.12.0          pyhd8ed1ab_1                    conda-forge
  esmf                              8.8.1           nompi_h4441c20_0                conda-forge
  esmpy                             8.8.1           pyhecae5ae_0                    conda-forge
  et_xmlfile                        2.0.0           pyhd8ed1ab_1                    conda-forge
  exceptiongroup                    1.2.2           pyhd8ed1ab_1                    conda-forge
  executing                         2.1.0           pyhd8ed1ab_1                    conda-forge
  expat                             2.7.0           h5888daf_0                      conda-forge
  fftw                              3.3.10          nompi_hf1063bd_110              conda-forge
  filelock                          3.18.0          pyhd8ed1ab_0                    conda-forge
  fiona                             1.10.1          py312h02b19dd_3                 conda-forge
  folium                            0.19.5          pyhd8ed1ab_0                    conda-forge
  font-ttf-dejavu-sans-mono         2.37            hab24e00_0                      conda-forge
  font-ttf-inconsolata              3.000           h77eed37_0                      conda-forge
  font-ttf-source-code-pro          2.038           h77eed37_0                      conda-forge
  font-ttf-ubuntu                   0.83            h77eed37_3                      conda-forge
  fontconfig                        2.15.0          h7e30c49_1                      conda-forge
  fonts-conda-ecosystem             1               0                               conda-forge
  fonts-conda-forge                 1               0                               conda-forge
  fonttools                         4.57.0          py312h178313f_0                 conda-forge
  fqdn                              1.5.1           pyhd8ed1ab_1                    conda-forge
  freetype                          2.13.3          ha770c72_1                      conda-forge
  freexl                            2.0.0           h9dce30a_2                      conda-forge
  frozenlist                        1.5.0           py312h178313f_1                 conda-forge
  fsspec                            2025.3.2        pyhd8ed1ab_0                    conda-forge
  future                            1.0.0           pyhd8ed1ab_2                    conda-forge
  geopandas                         0.14.4          pyhd8ed1ab_0                    conda-forge
  geopandas-base                    0.14.4          pyha770c72_0                    conda-forge
  geos                              3.13.1          h97f6797_0                      conda-forge
  geotiff                           1.7.4           h3551947_0                      conda-forge
  gflags                            2.2.2           h5888daf_1005                   conda-forge
  ghostscript                       10.04.0         h5888daf_0                      conda-forge
  giflib                            5.2.2           hd590300_0                      conda-forge
  gl2ps                             1.4.2           hae5d5c5_1                      conda-forge
  glew                              2.1.0           h9c3ff4c_2                      conda-forge
  glog                              0.7.1           hbabe93e_0                      conda-forge
  gmp                               6.3.0           hac33072_2                      conda-forge
  gmpy2                             2.1.5           py312h7201bc8_3                 conda-forge
  gmt                               6.5.0           h8300b2c_8                      conda-forge
  graphite2                         1.3.13          h59595ed_1003                   conda-forge
  greenlet                          3.2.0           py312h2ec8cdc_0                 conda-forge
  gshhg-gmt                         2.3.7           ha770c72_1003                   conda-forge
  h11                               0.14.0          pyhd8ed1ab_1                    conda-forge
  h2                                4.2.0           pyhd8ed1ab_0                    conda-forge
  harfbuzz                          11.1.0          h3beb420_0                      conda-forge
  harmonica                         0.7.0           pyhd8ed1ab_1                    conda-forge
  hdf4                              4.2.15          h2a13503_7                      conda-forge
  hdf5                              1.14.3          nompi_h2d575fe_109              conda-forge
  hpack                             4.1.0           pyhd8ed1ab_0                    conda-forge
  httpcore                          1.0.7           pyh29332c3_1                    conda-forge
  httpx                             0.28.1          pyhd8ed1ab_0                    conda-forge
  hyperframe                        6.1.0           pyhd8ed1ab_0                    conda-forge
  icu                               75.1            he02047a_0                      conda-forge
  identify                          2.6.10          pyhd8ed1ab_0                    conda-forge
  idna                              3.10            pyhd8ed1ab_1                    conda-forge
  importlib-metadata                8.6.1           pyha770c72_0                    conda-forge
  importlib-resources               6.5.2           pyhd8ed1ab_0                    conda-forge
  importlib_resources               6.5.2           pyhd8ed1ab_0                    conda-forge
  iniconfig                         2.0.0           pyhd8ed1ab_1                    conda-forge
  invert4geom                       0.13.0          pyhd8ed1ab_0                    conda-forge
  ipykernel                         6.29.5          pyh3099207_0                    conda-forge
  ipython                           9.1.0           pyhfb0248b_0                    conda-forge
  ipython_pygments_lexers           1.1.1           pyhd8ed1ab_0                    conda-forge
  ipywidgets                        8.1.6           pyhd8ed1ab_0                    conda-forge
  isoduration                       20.11.0         pyhd8ed1ab_1                    conda-forge
  isort                             6.0.1           pyhd8ed1ab_0                    conda-forge
  jedi                              0.19.2          pyhd8ed1ab_1                    conda-forge
  jinja2                            3.1.6           pyhd8ed1ab_0                    conda-forge
  jmespath                          1.0.1           pyhd8ed1ab_1                    conda-forge
  joblib                            1.4.2           pyhd8ed1ab_1                    conda-forge
  json-c                            0.18            h6688a6e_0                      conda-forge
  json5                             0.12.0          pyhd8ed1ab_0                    conda-forge
  jsoncpp                           1.9.6           hf42df4d_1                      conda-forge
  jsonpointer                       3.0.0           py312h7900ff3_1                 conda-forge
  jsonschema                        4.23.0          pyhd8ed1ab_1                    conda-forge
  jsonschema-specifications         2024.10.1       pyhd8ed1ab_1                    conda-forge
  jsonschema-with-format-nongpl     4.23.0          hd8ed1ab_1                      conda-forge
  jupyter-lsp                       2.2.5           pyhd8ed1ab_1                    conda-forge
  jupyter_client                    8.6.3           pyhd8ed1ab_1                    conda-forge
  jupyter_core                      5.7.2           pyh31011fe_1                    conda-forge
  jupyter_events                    0.12.0          pyh29332c3_0                    conda-forge
  jupyter_server                    2.15.0          pyhd8ed1ab_0                    conda-forge
  jupyter_server_terminals          0.5.3           pyhd8ed1ab_1                    conda-forge
  jupyterlab                        4.4.1           pyhd8ed1ab_0                    conda-forge
  jupyterlab_execute_time           3.2.0           pyhd8ed1ab_1                    conda-forge
  jupyterlab_pygments               0.3.0           pyhd8ed1ab_2                    conda-forge
  jupyterlab_server                 2.27.3          pyhd8ed1ab_1                    conda-forge
  jupyterlab_widgets                3.0.14          pyhd8ed1ab_0                    conda-forge
  keyutils                          1.6.1           h166bdaf_0                      conda-forge
  kiwisolver                        1.4.8           py312h84d6215_0                 conda-forge
  kneebow                           1.0.2           pypi_0                          pypi       
  krb5                              1.21.3          h659f571_0                      conda-forge
  lcms2                             2.17            h717163a_0                      conda-forge
  ld_impl_linux-64                  2.43            h712a8e2_4                      conda-forge
  lerc                              4.0.0           h0aef613_1                      conda-forge
  libabseil                         20250127.1      cxx17_hbbce691_0                conda-forge
  libaec                            1.1.3           h59595ed_0                      conda-forge
  libarchive                        3.7.7           h75ea233_4                      conda-forge
  libarrow                          19.0.1          h27f8bab_8_cpu                  conda-forge
  libarrow-acero                    19.0.1          hcb10f89_8_cpu                  conda-forge
  libarrow-dataset                  19.0.1          hcb10f89_8_cpu                  conda-forge
  libarrow-substrait                19.0.1          h1bed206_8_cpu                  conda-forge
  libavif16                         1.2.1           hbb36593_2                      conda-forge
  libblas                           3.9.0           31_hfdb39a5_mkl                 conda-forge
  libbrotlicommon                   1.1.0           hb9d3cd8_2                      conda-forge
  libbrotlidec                      1.1.0           hb9d3cd8_2                      conda-forge
  libbrotlienc                      1.1.0           hb9d3cd8_2                      conda-forge
  libcap                            2.75            h39aace5_0                      conda-forge
  libcblas                          3.9.0           31_h372d94f_mkl                 conda-forge
  libclang-cpp20.1                  20.1.3          default_h1df26ce_0              conda-forge
  libclang13                        20.1.3          default_he06ed0a_0              conda-forge
  libcrc32c                         1.1.2           h9c3ff4c_0                      conda-forge
  libcublas                         12.8.4.1        h9ab20c4_1                      conda-forge
  libcudss                          0.5.0.16        h14340ca_1                      conda-forge
  libcufft                          11.3.3.83       h5888daf_1                      conda-forge
  libcufile                         1.13.1.3        h628e99a_1                      conda-forge
  libcups                           2.3.3           h4637d8d_4                      conda-forge
  libcurand                         10.3.9.90       h9ab20c4_1                      conda-forge
  libcurl                           8.13.0          h332b0f4_0                      conda-forge
  libcusolver                       11.7.3.90       h9ab20c4_1                      conda-forge
  libcusparse                       12.5.8.93       h5888daf_1                      conda-forge
  libde265                          1.0.15          h00ab1b0_0                      conda-forge
  libdeflate                        1.23            h86f0d12_0                      conda-forge
  libdrm                            2.4.124         hb9d3cd8_0                      conda-forge
  libedit                           3.1.20250104    pl5321h7949ede_0                conda-forge
  libegl                            1.7.0           ha4b6fd6_2                      conda-forge
  libev                             4.33            hd590300_2                      conda-forge
  libevent                          2.1.12          hf998b51_1                      conda-forge
  libexpat                          2.7.0           h5888daf_0                      conda-forge
  libffi                            3.4.6           h2dba641_1                      conda-forge
  libfreetype                       2.13.3          ha770c72_1                      conda-forge
  libfreetype6                      2.13.3          h48d6fc4_1                      conda-forge
  libgcc                            14.2.0          h767d61c_2                      conda-forge
  libgcc-ng                         14.2.0          h69a702a_2                      conda-forge
  libgcrypt-lib                     1.11.0          hb9d3cd8_2                      conda-forge
  libgdal-core                      3.10.2          h05269f4_1                      conda-forge
  libgdal-jp2openjpeg               3.10.2          ha1d2769_1                      conda-forge
  libgfortran                       14.2.0          h69a702a_2                      conda-forge
  libgfortran-ng                    14.2.0          h69a702a_2                      conda-forge
  libgfortran5                      14.2.0          hf1ad2bd_2                      conda-forge
  libgl                             1.7.0           ha4b6fd6_2                      conda-forge
  libglib                           2.84.1          h2ff4ddf_0                      conda-forge
  libglu                            9.0.3           h03adeef_0                      conda-forge
  libglvnd                          1.7.0           ha4b6fd6_2                      conda-forge
  libglx                            1.7.0           ha4b6fd6_2                      conda-forge
  libgoogle-cloud                   2.36.0          hc4361e1_1                      conda-forge
  libgoogle-cloud-storage           2.36.0          h0121fbd_1                      conda-forge
  libgpg-error                      1.54            hbd13f7d_0                      conda-forge
  libgrpc                           1.71.0          h8e591d7_1                      conda-forge
  libheif                           1.19.7          gpl_hc18d805_100                conda-forge
  libhwloc                          2.11.2          default_h0d58e46_1001           conda-forge
  libiconv                          1.18            h4ce23a2_1                      conda-forge
  libjpeg-turbo                     3.1.0           hb9d3cd8_0                      conda-forge
  libkml                            1.3.0           hf539b9f_1021                   conda-forge
  liblapack                         3.9.0           31_hc41d3b0_mkl                 conda-forge
  libllvm20                         20.1.3          he9d0ab4_0                      conda-forge
  liblzma                           5.8.1           hb9d3cd8_0                      conda-forge
  libmagma                          2.8.0           h566cb83_2                      conda-forge
  libnetcdf                         4.9.2           nompi_h00e09a9_116              conda-forge
  libnghttp2                        1.64.0          h161d5f1_0                      conda-forge
  libnl                             3.11.0          hb9d3cd8_0                      conda-forge
  libnsl                            2.0.1           hd590300_0                      conda-forge
  libntlm                           1.8             hb9d3cd8_0                      conda-forge
  libnvjitlink                      12.8.93         h5888daf_1                      conda-forge
  libogg                            1.3.5           h4ab18f5_0                      conda-forge
  libopentelemetry-cpp              1.20.0          hd1b1c89_0                      conda-forge
  libopentelemetry-cpp-headers      1.20.0          ha770c72_0                      conda-forge
  libparquet                        19.0.1          h081d1f1_8_cpu                  conda-forge
  libpciaccess                      0.18            hd590300_0                      conda-forge
  libpng                            1.6.47          h943b412_0                      conda-forge
  libpq                             17.4            h27ae623_1                      conda-forge
  libprotobuf                       5.29.3          h501fc15_1                      conda-forge
  libre2-11                         2024.07.02      hba17884_3                      conda-forge
  librttopo                         1.1.0           hd718a1a_18                     conda-forge
  libsodium                         1.0.20          h4ab18f5_0                      conda-forge
  libspatialindex                   2.1.0           he57a185_0                      conda-forge
  libspatialite                     5.1.0           h366e088_13                     conda-forge
  libsqlite                         3.49.1          hee588c1_2                      conda-forge
  libssh2                           1.11.1          hf672d98_0                      conda-forge
  libstdcxx                         14.2.0          h8f9b012_2                      conda-forge
  libstdcxx-ng                      14.2.0          h4852527_2                      conda-forge
  libsystemd0                       257.4           h4e0b6ca_1                      conda-forge
  libtheora                         1.1.1           h4ab18f5_1006                   conda-forge
  libthrift                         0.21.0          h0e7cc3e_0                      conda-forge
  libtiff                           4.7.0           hd9ff511_4                      conda-forge
  libtorch                          2.6.0           cuda126_mkl_h9fa54b4_302        conda-forge
  libudev1                          257.4           hbe16f8c_1                      conda-forge
  libutf8proc                       2.10.0          h4c51ac1_0                      conda-forge
  libuuid                           2.38.1          h0b41bf4_0                      conda-forge
  libuv                             1.50.0          hb9d3cd8_0                      conda-forge
  libvorbis                         1.3.7           h9c3ff4c_0                      conda-forge
  libwebp-base                      1.5.0           h851e524_0                      conda-forge
  libxcb                            1.17.0          h8a09558_0                      conda-forge
  libxcrypt                         4.4.36          hd590300_1                      conda-forge
  libxkbcommon                      1.8.1           hc4a0caf_0                      conda-forge
  libxml2                           2.13.7          h4bc477f_1                      conda-forge
  libzip                            1.11.2          h6991a6a_0                      conda-forge
  libzlib                           1.3.1           hb9d3cd8_2                      conda-forge
  llvm-openmp                       20.1.3          h024ca30_0                      conda-forge
  llvmlite                          0.44.0          py312h374181b_1                 conda-forge
  locket                            1.0.0           pyhd8ed1ab_0                    conda-forge
  loguru                            0.7.2           py312h7900ff3_2                 conda-forge
  lz4                               4.3.3           py312hf0f0c11_2                 conda-forge
  lz4-c                             1.10.0          h5888daf_1                      conda-forge
  lzo                               2.10            hd590300_1001                   conda-forge
  mako                              1.3.10          pyhd8ed1ab_0                    conda-forge
  mapclassify                       2.8.1           pyhd8ed1ab_1                    conda-forge
  markupsafe                        3.0.2           py312h178313f_1                 conda-forge
  matplotlib-base                   3.10.1          py312hd3ec401_0                 conda-forge
  matplotlib-inline                 0.1.7           pyhd8ed1ab_1                    conda-forge
  mccabe                            0.7.0           pyhd8ed1ab_1                    conda-forge
  minizip                           4.0.9           h05a5f5f_0                      conda-forge
  mistune                           3.1.3           pyh29332c3_0                    conda-forge
  mkl                               2024.2.2        ha957f24_16                     conda-forge
  more-itertools                    10.7.0          pyhd8ed1ab_0                    conda-forge
  mpc                               1.3.1           h24ddda3_1                      conda-forge
  mpfr                              4.2.1           h90cbb55_3                      conda-forge
  mpmath                            1.3.0           pyhd8ed1ab_1                    conda-forge
  msgpack-python                    1.1.0           py312h68727a3_0                 conda-forge
  multidict                         6.4.3           py312h178313f_0                 conda-forge
  multimethod                       2.0             pyhd8ed1ab_0                    conda-forge
  munkres                           1.1.4           pyh9f0ad1d_0                    conda-forge
  mysql-common                      9.2.0           h266115a_0                      conda-forge
  mysql-libs                        9.2.0           he0572af_0                      conda-forge
  narwhals                          1.35.0          pyh29332c3_0                    conda-forge
  nbclient                          0.10.2          pyhd8ed1ab_0                    conda-forge
  nbconvert-core                    7.16.6          pyh29332c3_0                    conda-forge
  nbformat                          5.10.4          pyhd8ed1ab_1                    conda-forge
  nccl                              2.26.2.1        ha44e49d_1                      conda-forge
  ncurses                           6.5             h2d0b736_3                      conda-forge
  nest-asyncio                      1.6.0           pyhd8ed1ab_1                    conda-forge
  netcdf-fortran                    4.6.1           nompi_h22f9119_108              conda-forge
  netcdf4                           1.7.2           nompi_py312h21d6d8e_101         conda-forge
  networkx                          3.4.2           pyh267e887_2                    conda-forge
  nlohmann_json                     3.12.0          h3f2d84a_0                      conda-forge
  nodeenv                           1.9.1           pyhd8ed1ab_1                    conda-forge
  notebook-shim                     0.2.4           pyhd8ed1ab_1                    conda-forge
  numba                             0.61.2          py312h2e6246c_0                 conda-forge
  numba-progress                    1.1.0           pyhd8ed1ab_0                    conda-forge
  numcodecs                         0.15.1          py312hf9745cd_0                 conda-forge
  numpy                             2.2.5           py312h72c5963_0                 conda-forge
  openjpeg                          2.5.3           h5fbd93e_0                      conda-forge
  openldap                          2.6.9           he970967_0                      conda-forge
  openpyxl                          3.1.5           py312h710cb58_1                 conda-forge
  openssl                           3.5.0           h7b32b05_0                      conda-forge
  optree                            0.15.0          py312h68727a3_0                 conda-forge
  optuna                            4.3.0           pyhd8ed1ab_0                    conda-forge
  orc                               2.1.1           h17f744e_1                      conda-forge
  overrides                         7.7.0           pyhd8ed1ab_1                    conda-forge
  packaging                         25.0            pyh29332c3_1                    conda-forge
  pandas                            2.2.3           py312hf9745cd_3                 conda-forge
  pandocfilters                     1.5.0           pyhd8ed1ab_0                    conda-forge
  parso                             0.8.4           pyhd8ed1ab_1                    conda-forge
  partd                             1.4.2           pyhd8ed1ab_0                    conda-forge
  patsy                             1.0.1           pyhd8ed1ab_1                    conda-forge
  pcre                              8.45            h9c3ff4c_0                      conda-forge
  pcre2                             10.44           hba22ea6_2                      conda-forge
  pexpect                           4.9.0           pyhd8ed1ab_1                    conda-forge
  pickleshare                       0.7.5           pyhd8ed1ab_1004                 conda-forge
  pillow                            11.1.0          py312h80c1187_0                 conda-forge
  pip                               25.0.1          pyh8b19718_0                    conda-forge
  pixman                            0.44.2          h29eaf8c_0                      conda-forge
  pkgutil-resolve-name              1.3.10          pyhd8ed1ab_2                    conda-forge
  platformdirs                      4.3.7           pyh29332c3_0                    conda-forge
  plotly                            6.0.1           pyhd8ed1ab_0                    conda-forge
  pluggy                            1.5.0           pyhd8ed1ab_1                    conda-forge
  polartoolkit                      0.7.1           pyhd8ed1ab_0                    conda-forge
  pooch                             1.8.2           pyhd8ed1ab_1                    conda-forge
  pqdm                              0.2.0           pyhd8ed1ab_1                    conda-forge
  pre-commit                        4.2.0           pyha770c72_0                    conda-forge
  proj                              9.5.1           h0054346_0                      conda-forge
  prometheus-cpp                    1.3.0           ha5d0236_0                      conda-forge
  prometheus_client                 0.21.1          pyhd8ed1ab_0                    conda-forge
  prompt-toolkit                    3.0.51          pyha770c72_0                    conda-forge
  propcache                         0.3.1           py312h178313f_0                 conda-forge
  psutil                            7.0.0           py312h66e93f0_0                 conda-forge
  pthread-stubs                     0.4             hb9d3cd8_1002                   conda-forge
  ptyprocess                        0.7.0           pyhd8ed1ab_1                    conda-forge
  pugixml                           1.15            h3f63f65_0                      conda-forge
  pure_eval                         0.2.3           pyhd8ed1ab_1                    conda-forge
  pyarrow                           19.0.1          py312h7900ff3_0                 conda-forge
  pyarrow-core                      19.0.1          py312h01725c0_0_cpu             conda-forge
  pybind11                          2.13.6          pyh1ec8472_2                    conda-forge
  pybind11-global                   2.13.6          pyh415d2e4_2                    conda-forge
  pycparser                         2.22            pyh29332c3_1                    conda-forge
  pygments                          2.19.1          pyhd8ed1ab_0                    conda-forge
  pygmt                             0.15.0          pyhd8ed1ab_0                    conda-forge
  pykdtree                          1.4.1           py312hc0a28a1_0                 conda-forge
  pylint                            3.3.6           pyh29332c3_0                    conda-forge
  pyogrio                           0.10.0          py312h02b19dd_1                 conda-forge
  pyparsing                         3.2.3           pyhd8ed1ab_1                    conda-forge
  pyproj                            3.7.1           py312he630544_0                 conda-forge
  pysocks                           1.7.1           pyha55dd90_7                    conda-forge
  pytest                            8.3.5           pyhd8ed1ab_0                    conda-forge
  python                            3.12.10         h9e4cc4f_0_cpython              conda-forge
  python-cmr                        0.13.0          pyhff2d567_1                    conda-forge
  python-dateutil                   2.9.0.post0     pyhff2d567_1                    conda-forge
  python-dotenv                     1.1.0           pyh29332c3_1                    conda-forge
  python-fastjsonschema             2.21.1          pyhd8ed1ab_0                    conda-forge
  python-json-logger                2.0.7           pyhd8ed1ab_0                    conda-forge
  python-tzdata                     2025.2          pyhd8ed1ab_0                    conda-forge
  python_abi                        3.12            7_cp312                         conda-forge
  pytorch                           2.6.0           cuda126_mkl_py312_h9a1f04f_302  conda-forge
  pytz                              2025.2          pyhd8ed1ab_0                    conda-forge
  pyvista                           0.45.0          pyhd8ed1ab_1                    conda-forge
  pyyaml                            6.0.2           py312h178313f_2                 conda-forge
  pyzmq                             26.4.0          py312hbf22597_0                 conda-forge
  qhull                             2020.2          h434a139_5                      conda-forge
  qt6-main                          6.8.3           h6441bc3_2                      conda-forge
  rasterio                          1.4.3           py312h8cae83d_0                 conda-forge
  rav1e                             0.6.6           he8a937b_2                      conda-forge
  rdma-core                         57.0            h5888daf_0                      conda-forge
  re2                               2024.07.02      h9925aae_3                      conda-forge
  readline                          8.2             h8c095d6_2                      conda-forge
  referencing                       0.36.2          pyh29332c3_0                    conda-forge
  requests                          2.32.3          pyhd8ed1ab_1                    conda-forge
  rfc3339-validator                 0.1.4           pyhd8ed1ab_1                    conda-forge
  rfc3986-validator                 0.1.1           pyh9f0ad1d_0                    conda-forge
  rioxarray                         0.19.0          pyhd8ed1ab_0                    conda-forge
  rpds-py                           0.24.0          py312h3b7be25_0                 conda-forge
  rtree                             1.4.0           pyh11ca60a_1                    conda-forge
  s2n                               1.5.16          hba75a32_1                      conda-forge
  s3fs                              2025.3.2        pyhd8ed1ab_0                    conda-forge
  scikit-learn                      1.6.1           py312h7a48858_0                 conda-forge
  scipy                             1.15.2          py312ha707e6e_0                 conda-forge
  scooby                            0.10.0          pyhd8ed1ab_1                    conda-forge
  seaborn                           0.13.2          hd8ed1ab_3                      conda-forge
  seaborn-base                      0.13.2          pyhd8ed1ab_3                    conda-forge
  send2trash                        1.8.3           pyh0d859eb_1                    conda-forge
  setuptools                        79.0.0          pyhff2d567_0                    conda-forge
  shapely                           2.1.0           py312h21f5128_0                 conda-forge
  six                               1.17.0          pyhd8ed1ab_0                    conda-forge
  sleef                             3.8             h1b44611_0                      conda-forge
  snappy                            1.2.1           h8bd8927_1                      conda-forge
  sniffio                           1.3.1           pyhd8ed1ab_1                    conda-forge
  snuggs                            1.4.7           pyhd8ed1ab_2                    conda-forge
  sortedcontainers                  2.4.0           pyhd8ed1ab_1                    conda-forge
  soupsieve                         2.5             pyhd8ed1ab_1                    conda-forge
  sparse                            0.16.0          pyh1646c32_0                    conda-forge
  sqlalchemy                        2.0.40          py312h66e93f0_0                 conda-forge
  sqlite                            3.49.1          h9eae976_2                      conda-forge
  stack_data                        0.6.3           pyhd8ed1ab_1                    conda-forge
  statsmodels                       0.14.4          py312hc0a28a1_0                 conda-forge
  svt-av1                           3.0.2           h5888daf_0                      conda-forge
  sympy                             1.13.3          pyh2585a3b_105                  conda-forge
  synthetic_bathymetry_inversion    0.0.1           pypi_0                          pypi       
  tbb                               2021.13.0       hceb3a55_1                      conda-forge
  tblib                             3.1.0           pyhd8ed1ab_0                    conda-forge
  terminado                         0.18.1          pyh0d859eb_0                    conda-forge
  threadpoolctl                     3.6.0           pyhecae5ae_0                    conda-forge
  tinycss2                          1.4.0           pyhd8ed1ab_0                    conda-forge
  tinynetrc                         1.3.1           pyhd8ed1ab_0                    conda-forge
  tk                                8.6.13          noxft_h4845f30_101              conda-forge
  tomli                             2.2.1           pyhd8ed1ab_1                    conda-forge
  tomlkit                           0.13.2          pyha770c72_1                    conda-forge
  toolz                             1.0.0           pyhd8ed1ab_1                    conda-forge
  tornado                           6.4.2           py312h66e93f0_0                 conda-forge
  tqdm                              4.67.1          pyhd8ed1ab_1                    conda-forge
  traitlets                         5.14.3          pyhd8ed1ab_1                    conda-forge
  trame                             3.8.2           pyhd8ed1ab_0                    conda-forge
  trame-client                      3.7.1           pyhd8ed1ab_0                    conda-forge
  trame-server                      3.4.0           pyhd8ed1ab_0                    conda-forge
  triton                            3.2.0           cuda126py312h5a3d8a8_1          conda-forge
  types-python-dateutil             2.9.0.20241206  pyhd8ed1ab_0                    conda-forge
  typing-extensions                 4.13.2          h0e9735f_0                      conda-forge
  typing_extensions                 4.13.2          pyh29332c3_0                    conda-forge
  typing_utils                      0.1.0           pyhd8ed1ab_1                    conda-forge
  tzdata                            2025b           h78e105d_0                      conda-forge
  ukkonen                           1.0.1           py312h68727a3_5                 conda-forge
  unicodedata2                      16.0.0          py312h66e93f0_0                 conda-forge
  uri-template                      1.3.0           pyhd8ed1ab_1                    conda-forge
  uriparser                         0.9.8           hac33072_0                      conda-forge
  urllib3                           2.4.0           pyhd8ed1ab_0                    conda-forge
  utfcpp                            4.0.6           h005c6e1_0                      conda-forge
  verde                             1.8.1           pyhd8ed1ab_0                    conda-forge
  virtualenv                        20.30.0         pyhd8ed1ab_0                    conda-forge
  vtk-base                          9.3.1           qt_py312h6cb585f_216            conda-forge
  wayland                           1.23.1          h3e06ad9_0                      conda-forge
  wcwidth                           0.2.13          pyhd8ed1ab_1                    conda-forge
  webcolors                         24.11.1         pyhd8ed1ab_0                    conda-forge
  webencodings                      0.5.1           pyhd8ed1ab_3                    conda-forge
  websocket-client                  1.8.0           pyhd8ed1ab_1                    conda-forge
  wheel                             0.45.1          pyhd8ed1ab_1                    conda-forge
  widgetsnbextension                4.0.14          pyhd8ed1ab_0                    conda-forge
  wrapt                             1.17.2          py312h66e93f0_0                 conda-forge
  wslink                            2.3.3           pyhd8ed1ab_0                    conda-forge
  x265                              3.5             h924138e_3                      conda-forge
  xarray                            2025.3.1        pyhd8ed1ab_0                    conda-forge
  xcb-util                          0.4.1           hb711507_2                      conda-forge
  xcb-util-cursor                   0.1.5           hb9d3cd8_0                      conda-forge
  xcb-util-image                    0.4.0           hb711507_2                      conda-forge
  xcb-util-keysyms                  0.4.1           hb711507_0                      conda-forge
  xcb-util-renderutil               0.3.10          hb711507_0                      conda-forge
  xcb-util-wm                       0.4.2           hb711507_0                      conda-forge
  xerces-c                          3.2.5           h988505b_2                      conda-forge
  xesmf                             0.8.9           pyhd8ed1ab_0                    conda-forge
  xkeyboard-config                  2.43            hb9d3cd8_0                      conda-forge
  xorg-libice                       1.1.2           hb9d3cd8_0                      conda-forge
  xorg-libsm                        1.2.6           he73a12e_0                      conda-forge
  xorg-libx11                       1.8.12          h4f16b4b_0                      conda-forge
  xorg-libxau                       1.0.12          hb9d3cd8_0                      conda-forge
  xorg-libxcomposite                0.4.6           hb9d3cd8_2                      conda-forge
  xorg-libxcursor                   1.2.3           hb9d3cd8_0                      conda-forge
  xorg-libxdamage                   1.1.6           hb9d3cd8_0                      conda-forge
  xorg-libxdmcp                     1.1.5           hb9d3cd8_0                      conda-forge
  xorg-libxext                      1.3.6           hb9d3cd8_0                      conda-forge
  xorg-libxfixes                    6.0.1           hb9d3cd8_0                      conda-forge
  xorg-libxi                        1.8.2           hb9d3cd8_0                      conda-forge
  xorg-libxrandr                    1.5.4           hb9d3cd8_0                      conda-forge
  xorg-libxrender                   0.9.12          hb9d3cd8_0                      conda-forge
  xorg-libxt                        1.3.1           hb9d3cd8_0                      conda-forge
  xorg-libxtst                      1.2.5           hb9d3cd8_3                      conda-forge
  xorg-libxxf86vm                   1.1.6           hb9d3cd8_0                      conda-forge
  xrft                              1.0.1           pyhd8ed1ab_1                    conda-forge
  xyzservices                       2025.1.0        pyhd8ed1ab_0                    conda-forge
  yaml                              0.2.5           h7f98852_2                      conda-forge
  yarl                              1.20.0          py312h178313f_0                 conda-forge
  zarr                              3.0.7           pyhd8ed1ab_0                    conda-forge
  zeromq                            4.3.5           h3b0a872_7                      conda-forge
  zict                              3.0.0           pyhd8ed1ab_1                    conda-forge
  zipp                              3.21.0          pyhd8ed1ab_1                    conda-forge
  zlib                              1.3.1           hb9d3cd8_2                      conda-forge
  zstandard                         0.23.0          py312h66e93f0_1                 conda-forge
  zstd                              1.5.7           hb8e6e7a_2                      conda-forge

mdtanker avatar Apr 24 '25 08:04 mdtanker

Updating the bad environment's geopandas version to 1.0.1 didn't fix the issue.

mdtanker avatar Apr 24 '25 08:04 mdtanker

Downgrading the bad environments's zarr version to 2.18.7 didn't fix the issue.

mdtanker avatar Apr 24 '25 08:04 mdtanker

Installing cartopy 0.24 into the bad env didn't fix the issue.

mdtanker avatar Apr 24 '25 08:04 mdtanker

Running the code WORKS with an environment created with the below commands:

mamba create --name test_env --channel conda-forge pygmt geopandas cartopy

Installing Polartoolkit locally:

pip install -e . 

mdtanker avatar Apr 24 '25 09:04 mdtanker

Running the code FAILS with an environment created with the below commands :

mamba env create --file environment.yml --name test_env

Where environement.yml is defined below.

and installing polartoolkit locally:

pip install -e .
name: test_env
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python=3.12
  - invert4geom>=0.13
  - geopandas>=1.0
  - cartopy
  - ipykernel

mdtanker avatar Apr 24 '25 09:04 mdtanker

Running the code FAILS with an environment created with the below commands:

mamba create --name test_env --channel conda-forge pygmt geopandas cartopy invert4geom

Installing Polartoolkit locally:

pip install -e . 

Manually updating geopandas

mamba install geopandas=1.0

mdtanker avatar Apr 24 '25 09:04 mdtanker

Running the code WORKS with an environment created with the below commands :

mamba env create --file environment.yml --name test_env

Where environement.yml is defined below.

and installing polartoolkit locally:

pip install -e .
name: test_env
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python=3.12
  - geopandas
  - pygmt 
  - pyogrio
  - esmpy
  - xesmf
  - cmocean
  - jupyterlab_execute_time
  - adjusttext
  - boule
  - shapely
  - ipykernel
  - pre-commit
  - pylint
  - pytest
  - pip
  - pip:
      - kneebow

mdtanker avatar Apr 24 '25 09:04 mdtanker

From the above tests, it seems the issue happens when geopandas is installed AFTER polartoolkit. In future versions, when geopandas version is restricted to >=1, this shouldn't be an issue as the correct geopandas version will be installed through installing polartoolkit.

mdtanker avatar Apr 24 '25 09:04 mdtanker

This seems to be fixed with #252

mdtanker avatar Jun 04 '25 18:06 mdtanker

This still seems to be an issue. I seem to reliably fix it by uninstall Geopandas and PolarToolkit, then installing Geopandas first (with mamba), then separately installing PolarToolkit. I'll need to test this more to confirm this works.

mdtanker avatar Jun 19 '25 08:06 mdtanker

With some additional testing, it seems the (or an additional) cause of the segfault is when pytorch is installed. This may be related to this and this, which found the package pyinterp to cause seg faulting issues with PyGMT.

mdtanker avatar Aug 04 '25 13:08 mdtanker

Comparing the working environment with the broken one (with pytorch installed), the packages installed for pytorch include:

- cpython
- filelock
- gmp
- gmpy2
- libhwloc
- libtorch
- libuv
- llvm-openmp
- mkl
- mpc
- mpfr
- mpmath
- optree
- pybind11
- pybind11-global
- sleef
- sympy
- tbb

I individually included these packages, which showed the error resulted specifically from libtorch

mdtanker avatar Aug 04 '25 13:08 mdtanker

To see specifically what is causes the seg fault, I've tested each of the plotting functions in PolarToolkit with a working and broken environment, created as below:

Working: mamba env create polartoolkit --name ptk_working Broken: mamba env create polartoolkit libtorch --name ptk_error

The code below runs without error for the environment, but with the broken environment, I've commented which plotting functions cause errors.


from polartoolkit import fetch, maps, regions

ice_thickness = fetch.bedmap3(
    layer="ice_thickness",
    region=regions.amery_ice_shelf,
)

fig = maps.Figure(
    hemisphere="south",
    reg=regions.amery_ice_shelf,
)

# these commands work fine
fig.add_coast()
fig.add_gridlines()
fig.add_faults()
fig.add_modis()
fig.add_simple_basemap()
fig.add_scalebar()
fig.add_north_arrow()
fig.add_grid(ice_thickness, colorbar=False)

# these commands produce the below error:
# double free or corruption (out) Aborted (core dumped)
fig.add_inset() 
fig.add_box((1630e3, 2360e3, 530e3, 900e3)) 
fig.add_points(
    points=fetch.ghf(points=True, version="burton-johnson-2020"),
    colorbar=False,
)
fig.add_colorbar(grid=ice_thickness, hist=True) 

# this command produce the below error:
# Segmentation fault (core dumped)
fig.add_imagery() 

fig.show()

mdtanker avatar Aug 04 '25 14:08 mdtanker

Related to #https://github.com/GenericMappingTools/pygmt/issues/4038, which found the error to be from the combination of gmt 6.5.0 and liblapack installed from mkl, which can possibly avoided if the package nomkl is a dependency.

mdtanker avatar Aug 05 '25 10:08 mdtanker

Not an issue if using gmt 6.6.0, so this can be closed. If someone requires gmt 6.5.0, open an issue in gmt to back fix this.

mdtanker avatar Nov 06 '25 08:11 mdtanker