#15692: Value of cached methods should not always be pickled
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner:
Type: defect | Status: positive_review
Priority: major | Milestone: sage-7.0
Component: pickling | Resolution:
Keywords: pickling, hash, | Merged in:
cache, days71 | Reviewers: Vincent Delecroix,
Authors: Julian Rueth | David Roe
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/saraedum/ticket/15692 | 7ef7a4120395d2645c4246bb23ffb9d3f7183dd4
Dependencies: #16337 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by fbissey):
I suspect I am getting this in sage-on-gentoo pulling volker's current
develop branch because of this:
{{{
File "/usr/lib64/python2.7/site-
packages/sage/modular/overconvergent/weightspace.py", line 473, in
sage.modular.overconvergent.weightspace.AlgebraicWeight
Failed example:
w == loads(dumps(w))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py",
line 501, in _run
self.compile_and_execute(example, compiler, test.globs)
File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py",
line 864, in compile_and_execute
exec(compiled, globs)
File "<doctest
sage.modular.overconvergent.weightspace.AlgebraicWeight[3]>", line 1, in
<module>
w == loads(dumps(w))
File "sage/structure/element.pyx", line 913, in
sage.structure.element.Element.__richcmp__ (/scratch2/portage/sci-
mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/structure/element.c:9542)
return (<Element>self)._richcmp_(<Element>other, op)
File "sage/structure/element.pyx", line 948, in
sage.structure.element.Element._richcmp_ (/scratch2/portage/sci-
mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/structure/element.c:9722)
c = left._cmp_(right)
File "sage/structure/element.pyx", line 964, in
sage.structure.element.Element._cmp_ (/scratch2/portage/sci-
mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/structure/element.c:10101)
return left_cmp(right)
File "/usr/lib64/python2.7/site-
packages/sage/modular/overconvergent/weightspace.py", line 417, in __cmp__
return cmp(self.values_on_gens(), other.values_on_gens())
File "/usr/lib64/python2.7/site-
packages/sage/modular/overconvergent/weightspace.py", line 380, in
values_on_gens
return ( self(self.parent()._param), self.teichmuller_type())
File "/usr/lib64/python2.7/site-
packages/sage/modular/overconvergent/weightspace.py", line 539, in
__call__
if self._p**(x.precision_absolute()) < self._chi.conductor():
File "sage/misc/cachefunc.pyx", line 1717, in
sage.misc.cachefunc.CachedMethodPickle.__call__ (/scratch2/portage/sci-
mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/misc/cachefunc.c:8703)
return CM(*args,**kwds)
File "sage/misc/cachefunc.pyx", line 2401, in
sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (/scratch2/portage
/sci-mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/misc/cachefunc.c:12708)
self.cache = f(self._instance)
File "/usr/lib64/python2.7/site-packages/sage/modular/dirichlet.py",
line 755, in conductor
if self.modulus() == 1 or self.is_trivial():
File "sage/misc/cachefunc.pyx", line 1717, in
sage.misc.cachefunc.CachedMethodPickle.__call__ (/scratch2/portage/sci-
mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/misc/cachefunc.c:8703)
return CM(*args,**kwds)
File "sage/misc/cachefunc.pyx", line 2401, in
sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (/scratch2/portage
/sci-mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/misc/cachefunc.c:12708)
self.cache = f(self._instance)
}}}
and ending after many lines with
{{{
File "sage/misc/cachefunc.pyx", line 2401, in
sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (/scratch2/portage
/sci-mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/misc/cachefunc.c:12708)
self.cache = f(self._instance)
File "/usr/lib64/python2.7/site-packages/sage/modular/dirichlet.py",
line 1738, in element
v = M([dlog[x] for x in self.values_on_gens()])
File "/usr/lib64/python2.7/site-packages/sage/modular/dirichlet.py",
line 1705, in values_on_gens
v = tuple([pows[i] for i in self.element()])
File "sage/misc/cachefunc.pyx", line 2401, in
sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (/scratch2/portage
/sci-mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/misc/cachefunc.c:12708)
self.cache = f(self._instance)
File "/usr/lib64/python2.7/site-packages/sage/modular/dirichlet.py",
line 1730, in element
M = P._module
File "/usr/lib64/python2.7/site-packages/sage/modular/dirichlet.py",
line 2137, in _module
len(self.unit_gens()))
File "sage/structure/factory.pyx", line 361, in
sage.structure.factory.UniqueFactory.__call__ (/scratch2/portage/sci-
mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/structure/factory.c:1585)
key, kwds = self.create_key_and_extra_args(*args, **kwds)
File "sage/structure/factory.pyx", line 459, in
sage.structure.factory.UniqueFactory.create_key_and_extra_args
(/scratch2/portage/sci-mathematics/sage-9999/work/sage-9999/src-
python2_7/build/cythonized/sage/structure/factory.c:2722)
return self.create_key(*args, **kwds), {}
File "/usr/lib64/python2.7/site-
packages/sage/modules/free_module.py", line 336, in create_key
rank = int(sage.rings.integer.Integer(rank))
RuntimeError: maximum recursion depth exceeded while calling a Python
object
**********************************************************************
1 item had failures:
2 of 6 in sage.modular.overconvergent.weightspace.AlgebraicWeight
[108 tests, 2 failures, 0.32 s]
----------------------------------------------------------------------
sage -t --long /usr/lib64/python2.7/site-
packages/sage/modular/overconvergent/weightspace.py # 2 doctests failed
----------------------------------------------------------------------
}}}
There are two of those. There is always the possibility that I missed a
patch in `python` or some other place that deals with this but I don't
think so.
--
Ticket URL: <http://trac.sagemath.org/ticket/15692#comment:52>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.