On Aug 29, 4:22 pm, "Joel B. Mohler" <[EMAIL PROTECTED]> wrote:
> On Wednesday 29 August 2007 07:19, mabshoff wrote:
>
> > ==22784== 791,674 bytes in 65,421 blocks are definitely lost in loss
> > record 2,472 of 2,481
> > ==22784== at 0x4A05CB9: operator new[](unsigned long)
> > (vg_replace_malloc.c:199)
> > ==22784== by 0x9280247: ZZ_pX_repr (in /tmp/Work2/sage-2.8.3.alpha2/
> > local/lib/libcsage.so.0.0.0)
>
> I think you also have a similar memory leak in number fields. I'm going to
> fix that one as soon as the c_lib gets integrated in to the main tree and the
> new code for the sage c_lib gets added which provides support for the proper
> fix.
>
<SNIP>
I could swear I posted the following already, but it hasn't shown up
via email or in this group for the last five minutes. Otherwise
pleasure excuse this snafu. This is the cliff-notes version:
Do the following in devel/sage:
[EMAIL PROTECTED] sage]$ grep -r "return\ str(" * | grep --invert-match
".c" | wc -l
62
More precisely:
build/sage/matrix/strassen.pyx: return str(self._intervals)
build/sage/ext/multi_modular.pyx: return str(type(self))
+str(self.list())
build/sage/groups/perm_gps/permgroup_element.py: return
str(self)
build/sage/groups/matrix_gps/matrix_group_element.py: return
str(self.__mat)
build/sage/algebras/algebra_order_element.py: return
str(self.__ambient_algebra_element)
build/sage/libs/pari/gen.pyx: return
str(type_name(typ(self.g)))
build/sage/libs/pari/gen.pyx: return str(PARIVERSION)
build/sage/libs/ntl/ntl.pyx:# return str(ZZX_repr(self.x))
build/sage/libs/ntl/ntl.pyx:# return str(ZZ_pX_repr(self.x))
build/sage/modular/modform/element.py: return
str(self.q_expansion())
build/sage/modular/modsym/element.py: return
str(self.element())
build/sage/gsl/interpolation.pyx: return str(self.v)
build/sage/gsl/fft.pyx: return str(list(self))
build/sage/gsl/gsl_array.pyx: return str(list(self))
build/sage/rings/pari_ring.py: return str(self.__x)
build/sage/rings/real_double.pyx: return str(self._value)
build/sage/rings/integer.pyx: return str(self)
build/sage/rings/real_mpfi.pyx: return str(self)
build/sage/rings/integer_mod.pyx: return str(self.lift())
build/sage/rings/integer_mod.pyx: return str(self)
build/sage/rings/finite_field_givaro.pyx: return
str(int(e.element))
build/sage/rings/finite_field_givaro.pyx: return str(int(e))
build/sage/rings/finite_field_givaro.pyx: return str(self)
build/sage/rings/sparse_poly.pyx: return str(self.list())
build/sage/rings/finite_field_element.py: return
str(self.__value)
build/sage/rings/rational.pyx: return str(self.numer())
build/sage/rings/quotient_ring_element.py: return
str(self.__rep)
build/lib.linux-x86_64-2.5/sage/groups/perm_gps/
permgroup_element.py: return str(self)
build/lib.linux-x86_64-2.5/sage/groups/matrix_gps/
matrix_group_element.py: return str(self.__mat)
build/lib.linux-x86_64-2.5/sage/algebras/
algebra_order_element.py: return
str(self.__ambient_algebra_element)
build/lib.linux-x86_64-2.5/sage/modular/modform/element.py:
return str(self.q_expansion())
build/lib.linux-x86_64-2.5/sage/modular/modsym/element.py:
return str(self.element())
build/lib.linux-x86_64-2.5/sage/rings/pari_ring.py: return
str(self.__x)
build/lib.linux-x86_64-2.5/sage/rings/finite_field_element.py:
return str(self.__value)
build/lib.linux-x86_64-2.5/sage/rings/
quotient_ring_element.py: return str(self.__rep)
sage/matrix/strassen.pyx: return str(self._intervals)
sage/ext/multi_modular.pyx: return str(type(self))
+str(self.list())
sage/groups/perm_gps/permgroup_element.py: return str(self)
sage/groups/matrix_gps/matrix_group_element.py: return
str(self.__mat)
sage/algebras/algebra_order_element.py: return
str(self.__ambient_algebra_element)
sage/libs/pari/_py_pari_orig.pyx: return str(PARIVERSION)
sage/libs/pari/_py_pari_orig.pyx: return
str(type_name(typ(self.g)))
sage/libs/pari/gen.pyx: return str(type_name(typ(self.g)))
sage/libs/pari/gen.pyx: return str(PARIVERSION)
sage/modular/modform/element.py: return str(self.q_expansion())
sage/modular/modsym/element.py: return str(self.element())
sage/gsl/interpolation.pyx: return str(self.v)
sage/gsl/fft.pyx: return str(list(self))
sage/gsl/gsl_array.pyx: return str(list(self))
sage/rings/pari_ring.py: return str(self.__x)
sage/rings/real_double.pyx: return str(self._value)
sage/rings/integer.pyx: return str(self)
sage/rings/real_mpfi.pyx: return str(self)
sage/rings/integer_mod.pyx: return str(self.lift())
sage/rings/integer_mod.pyx: return str(self)
sage/rings/finite_field_givaro.pyx: return str(int(e.element))
sage/rings/finite_field_givaro.pyx: return str(int(e))
sage/rings/finite_field_givaro.pyx: return str(self)
sage/rings/sparse_poly.pyx: return str(self.list())
sage/rings/finite_field_element.py: return str(self.__value)
sage/rings/rational.pyx: return str(self.numer())
sage/rings/quotient_ring_element.py: return str(self.__rep)
All of the above need to be audited for memory leaks. It is the same
pattern that got us in trouble in the ntl wrapper. I believe the we
should take an OpenBSDish approach here: "find an issue/bug and audit
the whole tree for that issue/bug and fix them all". I think that this
is too late for 2.8.3, but we should really get this fixed for 2.9. I
have already found a similar issue about dictionaries/hashes that are
not properly deallocated, so stay tuned for that one.
> --
> Joel
Cheers,
Michael
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---