Skip to content

bad arguments to dataframe constructor causes segfault #26429

@kurtbrose

Description

@kurtbrose

Code Sample, a copy-pastable example if possible

pandas.DataFrame(data=(range(10), range(10, 20)), columns=('ones', 'twos'))
# python
Python 2.7.14 (default, Dec 12 2017, 16:55:09)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> pandas.DataFrame(data=(range(10), range(10, 20)), columns=('ones', 'twos'))
Segmentation fault

Problem description

Segmentation fault on bad inputs to DataFrame constructor.

Expected Output

Raise an exception:

AssertionError: 2 columns passed, passed data had 10 columns

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]

INSTALLED VERSIONS

commit: None
python: 2.7.14.final.0
python-bits: 64
OS: Linux
OS-release: 4.9.125-linuxkit
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: C.UTF-8
LOCALE: None.None

pandas: 0.24.2
pytest: 3.8.1
pip: 9.0.1
setuptools: 38.2.4
Cython: None
numpy: 1.16.3
scipy: None
pyarrow: None
xarray: None
IPython: 5.8.0
sphinx: None
patsy: None
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: 2.2.6
xlrd: None
xlwt: 1.3.0
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: 1.0.1
sqlalchemy: 1.1.11
pymysql: None
psycopg2: 2.7.3.2 (dt dec pq3 ext lo64)
jinja2: 2.9.6
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    DataFrameDataFrame data structureTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions