You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to plot two vectors using the following script. It works well if pen is set to 1p,black (i.e. a simple line), but crashes if set to 1p,black+ve0.2c. Actually, the first plot works, but the second one crashes.
python(64354,0x11ac3bdc0) malloc: *** error for object 0x7f8f28e50900: pointer being freed was not allocated
python(64354,0x11ac3bdc0) malloc: *** set a breakpoint in malloc_error_break to debug
[1] 64354 abort python test.py
Could it be that GMT does not have good support for float64 and uses float32 by default?
Anyway, for plotting float64 values are probably not needed, so all float64 data should probably converted to float32 in the wrapper.
Activity
[-]pygmt crashes when plotting vectors[/-][+]plot crashes when plotting vectors[/+]weiji14 commentedon Mar 31, 2020
I can reproduce the same crash, with GMT 6.0 on Linux and using the pygmt master branch. The corresponding code in GMT works though:
produces:
Not much of a clue as to why it's crashing though 🤷♂️
d-murashkin commentedon May 8, 2020
Also crushes on the second plot, but
does not crush if integer values are used.
That is
works fine
also works fine
does not work
Seems like the issue is related to floating point numbers,
also the data for later plots is converted to the data type of the first plot.
d-murashkin commentedon May 8, 2020
I might have found a solution:
convert all floating point numbers to float32 (float64 is default)
The following works with no error:
Could it be that GMT does not have good support for float64 and uses float32 by default?
Anyway, for plotting float64 values are probably not needed, so all float64 data should probably converted to float32 in the wrapper.
[-]plot crashes when plotting vectors[/-][+]plot crashes when plotting arrows [/+]Fix a bug when passing data to GMT in Session.open_virtual_file()
Fix a bug when passing data to GMT in Session.open_virtual_file() (#490)