-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure.plot: Crash for pd.DataFrame input containing floats when using "data" and "incols" #2637
Comments
I can reproduce the bug on Linux. If
If
Here is the diff: < plot [INFORMATION]: Duplicating data table from user 4 column arrays of length 4
< plot [DEBUG]: Object ID 1 : Registered Data Table Memory Copy 560d93e51980 as an Input resource with geometry Point [n_objects = 2]
---
> plot [INFORMATION]: Referencing data table from user 4 column arrays of length 4
> plot [DEBUG]: Object ID 1 : Registered Data Table Memory Reference 55c909f971a0 as an Input resource with geometry Point [n_objects = 2]
26,29c26
< plot [DEBUG]: GMT_Destroy_Data: freed memory for a Data Table for object 1
< plot [DEBUG]: gmtlib_unregister_io: Unregistering object no 1 [n_objects = 1]
< plot [DEBUG]: gmtlib_unregister_io: Object no 1 has non-NULL resource pointer
< plot [DEBUG]: Current size of half-baked PS file /home/seisman/.gmt/sessions/gmt_session.1478556/gmt_1.ps- = 23633.
---
> free(): invalid next size (fast) So, for the integer-type case, data is duplicated, but for the float-type case, data is used by reference. @PaulWessel Need your help. |
How is the DataFrame passed to GMT? Via matrix? Also, this looks like a bad sign |
It's passed via |
Here are the values used in
|
Not clear. Might you share a minimal example that (1) loads the data frame, (2) passes it to some simple module like gmtconvert (assuming that also crashes)? Think I need to debug. |
Tried to pass the same dataset to
The verbose messages are:
|
For the example in #2637 (comment), if I add |
If I try this:
and run
I get no errors and this plot What am I missing? |
@yvonnefroehlich said "For me, this issue occurs under Windows but not under Linux.". Now I can reproduce the issue under Linux, but you can't reproduce it under macOS. Need to find out why the behavior is system-dependent. |
Need a Linux or Win (@joa-quim ) person to run in debug and determine WTF is going on. I cannot. |
I could try to start my python learning through a debug session but for that I would need that PyGMT was able to find my |
Just set the |
OK, but when I said |
PyGMT will try to find gmt.dll, gmt_w32.dll and gmt_w64.dll |
Good, thanks. |
Tried to debug this issue. It seems
Actually it crashes in the
|
Ping @PaulWessel Does the above debugging help? |
Yes, I got the same. Will debug again to see exactly that data is internally allocated. Not sure why that would crash, but it does. |
Since I cannot reproduce it (works for macOS) and I cannot see why this would depend on the OS I cannot really help. Someone would need to debug in Linux but not sure what to look fore. segment->data is allocated in GMT so fair game to free as long as we dont free the read-only vectors. |
Description of the problem
Under specific circumstances,
Figure.plot
does not work if apandas.DataFrame
is passed to thedata
parameter and a column order is selected viaincols
. The issue does not occur in case thepd.DataFrame
contains only integers. If the desired columns are passed directly to thex
andy
parameters, the code works well. For me, this issue occurs under Windows but not under Linux.For context, see PR #2515 up on comment #2515 (comment)
Maybe related to the issues in
Minimal Complete Verifiable Example
Output of
verbose="d"
Full error message
System information
The text was updated successfully, but these errors were encountered: