Repository navigation
Closed
Description
ntl_ZZ_pX.py
==4504== 504 (72 direct, 432 indirect) bytes in 9 blocks are definitely lost in loss record 305 of 1,918
==4504== at 0x4A1C344: operator new(unsigned long) (vg_replace_malloc.c:227)
==4504== by 0x6041C2A: ZZ_pX_linear_roots (in /tmp/Work-mabshoff/sage-2.8.11/devel/sage-main/c_lib/libcsage.so)
==4504== by 0xCC4DB97: __pyx_pf_4sage_4libs_3ntl_9ntl_ZZ_pX_9ntl_ZZ_pX_linear_roots(_object*, _object*) (ntl_ZZ_pX.cpp:35
95)
==4504== by 0x482FE8: PyEval_EvalFrameEx (ceval.c:3548)
==4504== by 0x484F3A: PyEval_EvalCodeEx (ceval.c:2831)
==4504== by 0x483CC4: PyEval_EvalFrameEx (ceval.c:494)
==4504== by 0x484F3A: PyEval_EvalCodeEx (ceval.c:2831)
==4504== by 0x48365C: PyEval_EvalFrameEx (ceval.c:3660)
==4504== by 0x484F3A: PyEval_EvalCodeEx (ceval.c:2831)
==4504== by 0x48365C: PyEval_EvalFrameEx (ceval.c:3660)
==4504== by 0x484F3A: PyEval_EvalCodeEx (ceval.c:2831)
==4504== by 0x48365C: PyEval_EvalFrameEx (ceval.c:3660)
==4504== 880 (48 direct, 832 indirect) bytes in 6 blocks are definitely lost in loss record 470 of 1,918
==4504== at 0x4A1C344: operator new(unsigned long) (vg_replace_malloc.c:227)
==4504== by 0x6041D65: ZZ_pX_factor (in /tmp/Work-mabshoff/sage-2.8.11/devel/sage-main/c_lib/libcsage.so)
==4504== by 0xCC4C380: __pyx_pf_4sage_4libs_3ntl_9ntl_ZZ_pX_9ntl_ZZ_pX_factor(_object*, _object*, _object*) (ntl_ZZ_pX.cp
p:3407)
==4504== by 0x483031: PyEval_EvalFrameEx (ceval.c:3564)
==4504== by 0x484F3A: PyEval_EvalCodeEx (ceval.c:2831)
==4504== by 0x483CC4: PyEval_EvalFrameEx (ceval.c:494)
==4504== by 0x484F3A: PyEval_EvalCodeEx (ceval.c:2831)
==4504== by 0x48365C: PyEval_EvalFrameEx (ceval.c:3660)
==4504== by 0x484F3A: PyEval_EvalCodeEx (ceval.c:2831)
==4504== by 0x48365C: PyEval_EvalFrameEx (ceval.c:3660)
==4504== by 0x484F3A: PyEval_EvalCodeEx (ceval.c:2831)
==4504== by 0x48365C: PyEval_EvalFrameEx (ceval.c:3660)
I believe those leaks are actually in NTL itself. Shoup has stated that there are some issues, but that he is not going to fix them, but I might be totally wrong here :)
Cheers,
Michael
Component: memleak
Issue created by migration from https://trac.sagemath.org/ticket/1093
Activity
sagetrac-mabshoff commentedon Jan 7, 2008
With Sage 2.10.alpha0 I get:
Leak summary:
Cheers,
Michael
sagetrac-mabshoff commentedon Jan 7, 2008
Ok, the attached patch fixes the issue for me:
As
ntl_wrap.hstates:The other part of the patch fixes the following problem which was only triggered after correctly freeing
v:Cheers,
Michael
sagetrac-mabshoff commentedon Jan 7, 2008
Attachment: Sage-2.10.alpha3-fix-ntl_ZZ_pX.pyx-memleaks.patch.gz
wjp commentedon Jan 7, 2008
The patch to ntl_ZZ_pX.pyx looks correct to me.
I'd fix the mismatched free/delete[] by changing the string(t) call to a string_delete(t) call, instead of modifying string(), though.
Patch attached to do this, also in ntl_ZZX.pyx.
sagetrac-mabshoff commentedon Jan 8, 2008
Attachment: ntl_free_mismatch.patch.gz
sagetrac-mabshoff commentedon Jan 8, 2008
Attachment: Sage-2.10.alpha3-revert-charstar-fix.patch.gz
Apply patches in order of attaching them.
Cheers,
Michael
wjp commentedon Jan 8, 2008
These three patches together look good to me.
sagetrac-mabshoff commentedon Jan 8, 2008
Merge in 2.10.alpha0
sagemathgh-43049: ⬆️ Bump astral-sh/setup-uv from 10.2.0 to 10.3.2