Mailing List Archive

[issue1672332] cPickle cannot unpickle subnormal floats on some machines
Mark Dickinson <dickinsm@gmail.com> added the comment:

Change title; this has nothing to do with 64 bit.

----------
title: cPickle can pickle, but cannot unpickle on 64bit machines -> cPickle cannot unpickle subnormal floats on some machines

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue1672332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1672332] cPickle cannot unpickle subnormal floats on some machines [ In reply to ]
Mark Dickinson <dickinsm@gmail.com> added the comment:

Here's a patch, against the trunk, that simply amends load_float to ignore
errno on underflow (while retaining it on overflow). This fixes the problem on my machine.

The added tests may be a little severe. There's no *good* reason why
dumping and then loading a float on the same machine shouldn't produce
exactly the same value, but there are likely many bad reasons. I propose
to checkin the change and watch the buildbots carefully; if there are
failures I'll weaken the tests to check for approximate equality instead
of exact equality.

----------
keywords: +patch
Added file: http://bugs.python.org/file12762/issue1672332.patch

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue1672332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1672332] cPickle cannot unpickle subnormal floats on some machines [ In reply to ]
Mark Dickinson <dickinsm@gmail.com> added the comment:

Fixed in the trunk in r68903. If the buildbots are happy with the new
tests, I'll port to 2.6, 3.0 and 3.1.

----------
versions: -Python 2.7

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue1672332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1672332] cPickle cannot unpickle subnormal floats on some machines [ In reply to ]
Mark Dickinson <dickinsm@gmail.com> added the comment:

Hmm. After checking in this patch, the gentoo x86 trunk buildbot
has a new failure in test_pickletools, with the following output:

test_pickletools
**********************************************************************
File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/pickletools.py", line ?, in
pickletools.__test__.disassembler_test
Failed example:
dis(pickle.dumps(random.random, 0))
Expected:
0: c GLOBAL 'random random'
15: p PUT 0
18: . STOP
highest protocol among opcodes = 0
Got:
0: c GLOBAL 'bsddb.test.test_thread random'
31: p PUT 0
34: . STOP
highest protocol among opcodes = 0
**********************************************************************
1 items had failures:
1 of 25 in pickletools.__test__.disassembler_test
***Test Failed*** 1 failures.
test test_pickletools failed -- 1 of 95 doctests failed

I'm having some difficulty figuring out how this could be
related to the checkin of this patch.

Anyone have any ideas where this might be coming from?

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue1672332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1672332] cPickle cannot unpickle subnormal floats on some machines [ In reply to ]
Antoine Pitrou <pitrou@free.fr> added the comment:

This is not a new failure but an erratic one, and caused by a weakness
in pickle's handling of functions. See #3657.

----------
nosy: +pitrou

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue1672332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1672332] cPickle cannot unpickle subnormal floats on some machines [ In reply to ]
Mark Dickinson <dickinsm@gmail.com> added the comment:

Thanks, Antoine!

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue1672332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1672332] cPickle cannot unpickle subnormal floats on some machines [ In reply to ]
Mark Dickinson <dickinsm@gmail.com> added the comment:

Fix merged in r68907 (2.6), r68908 (3.1) and r68909 (3.0).

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue1672332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com