You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't limited to variable length string dtypes:
In [1]: import numpy as np
In [2]: import h5py
In [3]: f = h5py.File('foo.h5')
In [4]: ds = f.create_dataset('/x', shape=(20, 24), dtype=np.dtype([('a', 'i4'), ('b', 'i4')]), chunks=(4, 6))
In [5]: ds
Out[5]: # crashes the interpreter
I don't know if it is a conda only problem. As far as I can tell, we are compiling hdf5 and h5py correctly.
From what I'm seeing, the difference is the conda packages is linking against the latest hdf5 library (1.8.15patch1). Is there a change between 1.8.14 and 1.8.15patch1 that might have affected h5py?
When using hdf5 1.8.15patch and h5py 2.5.0, the interpreter crashes running the test suite. When using hdf5 1.8.14 and h5py 2.5.0, the test suite passes.
I am facing what seems to be the same issue, but for reading dataset containing strings. I cloned master and used setuptools to install on both conda and cygwin. Occurs only with conda, not with cygwin on the same (windows 7) system.
However, I think we can agree that this is a bug and this workaround is a band-aid. I am also using the latest h5py and hdf5 packages from conda on Windows 64 bit.
I'll add that I'm also getting a segfault with boolean attributes. (My workaround is to just store them as ints and then restore to bool when loading.)
I can confirm the the issue with arrays of variable length strings. jdreaver's workaround also seems to work, albeit only with dtype=np.string_. Trying to use h5py's special dtypes, e.g., dt = h5py.special_dtype(vlen=str), from the documentation still ends with a segfault.
This DOES appear to be a conda issue. No such troubles using WinPython (python 3.4, 64 bit).
We are facing exactly the same symptoms with Python 3.5 64-bit and h5py 2.6. A create_dataset command without a list wrapping the dataset name crashes the interpreter. Also we tried h5py.run_tests() and it works fine.
Activity
rossant commentedon Jul 3, 2015
it seems like i have exactly the same problem with booleans. fixed by casting to an int
groutr commentedon Jul 7, 2015
I'm pretty sure this is related.
PyTables/PyTables#471
cpcloud commentedon Jul 7, 2015
This isn't limited to variable length string dtypes:
cgohlke commentedon Jul 8, 2015
I can't reproduce these crashes with the builds from http://www.lfd.uci.edu/~gohlke/pythonlibs/#h5py
groutr commentedon Jul 10, 2015
I can confirm that Python 3.4 on Windows 32bit does not seem to be affected by this issue.
rossant commentedon Jul 10, 2015
is this a conda-only problem?
groutr commentedon Jul 10, 2015
I don't know if it is a conda only problem. As far as I can tell, we are compiling hdf5 and h5py correctly.
From what I'm seeing, the difference is the conda packages is linking against the latest hdf5 library (1.8.15patch1). Is there a change between 1.8.14 and 1.8.15patch1 that might have affected h5py?
When using hdf5 1.8.15patch and h5py 2.5.0, the interpreter crashes running the test suite. When using hdf5 1.8.14 and h5py 2.5.0, the test suite passes.
cgohlke commentedon Jul 11, 2015
I rebuilt against
HDF5 1.8.15-patch1: No crashes.groutr commentedon Jul 11, 2015
Hmmm....Maybe it is just affecting the conda builds. I'll look over things again today.
groutr commentedon Jul 31, 2015
I'm wondering if threadsafe in hdf5 has anything to do with this. @cgohlke, are you compiling your hdf5 windows binaries with
HDF5_ENABLE_THREADSAFE?cgohlke commentedon Jul 31, 2015
HDF5_ENABLE_THREADSAFE? No, not for h5py and pytables.subhacom commentedon Aug 22, 2015
I am facing what seems to be the same issue, but for reading dataset containing strings. I cloned master and used setuptools to install on both conda and cygwin. Occurs only with conda, not with cygwin on the same (windows 7) system.
jdreaver commentedon Sep 10, 2015
I am experiencing the same issue. If I set an attribute using a string, I get a segfault. It is fixed if I wrap the string in an array:
However, I think we can agree that this is a bug and this workaround is a band-aid. I am also using the latest
h5pyandhdf5packages from conda on Windows 64 bit.jdreaver commentedon Sep 23, 2015
I'll add that I'm also getting a segfault with boolean attributes. (My workaround is to just store them as ints and then restore to bool when loading.)
evangroopman commentedon Sep 24, 2015
I can confirm the the issue with arrays of variable length strings. jdreaver's workaround also seems to work, albeit only with dtype=np.string_. Trying to use h5py's special dtypes, e.g., dt = h5py.special_dtype(vlen=str), from the documentation still ends with a segfault.
This DOES appear to be a conda issue. No such troubles using WinPython (python 3.4, 64 bit).
Rebuilding h5py with pip from cgohlke's page http://www.lfd.uci.edu/~gohlke/pythonlibs/#h5py fixes the issue, too, in the conda distro.
jpiersol commentedon Nov 5, 2015
This seems to be fixed in the latest Win64 Anaconda release (Anaconda 2.4.0/Python 3.5).
jdreaver commentedon Nov 5, 2015
Thanks for the heads up @jpiersol!
TheQuantumPhysicist commentedon Feb 9, 2017
We are facing exactly the same symptoms with Python 3.5 64-bit and h5py 2.6. A
create_datasetcommand without a list wrapping the dataset name crashes the interpreter. Also we triedh5py.run_tests()and it works fine.