Repository navigation
Closed
Description
I can get a segfault when not actually running any dask.dataframe computations. We've only called Pandas functions when setting up a computation.
Here is a small-ish example that never calls dask.compute and so should never actually trigger code in separate threads.
import pandas as pd
import dask.dataframe as dd
pdf1 = pd.DataFrame({'a': [1, 2, 6, 4, 4, 6, 4, 3, 7],
'b': [4, 2, 7, 3, 3, 1, 1, 1, 2]},
index=[0, 1, 3, 5, 6, 8, 9, 9, 9])
ddf = dd.from_pandas(pdf1, npartitions=3)
ddf1 = ddf
for ddkey, pdkey in [(ddf1.b + 1, pdf1.b + 1)]:
for ddof in [1, 2]:
pdf1.groupby(pdkey).a.var(ddof)
ddf1.groupby(ddkey).a.var(ddof)When run with Python normally
$ python gb_var.py
Segmentation fault (core dumped)
Running under GDB
mrocklin@workstation:~/workspace/dask$ gdb python gb_var.py
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...done.
"/home/mrocklin/workspace/dask/gb_var.py" is not a core dump: File format not recognized
(gdb) run
Starting program: /home/mrocklin/Software/anaconda/bin/python
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Python 3.4.4 |Anaconda 2.3.0 (64-bit)| (default, Jan 11 2016, 13:54:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gb_var
[New Thread 0x7fffeaa78700 (LWP 32619)]
[New Thread 0x7fffea277700 (LWP 32620)]
[New Thread 0x7fffe9a76700 (LWP 32621)]
[New Thread 0x7fffe9275700 (LWP 32622)]
[New Thread 0x7fffe8a74700 (LWP 32623)]
[New Thread 0x7fffe8273700 (LWP 32624)]
[New Thread 0x7fffe7a72700 (LWP 32625)]
[New Thread 0x7fffe7271700 (LWP 32626)]
[New Thread 0x7fffe357b700 (LWP 32628)]
[New Thread 0x7fffe2d7a700 (LWP 32629)]
[New Thread 0x7fffe2579700 (LWP 32630)]
[New Thread 0x7fffe1d78700 (LWP 32631)]
[New Thread 0x7fffe1577700 (LWP 32632)]
[New Thread 0x7fffe0d76700 (LWP 32633)]
[New Thread 0x7fffcbfff700 (LWP 32634)]
[New Thread 0x7fffcb7fe700 (LWP 32635)]
[New Thread 0x7fffcaffd700 (LWP 32636)]
[New Thread 0x7fffca7fc700 (LWP 32637)]
[New Thread 0x7fffc9ffb700 (LWP 32638)]
Program received signal SIGSEGV, Segmentation fault.
0x00007fffec963f88 in kh_get_pymap (key=0x7ffff7d82020 <PyBaseObject_Type>,
h=0x1fff00000209) at pandas/src/klib/khash_python.h:50
50 pandas/src/klib/khash_python.h: No such file or directory.
cc @jreback @jorisvandenbossche
In [4]: pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.4.4.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-96-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.19.0
nose: 1.3.7
pip: 8.1.2
setuptools: 23.0.0
Cython: 0.22.1
numpy: 1.11.0
scipy: 0.17.0
statsmodels: 0.6.1
xarray: 0.7.0
IPython: 5.1.0
sphinx: 1.3.3
patsy: 0.3.0
dateutil: 2.5.3
pytz: 2015.7
blosc: 1.3.2
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.5.1
matplotlib: 1.4.3
openpyxl: 1.8.5
xlrd: 0.9.3
xlwt: 1.0.0
xlsxwriter: 0.7.3
lxml: 3.4.4
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.5
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.0
pandas_datareader: None
Metadata
Metadata
Assignees
Labels
No labels
Activity
TomAugspurger commentedon Oct 5, 2016
Did you install pandas from source or conda / pip?
mrocklin commentedon Oct 5, 2016
Conda, default channel
On Wed, Oct 5, 2016 at 10:13 AM, Tom Augspurger [email protected]
wrote:
jcrist commentedon Oct 6, 2016
I found the issue here. I'm just going to push a commit to #1540 to fix it, as the other tests won't pass until the rest of the 0.19.0 stuff is fixed.
jcrist commentedon Oct 6, 2016
Fixed by 588d701. The segfault is caused by an unintentional evaluation of a dask series inside the call to
pandas_series.groupby. It might be important to find out why this fails in pandas, but I just fixed dask to not do that anymore.To trigger it in pandas + dask:
jreback commentedon Oct 6, 2016
@jcrist do you have a pure-pandas only segfault?
jcrist commentedon Oct 6, 2016
I don't - it has to do with pandas coercing a dask series to a pandas series in the call to
pandas_dataframe.groupby(dask_series). Somehow having thread activity inside the pandas groupby object is bad. (Note that the call above is on the pandas object, not on the dask object).jcrist commentedon Oct 6, 2016
Fixed (on the dask side at least) by #1540. Closing.