A Friday 18 December 2009 20:47:16 Anthony Foglia escrigué:
> I'm still trying to track down the errors I had earlier this week, but
> in the meantime, we've found a bigger one. PyTables crashes when
> opening a file with an attribute of the root node with the value "0.".
> It can write attributes like that fine, but when it tries to read
> there's a crash.
>
> I've tracked the problem down to a bug in Python 2.6.4's cPickle
> module. Until Python fixes the bug (it might be fixed already in 2.7, I
> don't know), would it make sense to add a parameter to shut off
> automatic depickling of attributes?
>
> Here's a history of my simple test:
>
> $ ipython
> In [1]: import tables
>
> In [2]: fyle = tables.openFile("crash_test.h5",mode="a")
>
> In [3]: fyle.root._v_attrs
> Out[3]:
> /._v_attrs (AttributeSet), 4 attributes:
> [CLASS := 'GROUP',
> PYTABLES_FORMAT_VERSION := '2.0',
> TITLE := '',
> VERSION := '1.0']
>
> In [4]: fyle.root._v_attrs.trouble = "0."
>
> In [5]: fyle.root._v_attrs
> Out[5]:
> /._v_attrs (AttributeSet), 5 attributes:
> [CLASS := 'GROUP',
> PYTABLES_FORMAT_VERSION := '2.0',
> TITLE := '',
> VERSION := '1.0',
> trouble := '0.']
>
> In [6]: fyle.close()
>
> In [7]:
> Do you really want to exit ([y]/n)?
>
> $ ipython
> In [1]: import tables
>
> In [2]: fyle = tables.openFile("crash_test.h5")
> Segmentation fault (core dumped)
>
> $ ipython
> In [1]: import cPickle
>
> In [2]: cPickle.loads("0.")
> Segmentation fault (core dumped)
Mmh, I cannot reproduce the bug with python 2.6.1:
In [2]: import cPickle
In [3]: cPickle.loads("0.")
---------------------------------------------------------------------------
UnpicklingError Traceback (most recent call last)
/home/faltet/PyTables/pytables/trunk/<ipython console> in <module>()
UnpicklingError: unpickling stack underflow
which is the expected error. In fact, your pytables example works well for
me. That's weird...
--
Francesc Alted
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users