-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
read_json segfaults with Python 3.7 #22817
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
Hi @hmgaudecker I can replicate this, but the problem doesn't seem to be in the json-module. The following small program coredumps for me:
Small variations make it stop crashing. I believe something is writing to a stray pointer, perhaps inside of numpy. Likely somehow related to the ä-character, but I can't quite pinpoint how. |
Great, thanks. So the problem is that read_json attempts a type conversion internally and only continues with the object dtype upon failure? |
Well, the problem is that somewhere on the way to detecting what type actually is in the columns, pandas or numpy fails in their memory handling. Either by writing outside an area of memory they have allocated or by e.g. freeing some memory that is still is being used. The bug is in C or Cython-code but not in the json-module. My example code is just supposed to throw an exception, not dump core. |
This is in fact a cpython 3.7.0 bug in float() and will be fixed in python 3.7.1, which will be released in a week or two: |
Closing as this was a Python bug which has since been resolved |
Code Sample, a copy-pastable example if possible
Expected Output
Same thing, without the segfault. Everything works fine in a Python 3.6 conda environment.
Also noted by @bsolomon1124 in #11344
Output of
pd.show_versions()
commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Linux
OS-release: 4.13.0-46-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: 40.2.0
Cython: None
numpy: 1.15.1
scipy: None
pyarrow: None
xarray: None
IPython: 6.5.0
sphinx: 1.7.9
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: 1.0.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: