Skip to content

Segmentation fault in coast using -JE and -R+r modifier #9073

Closed

Description

@biggle1856

Description of the problem
Trying to draw an Azimuthal equidistant projection based on Singapore in order to show the full extent of SIA's route network.
Segmentation fault in coast (and only in coast) when I use the -R+r modifier

Full script that generated the error

gmt coast -Vd -R6.97229795181/-37.0769712136/278.20744191/7.44518494882r -JE103.989333/1.359211/17.7c -Glightgrey -pdf t

Full error message

coast [INFORMATION]: Selected ice front line as Antarctica coastline
coast [INFORMATION]: GSHHG version 2.3.7
coast [INFORMATION]: Derived from World Vector Shoreline, CIA WDB-II, and Atlas of the Cryosphere
coast [INFORMATION]: Processed by Paul Wessel and Walter H. F. Smith, 1994-2017
coast [DEBUG]: Running in PS mode modern
coast [DEBUG]: Use PS filename /home/jch/.gmt/sessions/gmt_session.88313/gmt_0.ps-
coast [DEBUG]: Create hidden PS file /home/jch/.gmt/sessions/gmt_session.88313/gmt_0.ps-
coast [DEBUG]: No figure file /home/jch/.gmt/sessions/gmt_session.88313/gmt.figures - nothing to do
coast [DEBUG]: Got session name as t and default graphics formats as pdf
coast [DEBUG]: Basemap order: Frame = above  Grid = above  Tick/Annot = below
pscoast (gmtlib_lonpath): Could not reallocate memory [68719476736.00 Gb, 9223372036854775809 items of 8 bytes]
pscoast (gmtlib_lonpath): Could not reallocate memory [68719476736.00 Gb, 9223372036854775809 items of 8 bytes]
ERROR: Caught signal number 11 (Segmentation fault) at
/usr/local/lib64/libgmt.so.6(gmtlib_lonpath+0x1ea) [0x7f88d5da3eaa]
[0x0]
Stack backtrace:
/usr/local/lib64/libgmt.so.6(gmt_sig_handler_unix+0xbd) [0x7f88d5d3ba6d]
/lib64/libc.so.6(+0x1a0b0) [0x7f88d2c210b0]
/usr/local/lib64/libgmt.so.6(gmtlib_lonpath+0x1ea) [0x7f88d5da3eaa]
/usr/local/lib64/libgmt.so.6(gmt_assemble_shore+0xc7f) [0x7f88d5cb5c9f]
/usr/local/lib64/libgmt.so.6(GMT_pscoast+0x56ae) [0x7f88d5f8ff9e]
/usr/local/lib64/libgmt.so.6(GMT_Call_Module+0x49e) [0x7f88d5c2ab5e]
gmt() [0x400b01]
/lib64/libc.so.6(+0x3681) [0x7f88d2c0a681]
/lib64/libc.so.6(__libc_start_main+0x88) [0x7f88d2c0a798]
gmt() [0x401855]

Actual outcome

Expected outcome

The above is a mwe of the error. The full script under GMT 6.6.0 produces

Image

System information

  • Operating system: Fedora 44
  • GMT version (gmt --version): 6.7.0_ac580b2

Activity

  1. added
    bug
    on Jun 26, 2026
  2. github-actions commented on Jun 26, 2026

    @github-actions
    Contributor

    👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!

    Please make sure you read our Contributing Guide and abide by our Code of Conduct.

  3. joa-quim commented on Jun 26, 2026

    @joa-quim
    Member

    You coast command doesn't crash for me (I'm on Windows) but it shows one of those stray gray edges running from the coastlines (see the right side. And this is -D dependent.

    gmt coast -R6.97229795181/-37.0769712136/278.20744191/7.44518494882r -JE103.989333/1.359211/17.7c -Glightgrey -Dc -png lixo
    
    Image
  4. joa-quim commented on Jun 26, 2026

    @joa-quim
    Member

    Hmmm, this smells so much to #9071

  5. Esteban82 commented on Jun 26, 2026

    @Esteban82
    Member

    It crashes for me on Linux.

    gmt coast -R6.97229795181/-37.0769712136/278.20744191/7.44518494882r -JE103.989333/1.359211/17.7c -Glightgrey -Dc -png lixo
    
    pscoast (gmtlib_lonpath): Could not reallocate memory [68719476736.00 Gb, 9223372036854775809 items of 8 bytes]
    pscoast (gmtlib_lonpath): Could not reallocate memory [68719476736.00 Gb, 9223372036854775809 items of 8 bytes]
    ERROR: Caught signal number 11 (Segmentation fault) at
    /usr/local/lib/libgmt.so.6(gmtlib_lonpath+0x1e1) [0x77dffbfddc61]
    [0x0]
    Stack backtrace:
    /usr/local/lib/libgmt.so.6(gmt_sig_handler_unix+0xee) [0x77dffbf732fe]
    /usr/lib/x86_64-linux-gnu/libc.so.6(+0x45cb0) [0x77dffba45cb0]
    /usr/local/lib/libgmt.so.6(gmtlib_lonpath+0x1e1) [0x77dffbfddc61]
    /usr/local/lib/libgmt.so.6(gmt_assemble_shore+0x12f1) [0x77dffbeee401]
    /usr/local/lib/libgmt.so.6(GMT_pscoast+0x5442) [0x77dffc1c2ed2]
    /usr/local/lib/libgmt.so.6(GMT_Call_Module+0x32d) [0x77dffbe6469d]
    gmt(+0x193d) [0x60f7478dd93d]
    /usr/lib/x86_64-linux-gnu/libc.so.6(+0x2a601) [0x77dffba2a601]
    /usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x88) [0x77dffba2a718]
    gmt(+0x27c5) [0x60f7478de7c5]
    
    
  6. added a commit that references this issue on Jul 15, 2026
  7. joa-quim commented on Jul 15, 2026

    @joa-quim
    Member

    I'm closing this because #9104 works around the problem and avoids the crash. But root cause is still to be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions