XPRESS System.AccessViolationException: Attempted to read or write protected memory (caused because inconsistent number of cols and timelimit) #3003
Replies: 2 comments
-
Hi, Thanks for this feedback, any PR is welcome ! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you and the team, ORTools is awesome!! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What version of OR-tools and what language are you using?
Version: source V7.5 stable
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
XPRESS
What operating system (Linux, Windows, ...) and version?
Windows 10
What did you do?
Solved MIP matrix with a max time limit for XPRESS. The Max time limit was reached.
What did you expect to see
OR tools should return the solution values
What did you see instead?
It crashed with a System.AccessViolation message
Problem/Solution
Note: All the code below is in xpress_interface.cc
The problem is that depending in the status of the solution the next code can bring different values:
XPRSgetintattrib(mLp, XPRS_COLS, &nCols);
In my case it was bringing the Presolve number of columns. But the next code request an array with the original number of columns:
XPRSgetmipsol(mLp, x.get(), 0)
This mismatch of number of columns causes the System.AccessViolation.
In order to solve the problem, it is better to call the number of columns and rows before solving.
int const rows = XPRSgetnumrows(mLp); int const cols = XPRSgetnumcols(mLp);
Beta Was this translation helpful? Give feedback.
All reactions