PyGMT 0.6 / GMT 6.3.0 crashes when plotting polygons in combination with a date/time axes

Is it ok to post a PyGMT bug report here? The code below causes a crash on the plot command, when using PyGMT 0.6 and GMT 6.3.0. It worked/works as expected when using the older PyGMT 0.4 and GMT 6.2.0.

I’ve also tried the equivalent shell commands with GMT 6.3.0 (so without Python and by using an external file for providing the polygon coordinates), and this does still work ok, so I guess the issue was introduced in a recent version of PyGMT.

Here’s the basic code example:

import pygmt
fig = pygmt.Figure()
fig.basemap(region=["2021-01-01","2021-01-15",0,1], projection='X10cT/10c', frame=True)
fig.plot(x=["2021-01-01", "2021-01-05", "2021-01-10", "2021-01-15"], y=[0.75, 0.25, 0.4, 0.8], color='blue')
fig.show()

I get the following error messages:

Python(16886,0x1154ae600) malloc: *** error for object 0x6000006adde0: pointer being freed was not allocated
Python(16886,0x1154ae600) malloc: *** set a breakpoint in malloc_error_break to debug

Not sure if this plays a role (probably not), but I’ve installed PyGMT using pip (in pipenv) and GMT using the MacOS .dmg, after which I’ve ‘fixed’ the GMT library for use with PyGMT using the script in this issue: https://github.com/GenericMappingTools/gmt/issues/1930

I can reproduce your issue with GMT 6.3.0, but it works well with the GMT dev version, so I think it’s a GMT bug which has been fixed recently.

Thanks, that’s good news. I can probably get by by using a python environment with pyGMT 0.4 until the next GMT version comes out then.

If you’re a conda user, you can install the GMT dev version using conda install gmt -c conda-forge/label/dev. Or if you’re a Homebrew users, you can use brew install gmt --HEAD.

Thanks again for these good suggestions. I’m using macports and pipenv at the moment, but I’ll keep this in mind.