Skip to content
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

Add sig_on/sig_off to COINBackend #20360

Open
mkoeppe opened this issue Apr 5, 2016 · 3 comments
Open

Add sig_on/sig_off to COINBackend #20360

mkoeppe opened this issue Apr 5, 2016 · 3 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 5, 2016

The COIN backend needs sig_on, sig_off throughout so that bounds errors do not crash Sage.

sage: p = get_solver(solver = "Coin")
sage: p.is_variable_continuous(1234567)
True
sage: p.add_linear_constraint([(123, 456.7)], None, 0)
... 
Unhandled SIGSEGV: A segmentation fault occurred.

Another one, from #20326:

sage: coeffs = ([0, vector([1, 2])], [1, vector([2, 3])])
sage: upper = vector([5, 5])
sage: lower = vector([0, 0])
sage: from sage.numerical.backends.generic_backend import get_solver
sage: p = get_solver(solver = "Coin")       # optional - cbc
sage: p.add_linear_constraint_vector(2, coeffs, lower, upper)

CC: @dimpase @videlec @jdemeyer

Component: numerical

Issue created by migration from https://trac.sagemath.org/ticket/20360

@mkoeppe mkoeppe added this to the sage-7.2 milestone Apr 5, 2016
@mkoeppe

This comment has been minimized.

@jdemeyer
Copy link
Contributor

jdemeyer commented Nov 4, 2016

comment:2

I don't think this is a matter of adding sig_on/sig_off. Letting a program segfault and then catching the segfault is not a proper way of handling errors.

You should just check invalid input before calling COIN.

That being said, it might still be a good idea to add the sig_on/sig_off but not as a substitute for input checking.

@dimpase
Copy link
Member

dimpase commented Nov 4, 2016

comment:3

Replying to @jdemeyer:

I don't think this is a matter of adding sig_on/sig_off. Letting a program segfault and then catching the segfault is not a proper way of handling errors.

You should just check invalid input before calling COIN.

IMHO it's rather the backend's task (and that's more pythonic, if you ask me). They should check for such things, and perhaps
they will fix it at some point.

That being said, it might still be a good idea to add the sig_on/sig_off but not as a substitute for input checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants