#15851: fix unhandled segfault in Coin backend
--------------------------------------+------------------------
Reporter: dimpase | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.2
Component: linear programming | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
--------------------------------------+------------------------
Changes (by ppurka):
* component: PLEASE CHANGE => linear programming
Comment:
Following code should fix it
{{{#!diff
diff --git a/src/sage/numerical/backends/coin_backend.pyx
b/src/sage/numerical/backends/coin_backend.pyx
index 4083c79..96e47d3 100644
--- a/src/sage/numerical/backends/coin_backend.pyx
+++ b/src/sage/numerical/backends/coin_backend.pyx
@@ -826,7 +826,10 @@ cdef class CoinBackend(GenericBackend):
cdef double * solution
solution = <double*> self.model.solver().getColSolution()
- return solution[variable]
+ if solution:
+ return solution[variable]
+ else:
+ return []
cpdef int ncols(self):
r"""
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/15851#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.