Skip to content

rolling on 0 window causes core dump #21286

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

Closed
PabTorre opened this issue Jun 1, 2018 · 2 comments · Fixed by #21291
Closed

rolling on 0 window causes core dump #21286

PabTorre opened this issue Jun 1, 2018 · 2 comments · Fixed by #21291
Labels
Bug Error Reporting Incorrect or improved errors from pandas Window rolling, ewma, expanding
Milestone

Comments

@PabTorre
Copy link

PabTorre commented Jun 1, 2018

pd.version == 0.22.0

import pandas as pd
series = pd.Series(range(1000))
series.rolling(0).min()

Problem description

Attempting to perform an operation on a series.rolling with window=0

kills the kernel if running with jupyter.

causes a core dump if running directly from python.

free(): invalid next size (fast): 0x00007fffbfcc5040 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7fe14e0b0bfb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7fe14e0b6fc6]
...

Expected Output

Should raise a ValueError instead of crashing.

@chris-b1 chris-b1 added Bug Error Reporting Incorrect or improved errors from pandas labels Jun 1, 2018
@chris-b1 chris-b1 added this to the Next Major Release milestone Jun 1, 2018
@chris-b1
Copy link
Contributor

chris-b1 commented Jun 1, 2018

Thanks for the report, yep should raise!

uds5501 added a commit to uds5501/pandas that referenced this issue Jun 2, 2018
Added a raise Value Error for case when window==0, Kindly refer to issue pandas-dev#21286 for the same
@jreback jreback modified the milestones: Next Major Release, 0.23.2, 0.23.1 Jun 8, 2018
@WillAyd WillAyd added the Window rolling, ewma, expanding label Sep 4, 2018
@lumbric
Copy link

lumbric commented Dec 4, 2018

I stumbled upon code where rolling() is called with window=0 but the code runs fine without error. No segfault occurred. I haven't figured out why it doesn't crash in my case. Just as warning to future users of older pandas versions: passing window=0 might silently produce wrong results without crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error Reporting Incorrect or improved errors from pandas Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants