Skip to content
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: read_table crashes Python on surrogates #22748

Closed
Kojoley opened this issue Sep 18, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@Kojoley
Copy link

commented Sep 18, 2018

Code Sample

import io
import pandas as pd

b = io.BytesIO(b"\xB0")
t = io.TextIOWrapper(b, encoding='ascii', errors='surrogateescape')
pd.read_table(t)

Problem description

The pd.read_table(t) call crashes the interpreter.

Expected Output

At least it should throw an exception but not to crash the interpreter.

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.6.5.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.23.4
pytest: None
pip: 18.0
setuptools: 39.0.1
Cython: None
numpy: 1.14.3
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

@chris-b1

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2018

ref #22610 on the writing side. No idea what's actually going wrong here, but would welcome investigation/PR - probably start by looking at the backtrace on the crash. Thanks for the simple reproducing case.

@chris-b1 chris-b1 added this to the Contributions Welcome milestone Sep 18, 2018

troels added a commit to troels/pandas that referenced this issue Sep 18, 2018

BUG: read_table and read_csv crash (pandas-dev#22748)
A missing null-pointer check made read_table and read_csv prone
to crash on badly encoded text. Add null-pointer check.

@troels troels referenced this issue Sep 18, 2018

Merged

BUG: read_table and read_csv crash (#22748) #22750

4 of 4 tasks complete

troels added a commit to troels/pandas that referenced this issue Sep 18, 2018

BUG: nlargest/nsmallest gave wrong result (pandas-dev#22748)
When asking for the n largest/smallest rows in a dataframe
nlargest/nsmallest sometimes failed to differentiate
the correct result based on the latter columns.

troels added a commit to troels/pandas that referenced this issue Sep 18, 2018

BUG: read_table and read_csv crash (pandas-dev#22748)
A missing null-pointer check made read_table and read_csv prone
to crash on badly encoded text. Add null-pointer check.

troels added a commit to troels/pandas that referenced this issue Sep 19, 2018

BUG: read_table and read_csv crash (pandas-dev#22748)
A missing null-pointer check made read_table and read_csv prone
to crash on badly encoded text. Add null-pointer check.

troels added a commit to troels/pandas that referenced this issue Sep 23, 2018

BUG: read_table and read_csv crash (pandas-dev#22748)
A missing null-pointer check made read_table and read_csv prone
to crash on badly encoded text. Add null-pointer check.

@jreback jreback modified the milestones: Contributions Welcome, 0.24.0 Sep 23, 2018

troels added a commit to troels/pandas that referenced this issue Sep 23, 2018

BUG: read_table and read_csv crash (pandas-dev#22748)
A missing null-pointer check made read_table and read_csv prone
to crash on badly encoded text. Add null-pointer check.

gfyoung added a commit that referenced this issue Sep 24, 2018

BUG: read_table and read_csv crash (#22750)
A missing null-pointer check made read_table and read_csv prone
to crash on badly encoded text. Add null-pointer check.

Closes gh-22748.

Sup3rGeo added a commit to Sup3rGeo/pandas that referenced this issue Oct 1, 2018

BUG: read_table and read_csv crash (pandas-dev#22750)
A missing null-pointer check made read_table and read_csv prone
to crash on badly encoded text. Add null-pointer check.

Closes pandas-devgh-22748.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.