Skip to content

BUG: Python crashes with bad function arguments #22719

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
labodyn opened this issue Sep 15, 2018 · 12 comments · Fixed by #41712
Closed

BUG: Python crashes with bad function arguments #22719

labodyn opened this issue Sep 15, 2018 · 12 comments · Fixed by #41712
Labels
good first issue Needs Tests Unit test(s) needed to prevent regressions
Milestone

Comments

@labodyn
Copy link

labodyn commented Sep 15, 2018

Code Sample, a copy-pastable example if possible

import pandas as pd
s = pd.Series(range(10))
s.rolling(0).min()

Problem description

Python crashes instead of raising an Exception

Expected Output

raising an Exception

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-33-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.23.4
pytest: None
pip: 10.0.1
setuptools: 39.2.0
Cython: None
numpy: 1.15.0
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.4.0
sphinx: None
patsy: None
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.6.3
html5lib: 1.0.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

@labodyn labodyn changed the title Python crashes with bad pandas input Python crashes with bad function arguments Sep 15, 2018
@WillAyd
Copy link
Member

WillAyd commented Sep 15, 2018

Can you try on master? I got the following on macOS:

In [1]: import pandas as pd
   ...: s = pd.Series(range(10))
   ...: s.rolling(0).min()
   ...: 
Out[1]: 
0   NaN
1   NaN
2   NaN
3   NaN
4   NaN
5   NaN
6   NaN
7   NaN
8   NaN
9   NaN
dtype: float64

@WillAyd WillAyd added Needs Info Clarification about behavior needed to assess issue Window rolling, ewma, expanding labels Sep 15, 2018
@labodyn
Copy link
Author

labodyn commented Sep 18, 2018

Python crashes on master when executing code sample.

*** Error in `python': free(): invalid next size (fast): 0x000055ffdc1384b0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f3bb9d8c7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f3bb9d9537a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f3bb9d9953c]
/home/lander/pandas/pandas/_libs/window.cpython-37m-x86_64-linux-gnu.so(+0x26d28)[0x7f3b98d44d28]
/home/lander/pandas/pandas/_libs/window.cpython-37m-x86_64-linux-gnu.so(+0x71476)[0x7f3b98d8f476]
/home/lander/pandas/pandas/_libs/window.cpython-37m-x86_64-linux-gnu.so(+0x73316)[0x7f3b98d91316]
/home/lander/pandas/pandas/_libs/algos.cpython-37m-x86_64-linux-gnu.so(+0x4bce5)[0x7f3b9bab6ce5]

INSTALLED VERSIONS ------------------ commit: 1a12c41 python: 3.7.0.final.0 python-bits: 64 OS: Linux OS-release: 4.15.0-34-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8

pandas: 0.24.0.dev0+608.g1a12c41
pytest: None
pip: 10.0.1
setuptools: 40.2.0
Cython: 0.28.5
numpy: 1.15.1
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None

@labodyn
Copy link
Author

labodyn commented Sep 18, 2018

I have the bug both locally and on AWS.

@TomAugspurger
Copy link
Contributor

Did you install from our wheel on PyPI, or conda, or source?

@labodyn
Copy link
Author

labodyn commented Sep 19, 2018

installed from source, followed the install from github

@TomAugspurger
Copy link
Contributor

What's ldd --version and what version of gcc?

@labodyn
Copy link
Author

labodyn commented Sep 19, 2018

ldd (Ubuntu GLIBC 2.23-0ubuntu10) 2.23
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@simonjayhawkins
Copy link
Member

Can you try on master? I got the following on macOS:

just dies on Windows also..

$ python
Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> pd.__version__
'0.25.0rc0+59.g0437f6899'
>>> s = pd.Series(range(10))
>>> s.rolling(0).min()
(pandas-dev)

image

@mroeschke mroeschke added Windows Windows OS and removed Needs Info Clarification about behavior needed to assess issue labels Oct 20, 2019
@alimcmaster1 alimcmaster1 added the Linux Linux OS label Dec 27, 2019
@alimcmaster1
Copy link
Member

I get the same on same on Linux:

python           : 3.7.2.final.0
python-bits      : 64
OS               : Linux
OS-release       : 4.4.0-142-generic
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : None
LANG             : en_GB.UTF-8
LOCALE           : en_GB.UTF-8

Backtrace

*** Error in `python': free(): invalid next size (fast): 0x0000557805a6df60 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fd0871397e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fd08714237a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fd08714653c]
/home/alistair/dev-proj/pandas/pandas/_libs/window/aggregations.cpython-37m-x86_64-linux-gnu.so(+0x25c08)[0x7fd076708c08]
/home/alistair/dev-proj/pandas/pandas/_libs/window/aggregations.cpython-37m-x86_64-linux-gnu.so(+0x26663)[0x7fd076709663]
python(PyCFunction_Call+0x65)[0x557803ef9ef5]
python(+0x21aef7)[0x557803fd8ef7]
python(_PyObject_FastCallKeywords+0x49b)[0x557803f3846b]
python(_PyEval_EvalFrameDefault+0x4b86)[0x557803f92646]
python(_PyEval_EvalCodeWithName+0xab9)[0x557803ed3899]
python(_PyFunction_FastCallKeywords+0x387)[0x557803f37157]
python(_PyEval_EvalFrameDefault+0x6e6)[0x557803f8e1a6]
python(_PyEval_EvalCodeWithName+0xab9)[0x557803ed3899]
python(_PyFunction_FastCallDict+0x3dc)[0x557803ed43bc]
python(_PyObject_Call_Prepend+0x63)[0x557803eeb473]
python(PyObject_Call+0x6e)[0x557803ee019e]
python(_PyEval_EvalFrameDefault+0x1f3f)[0x557803f8f9ff]
python(_PyEval_EvalCodeWithName+0x2f9)[0x557803ed30d9]
python(_PyFunction_FastCallDict+0x1d4)[0x557803ed41b4]
python(_PyObject_Call_Prepend+0x63)[0x557803eeb473]
python(PyObject_Call+0x6e)[0x557803ee019e]
python(_PyEval_EvalFrameDefault+0x1f3f)[0x557803f8f9ff]
python(_PyEval_EvalCodeWithName+0x5da)[0x557803ed33ba]
python(_PyFunction_FastCallKeywords+0x387)[0x557803f37157]
python(_PyEval_EvalFrameDefault+0x4aa1)[0x557803f92561]
python(_PyEval_EvalCodeWithName+0x2f9)[0x557803ed30d9]
python(PyEval_EvalCodeEx+0x44)[0x557803ed3fa4]
python(PyEval_EvalCode+0x1c)[0x557803ed3fcc]
python(+0x22f664)[0x557803fed664]
python(+0xf43ea)[0x557803eb23ea]
python(PyRun_InteractiveLoopFlags+0xf3)[0x557803eb25a0]
python(+0xf4640)[0x557803eb2640]
python(+0xf50f5)[0x557803eb30f5]
python(_Py_UnixMain+0x3c)[0x557803ff8c4c]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fd0870e2830]
python(+0x1df982)[0x557803f9d982]

@mroeschke mroeschke added the Bug label Apr 3, 2020
@mroeschke mroeschke changed the title Python crashes with bad function arguments BUG: Python crashes with bad function arguments Oct 5, 2020
@mroeschke
Copy link
Member

I think this may be fixed on master now. Tested on Google Colab (Linux) and worked okay

import pandas as pd
print(pd.__version__)
print(pd.Series(range(10)).rolling(0).min())
import platform; print(platform.uname())

1.1.2
0   NaN
1   NaN
2   NaN
3   NaN
4   NaN
5   NaN
6   NaN
7   NaN
8   NaN
9   NaN
dtype: float64
uname_result(system='Linux', node='4bdb5881c2e9', release='4.19.112+', version='#1 SMP Thu Jul 23 08:00:38 PDT 2020', machine='x86_64', processor='x86_64')

@mroeschke mroeschke added good first issue Needs Tests Unit test(s) needed to prevent regressions and removed Bug Linux Linux OS Window rolling, ewma, expanding Windows Windows OS labels Oct 5, 2020
@Rasori
Copy link
Contributor

Rasori commented Feb 1, 2021

I could not reproduce the error with latest master on linux.

import pandas as pd
print(pd.__version__)
print(pd.Series(range(10)).rolling(0).min())
import platform; print(platform.uname())

1.3.0.dev0+592.g9c33e5e4f
0   NaN
1   NaN
2   NaN
3   NaN
4   NaN
5   NaN
6   NaN
7   NaN
8   NaN
9   NaN
dtype: float64
uname_result(system='Linux', node='Tupsulakki', release='5.8.0-41-generic', version='#46-Ubuntu SMP Mon Jan 18 16:48:44 UTC 2021', machine='x86_64', processor='x86_64')

@JannickTie
Copy link

Works fine on Windows with latest master

import pandas as pd
print(pd.__version__)
print(pd.Series(range(10)).rolling(0).min())
import platform; print(platform.uname())

1.3.0.dev0+1501.g70352c2a23
0   NaN
1   NaN
2   NaN
3   NaN
4   NaN
5   NaN
6   NaN
7   NaN
8   NaN
9   NaN
dtype: float64
uname_result(system='Windows', node='Cube', release='10', version='10.0.19041', machine='AMD64', processor='Intel64 Family 6 Model 94 Stepping 3, GenuineIntel')

@mroeschke mroeschke mentioned this issue May 29, 2021
15 tasks
@mroeschke mroeschke added this to the 1.3 milestone May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Needs Tests Unit test(s) needed to prevent regressions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants