Opened 7 years ago

Closed 6 years ago

#15070 closed defect (duplicate)

Overturn limitation when releasing deep datastructures involving TripleDicts and other weakrefs

Reported by: nthiery Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: memleak Keywords:
Cc: vbraun, nbruin, SimonKing Merged in:
Authors: Reviewers: Simon King
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Deleting TripleDicts and other weakref friends is currently recursive which limits the depth of datastructures involving them that can be safely deleted. E.g:

from sage.structure.coerce_dict import MonoDict
M = MonoDict(11)

class A: pass
a = A()
prev = a

for i in range(1000):
    newA = A()
    M[prev] = newA
    prev = newA

len(M)
del a
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <sage.structure.coerce_dict.MonoDictEraser object at 0x5a13788> ignored

#10963 is apparently putting more stress on our weakref data structure and triggers such recursion errors. See http://trac.sagemath.org/ticket/10963#comment:90 and followups for a discussion.

Change History (3)

comment:1 Changed 7 years ago by SimonKing

  • Authors Simon King deleted
  • Reviewers set to Simon King
  • Status changed from new to needs_review

I was faster ;)

This ticket is a duplicate of #15069.

comment:2 Changed 7 years ago by SimonKing

  • Milestone changed from sage-5.12 to sage-duplicate/invalid/wontfix
  • Status changed from needs_review to positive_review

comment:3 Changed 6 years ago by jdemeyer

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.