-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
BUG: pandas 1.5.2 segfault with pypy 3.9-7.3.11 #50817
Comments
Thanks for reporting this. I'll try to take a look at this over the weekend. Do note, though, that PyPy is not one of our officially supported platforms. I set up the infrastructure to test pandas on PyPy a long while back, but as of right now it basically only tests that compiling pandas on PyPy works (the tests are allowed to fail without failing our CI checks). |
Thank you, I’m aware it is best effort. FYI 1.4.4 works. |
It seems that those tests have been segfaulting as well for a long time. It already fails on pytest initialization (reading of conftest?) or collection:
The failure is visible in the CI logs as far back as the logs are still available, and based on the time that the build takes (that is still visible for older builds), it seems to certainly go back to 1.5.0rc0. I can also reproduce this locally, and the gdb backtrace confirms the relationship with Timedelta:
|
And I can also reproduce this with a simple Timedelta call:
|
Sorry for the silence here, was traveling over the past day, and thanks for the assistance in debugging Joris. Something is going wrong in calling the function _ensure_components()
is the code used to call _ensure_components. However, |
Maybe the problem is since days is defined by datetime.timedelta here. Best guess is that cython is getting confused between the cdef'ed days and the Python property days. Renaming days to days1, seconds to seconds1, and microseconds to microseconds1 fixed it for me. |
Hi! I'm also encountering a similar issue on this. Happened when I'm using the resample() function on a dataframe with DateTimeIndex. So I guess there's no timeline yet, for when this will be fixed? python: 3.9.16 |
This might be a problem with PyPy itself and the order in which it tries to construct the class. I think the property should have access to other attributes / methods on self, so |
TL;DR: the problem is due to PyPy, not Cython nor pandas. The problem is:
The solution is for PyPy to not assume it can call the Please ping me on any issues with @pypy |
Thanks @mattip! |
Closing since this seems to works now. |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the [main branch] (https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
Reproducible Example
Issue Description
Segmentation fault when using pypy 3.9-7.3.11 with pandas 1.5.2
Expected Behavior
no segfault
Installed Versions
The text was updated successfully, but these errors were encountered: