Changes between Version 25 and Version 27 of Ticket #14471


Ignore:
Timestamp:
06/26/13 14:31:21 (8 years ago)
Author:
vbraun
Comment:

I'm setting the priority to critical since it is a structural issue that we must get right in order to trust computations.

Rediffed to sage-5.11.beta3

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14471

    • Property Priority changed from major to critical
  • Ticket #14471 – Description

    v25 v27  
    1 Old title: Exception KeyError: in WeakValueDictionary remove ignored
     1Some objects with dynamical classes use `hash(self.__class__)`. Since this is not an invariant of dynamical classes bad things will happen.
    22
    3 Under some circumstances the !WeakValueDictionary remove callback is being called when the internal dictionary is in a bad state. The attached patch [attachment:trac_14471_demonstrate.patch] to demonstrate the issue just calls `hasattr` from the displayhook, which ends up generating weak references somewhere. The exact place for where the exception occurs depends on the garbage collector, but I always do get some unwanted exceptions with it.
    4 {{{
    5 sage -t devel/sage/sage/matrix/matrix0.pyx
    6 Exception KeyError: (((<class 'sage.matrix.matrix_space.MatrixSpace'>, Callable function ring with arguments (x, y), 2, 2, False), ()),) in <function remove at 0x18d8758> ignored
    7 **********************************************************************
    8 File "devel/sage/sage/matrix/matrix0.pyx", line 3370, in sage.matrix.matrix0.Matrix.is_hermitian
    9 Failed example:
    10     B.is_hermitian()
    11 Expected:
    12     True
    13 Got:
    14     Exception KeyError: (((<class 'sage.categories.algebras.Algebras'>, Callable function ring with arguments (x, y)), ()),) in <function remove at 0x18d8758> ignored
    15     True
    16 }}}
     3One such instance is that, under some circumstances, a !WeakValueDictionary remove callback is being called but cannot find the object in the dictionary since the hash changed.
    174
    185Apply [attachment:trac_14471_dynamic_class_hash.patch]