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: |

### Description (last modified by )

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

Description: | modified (diff) |
---|---|

Priority: | blocker → critical |

Summary: | Fix memleaks by using linbox after #16803 → Fix memleaks by using non-FLINT methods after #16803 |

### comment:2 Changed 8 years ago by

Authors: | → Jeroen Demeyer |
---|---|

Dependencies: | → #17090 |

### comment:3 Changed 8 years ago by

Description: | modified (diff) |
---|

### comment:4 Changed 8 years ago by

Description: | modified (diff) |
---|

### comment:5 Changed 8 years ago by

Description: | modified (diff) |
---|

### comment:6 Changed 8 years ago by

Description: | modified (diff) |
---|

### comment:7 Changed 8 years ago by

Description: | modified (diff) |
---|---|

Summary: | Fix memleaks by using non-FLINT methods after #16803 → Fix memleaks and brokenness of non-FLINT methods after #16803 |

### comment:8 Changed 8 years ago by

Description: | modified (diff) |
---|

### comment:9 Changed 8 years ago by

Branch: | → u/jdemeyer/ticket/17094 |
---|---|

Created: | Oct 3, 2014, 9:02:57 AM → Oct 3, 2014, 9:02:57 AM |

Modified: | Oct 3, 2014, 1:16:11 PM → Oct 3, 2014, 1:16:11 PM |

### comment:10 Changed 8 years ago by

Commit: | → a8c707da7f32432a088939133bb2dd5bd7489c0c |
---|---|

Status: | new → needs_review |

### comment:11 Changed 8 years ago by

Description: | modified (diff) |
---|

### comment:12 Changed 8 years ago by

Description: | modified (diff) |
---|---|

Priority: | critical → blocker |

### comment:13 Changed 8 years ago by

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

### comment:14 Changed 8 years ago by

Reviewers: | → Volker Braun |
---|---|

Status: | needs_review → positive_review |

### comment:15 Changed 8 years ago by

Branch: | u/jdemeyer/ticket/17094 → a8c707da7f32432a088939133bb2dd5bd7489c0c |
---|---|

Resolution: | → fixed |

Status: | positive_review → closed |

**Note:**See TracTickets for help on using tickets.

Last 10 new commits:

`Check 'implementation' argument`

`Undo changes to padics from #16803`

`Remove unneeded imports`

`Put back old multiplication code (as requested by William Stein)`

`Restore doctest`

`Fix fmpz_mat_t declaration`

`Missing comma between command-line arguments`

`Merge commit '192c8e6f5c6e5f0bd0dd02d51b5f103924a408ef' into ticket/17090`

`Some reformatting`

`Fix initialization of matrices and fix _hnf_mod()`