Skip to content

Kernel crashing when setting region in grdfill #1745

Closed

Description

@willschlitzer

When trying to set the region on grdfill, it routinely causes my notebook to crash (I'm using Jupyter Lab). There don't appear to be any issues when I don't set the region.

Getting the grid file

grid = load_static_earth_relief()
grid[3:6, 3:5] = np.nan
grid[6:8, 2:4] = np.inf

Code that didn't cause any error

result = pygmt.grdfill(grid=grid, mode="c20")

Full code that generated the error

result = pygmt.grdfill(grid=grid, mode="c20", region=[-55, -50, -24, -16])

Full error message

I don't get a Python error message when this crashes. This is what pops up:
image

System information

Please paste the output of python -c "import pygmt; pygmt.show_versions()":

PyGMT information:
  version: v0.5.1.dev74+g3b896adc.d20220207
System information:
  python: 3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:41:03)  [GCC 9.4.0]
  executable: /home/will/miniconda3/envs/pygmt-dev/bin/python
  machine: Linux-5.13.0-28-generic-x86_64-with-glibc2.31
Dependency information:
  numpy: 1.21.4
  pandas: 1.3.3
  xarray: 0.21.1
  netCDF4: 1.5.7
  packaging: 21.3
  ghostscript: 9.54.0
  gmt: 6.3.0
GMT library information:
  binary dir: /home/will/miniconda3/envs/pygmt-dev/bin
  cores: 12
  grid layout: rows
  library path: /home/will/miniconda3/envs/pygmt-dev/lib/libgmt.so
  padding: 2
  plugin dir: /home/will/miniconda3/envs/pygmt-dev/lib/gmt/plugins
  share dir: /home/will/miniconda3/envs/pygmt-dev/share/gmt
  version: 6.3.0

Activity

  1. added
    bug
    on Feb 12, 2022
  2. seisman commented on Mar 5, 2022

    @seisman
    Member

    Here is a full script to reproduce the issue:

    import numpy as np
    import pygmt
    from pygmt.helpers.testing import load_static_earth_relief
    
    grid = load_static_earth_relief()
    grid[3:6, 3:5] = np.nan
    grid[6:8, 2:4] = np.inf
    result = pygmt.grdfill(grid=grid, mode="c20", region=[-54, -50, -23, -16])
    

    Ping @meghanrjones or @PaulWessel

  3. added
    upstream
    on Mar 5, 2022
  4. PaulWessel commented on Mar 5, 2022

    @PaulWessel

    Unless Conda and the python ecosystem now fully supports M1 architecture then I am unable to debug this here. @seisman, do you know if there has been progress on that front?

    dlopen(/Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/xbuild/src/Debug/libgmt.dylib, 0x0006): tried: '/Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/xbuild/src/Debug/libgmt.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libgmt.dylib' (no such file), '/usr/lib/libgmt.dylib' (no such file), '/Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/xbuild/src/Debug/libgmt.6.4.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libgmt.6.4.0.dylib' (no such file), '/usr/lib/libgmt.6.4.0.dylib' (no such file)

  5. maxrjones commented on Mar 5, 2022

    @maxrjones
    Member

    I debugged this yesterday and have a fix implemented (sorry for not posting an update promptly). I am still working on a regression test. I'll open a PR on Monday.

  6. self-assigned this
    on Mar 6, 2022
  7. added this to the 0.6.1 milestone on Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugupstream

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions