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
Memory leak in the interface with Gurobi #15284
Comments
This comment has been minimized.
This comment has been minimized.
New commits:
|
Branch: u/ncohen/15284 |
Commit: |
comment:2
Hello! The patch is good just a short question - why do we need to check if it is NULL? |
comment:3
Ahahaha. Don't really know. Just used to checking that before freeing memory This being said, I just checled the doc and it explicitly says that Also, there was some "weird" memory leak, which this patch now fixes : in order to define a model you need to define a "master environment", and the model creates a copy of the "master environment", and that copy is the one you should work on. However, if you delete the master environment segfault follows. So. This patch creates a "master environment" variable to STORE the temporary environment that was never deallocated. Everything then is done on the real environment, and when everything is done both environment are deallocated. Without checks for NULL, as it has been checked before, when the environment were created. Weird behaviour, but branch updated ! Nathann P.S. : Oh, and I also replace |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
The patch looks good to me! |
comment:6
The patch looks good to me! |
comment:7
Thaaaaaaaaaanks ! Nathann |
Reviewer: Jernej Azarija |
Changed reviewer from Jernej Azarija to Jernej Azarija |
As reported by Jernej, the
GRBenv ** env
structure is allocated but not freed on__dealloc___
. That's fixed here !There was also a problem with the
.copy()
function of gurobi which should have been cpdef. It wasn't, and doctests did not pass. I don't get how we missed that:-/
Nathann
CC: @sagetrac-azi
Component: linear programming
Author: Nathann Cohen
Branch/Commit: u/ncohen/15284 @
012f44b
Reviewer: Jernej Azarija
Issue created by migration from https://trac.sagemath.org/ticket/15284
The text was updated successfully, but these errors were encountered: