Opened 8 years ago

Closed 8 years ago

#17094 closed defect (fixed)

Fix memleaks and brokenness of non-FLINT methods after #16803

Reported by: jdemeyer Owned by:
Priority: blocker Milestone: sage-6.4
Component: linear algebra Keywords:
Cc: mmasdeu, was Merged in:
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: a8c707d (Commits, GitHub, GitLab) Commit: a8c707da7f32432a088939133bb2dd5bd7489c0c
Dependencies: #17090 Stopgaps:

Status badges

Description (last modified by jdemeyer)

non-FLINT methods are seriously broken after #16803:

sage: a = zero_matrix(QQ,3)
sage: b = identity_matrix(QQ,3)
sage: a.minpoly()
x
sage: b.minpoly()
x - 1
sage: a.minpoly('y')
y - 1

Also, using linbox or iml and modifying a matrix leaks memory:

sage: v = vector([0]*1000)
sage: M = identity_matrix(ZZ,1000)
sage: while True:           
....:    _ = M._solve_right_nonsingular_square(v)
....:    M[0,0] = 1
....:    print get_memory_usage()

Also, use type int for _hnf_mod() (anything larger than 2^31-1 isn't supported anyway).

Change History (15)

comment:1 Changed 8 years ago by jdemeyer

Description: modified (diff)
Priority: blockercritical
Summary: Fix memleaks by using linbox after #16803Fix memleaks by using non-FLINT methods after #16803

comment:2 Changed 8 years ago by jdemeyer

Authors: Jeroen Demeyer
Dependencies: #17090

comment:3 Changed 8 years ago by jdemeyer

Description: modified (diff)

comment:4 Changed 8 years ago by jdemeyer

Description: modified (diff)

comment:5 Changed 8 years ago by jdemeyer

Description: modified (diff)

comment:6 Changed 8 years ago by jdemeyer

Description: modified (diff)

comment:7 Changed 8 years ago by jdemeyer

Description: modified (diff)
Summary: Fix memleaks by using non-FLINT methods after #16803Fix memleaks and brokenness of non-FLINT methods after #16803

comment:8 Changed 8 years ago by jdemeyer

Description: modified (diff)

comment:9 Changed 8 years ago by jdemeyer

Branch: u/jdemeyer/ticket/17094
Created: Oct 3, 2014, 9:02:57 AMOct 3, 2014, 9:02:57 AM
Modified: Oct 3, 2014, 1:16:11 PMOct 3, 2014, 1:16:11 PM

comment:10 Changed 8 years ago by jdemeyer

Commit: a8c707da7f32432a088939133bb2dd5bd7489c0c
Status: newneeds_review

Last 10 new commits:

9b31003Check 'implementation' argument
a2860d8Undo changes to padics from #16803
342d152Remove unneeded imports
95b431dPut back old multiplication code (as requested by William Stein)
5b77c78Restore doctest
7843e3fFix fmpz_mat_t declaration
192c8e6Missing comma between command-line arguments
9604069Merge commit '192c8e6f5c6e5f0bd0dd02d51b5f103924a408ef' into ticket/17090
c46a4d5Some reformatting
a8c707dFix initialization of matrices and fix _hnf_mod()

comment:11 Changed 8 years ago by jdemeyer

Description: modified (diff)

comment:12 Changed 8 years ago by jdemeyer

Description: modified (diff)
Priority: criticalblocker

comment:13 Changed 8 years ago by jdemeyer

Found an easy example showing that there is really a problem in practice.

comment:14 Changed 8 years ago by vbraun

Reviewers: Volker Braun
Status: needs_reviewpositive_review

comment:15 Changed 8 years ago by vbraun

Branch: u/jdemeyer/ticket/17094a8c707da7f32432a088939133bb2dd5bd7489c0c
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.