Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in si2sa_ZZ in sage/libs/singular/singular.pyx #4387

Closed
sagetrac-mabshoff mannequin opened this issue Oct 30, 2008 · 3 comments
Closed

Fix memory leak in si2sa_ZZ in sage/libs/singular/singular.pyx #4387

sagetrac-mabshoff mannequin opened this issue Oct 30, 2008 · 3 comments
Assignees
Milestone

Comments

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Oct 30, 2008

We currently leak on mpz in si2sa_ZZ:

==696== 104 bytes in 13 blocks are definitely lost in loss record 11,644 of 19,410
==696==    at 0x4A1BE1B: malloc (vg_replace_malloc.c:207)
==696==    by 0x6760947: __gmpz_init (in /scratch/mabshoff/release-cycle/sage-3.1.3.final/local/lib/libgmp.so.3.4.1)
==696==    by 0x15E05AAE: __pyx_f_4sage_4libs_8singular_8singular_10Conversion_si2sa_ZZ (singular.cpp:2513)
==696==    by 0x15E07C85: __pyx_f_4sage_4libs_8singular_8singular_10Conversion_si2sa (singular.cpp:4803)
==696==    by 0x1572034D: __pyx_pf_4sage_5rings_10polynomial_28multi_polynomial_libsingular_23MPolynomial_libsingular_coefficients(_object*, _object*) (multi_polynomial_libsingular.cpp:25706)
==696==    by 0x415832: PyObject_Call (abstract.c:1861)
==696==    by 0x15735A21: __pyx_pf_4sage_5rings_10polynomial_28multi_polynomial_libsingular_23MPolynomial_libsingular_gcd(_object*, _object*, _object*) (multi_polynomial_libsingular.cpp:23546)

The attached patch fixes that.

Cheers,

Michael

CC: @malb

Component: memleak

Issue created by migration from https://trac.sagemath.org/ticket/4387

@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-3.2 milestone Oct 30, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin added t: bug labels Oct 30, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin self-assigned this Oct 30, 2008
@craigcitro
Copy link
Member

comment:1

Attachment: trac_4387.patch.gz

Notice that the mpz_init happens twice -- this is definitely the right fix.

@sagetrac-mabshoff
Copy link
Mannequin Author

sagetrac-mabshoff mannequin commented Oct 30, 2008

comment:2

Merged in Sage 3.2.alpha2

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Oct 30, 2008
@sagetrac-mabshoff
Copy link
Mannequin Author

sagetrac-mabshoff mannequin commented Oct 30, 2008

comment:3

CCed malb so he knows about the issue.

Cheers,

Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant