-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Rolling min/max gives malloc error #30726
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
Comments
In order to reproduce this, could you try to save the arguments passed to the last line ( |
Hi, Sorry to get back to this so late. |
I have encountered the same issue with a time series with shape (1963583, 1). I wanted to compute hour-long windows for a month of data with a resolution of 1 second. (This may sound like a bad idea, and it is, but since rolling() does not offer a stride argument (see Issue #15354) the 'official' way is to compute 99.9% useless windows and throw the ones you don't need away). Running I hope this is enough info to reproduce the error, but I guess it is very dependent on the system after all. pandas: 1.0.3 |
I can reproduce this behaviour with this code snippet:
When using
With
Output of
Edit:
In this case the memory does not grow, so using
This suggests that the issue is somewhere in |
@s-scherrer Perfect, thank you. |
This fixes at least the reproducible part of pandas-dev#30726, however, I am not totally sure what is going on here. Tests have shown that there are two solutions that avoid growing memory usage: - pass memoryviews (float64_t[:]) instead of ndarray[float64_t] - remove starti and endi as arguments to _roll_min_max_fixed This commit implements both.
This fixes at least the reproducible part of pandas-dev#30726, however, I am not totally sure what is going on here. Tests have shown that there are two solutions that avoid growing memory usage: - pass memoryviews (float64_t[:]) instead of ndarray[float64_t] - remove starti and endi as arguments to _roll_min_max_fixed This commit implements both.
Hi there, I see you have a fix for this, but this issue is added to the 1.1 milestone, which is 1st of August. Are not you going to fix it till August or at August with the 1.1 release? If not and we'll have the fix sooner, what was the reason for adding it to 1.1 milestone? Do you have a priority or severity mark? Why this (and some other similar issues, there are also duplicates, other people reported you same -- see #32266 for example) is not marked with high priority/urgent bug? Do you understand that many apps crash since the release of pandas 1.0 all around the world because many libs use rolling.min/max? I wonder how it's managed... |
Code Sample
Problem description
The above snippet is part of a function called in my main script. Running this results in either a
malloc: Incorrect checksum for freed object 0x7fbf626f1f30: probably modified after being freed.
error or a segmentation fault.The culprit appears to be the
rolling().max()
line, since commenting out the line fixes the issue, as does replacing.max()
with.mean()
.I can't seem to recreate the error running the above snippet alone, and I cannot figure out why. The input (
bw_img
) is just a 2D array (black and white image).It might be related to this issue #25893 expect my memory doesn't seem to be leaking. The two variants I keep seeing seem to be a checksum failed after changing deallocated memory, or that an attempted change of deallocated memory is caught.
python version: 3.6.5 (also tested on 3.7.0)
pandas version 0.25.3 (also tested 0.24 and 0.23)
Below the stacktrace:
The text was updated successfully, but these errors were encountered: