embotech/ecos

ECOS BB segfaults

Closed this issue · 6 comments

I've added boolean and integer variables to the master branch of cvxpy. Everything seems to work, except ecos BB segfaults. Here's an example problem:

from cvxpy import *
x = IntVar()
cost = square(x - 0.2)
prob = Problem(Minimize(cost))
prob.solve()

The output on my machine is

[1] 13258 bus error python

I'll take a quick look with gdb, but you guys can probably figure this out much more quickly than I can.

The problem seems to be that I was passing in an empty list of boolean variables. Could ECOS BB be modified so it will ignore empty lists of boolean or integer variables?

Good point, working on patch now.

On Fri, Nov 14, 2014 at 4:36 PM, Steven Diamond notifications@github.com
wrote:

The problem seems to be that I was passing in an empty list of boolean
variables. Could ECOS BB be modified so it will ignore empty lists of
boolean or integer variables?


Reply to this email directly or view it on GitHub
#90 (comment).

Try pulling now, it'll detect when the boolean/integer argument is of 0
length.

On Fri, Nov 14, 2014 at 4:36 PM, Steven Diamond notifications@github.com
wrote:

The problem seems to be that I was passing in an empty list of boolean
variables. Could ECOS BB be modified so it will ignore empty lists of
boolean or integer variables?


Reply to this email directly or view it on GitHub
#90 (comment).

It works now. Thanks! It also turned out I was adding the same indices to bool_var_idx and int_var_idx. This should result in an error instead of a segfault.

echu commented

@hanwang, have you had time to implement a check to ensure that the indices supplied to bool_var_idx and int_var_idx are different? I believe this should be done in the C library code.

So having the same indies for boolean and integer variables should not result in a segfault. Ecos should simply solve with the more constricting (boolean) constraints.