Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

Latest commit

 

History

History
265 lines (207 loc) · 9.06 KB

20360.md

File metadata and controls

265 lines (207 loc) · 9.06 KB

Issue 20360: Add sig_on/sig_off to COINBackend

archive/issues_020123.json:

{
    "assignees": [],
    "body": "<div id=\"comment:0\"></div>\n\nThe COIN backend needs `sig_on`, `sig_off` throughout so that bounds errors do not crash Sage.\n\n```\nsage: p = get_solver(solver = \"Coin\")\nsage: p.is_variable_continuous(1234567)\nTrue\nsage: p.add_linear_constraint([(123, 456.7)], None, 0)\n... \nUnhandled SIGSEGV: A segmentation fault occurred.\n```\n\nAnother one, from #20326:\n\n```\nsage: coeffs = ([0, vector([1, 2])], [1, vector([2, 3])])\nsage: upper = vector([5, 5])\nsage: lower = vector([0, 0])\nsage: from sage.numerical.backends.generic_backend import get_solver\nsage: p = get_solver(solver = \"Coin\")       # optional - cbc\nsage: p.add_linear_constraint_vector(2, coeffs, lower, upper)\n```\n\n\nCC:  @dimpase @videlec @jdemeyer\n\nComponent: **numerical**\n\n_Issue created by migration from https://trac.sagemath.org/ticket/20360_\n\n",
    "created_at": "2016-04-05T16:59:05Z",
    "labels": [
        "https://github.com/sagemath/sage/labels/c%3A%20numerical",
        "https://github.com/sagemath/sage/labels/p%3A%20major%20/%203",
        "https://github.com/sagemath/sage/labels/enhancement",
        "https://github.com/sagemath/sage/labels/c%3A%20linear%20programming"
    ],
    "reactions": [],
    "repository": "https://github.com/sagemath/sage",
    "title": "Add sig_on/sig_off to COINBackend",
    "type": "issue",
    "updated_at": "2022-12-29T01:35:57Z",
    "url": "https://github.com/sagemath/sage/issues/20360",
    "user": "https://github.com/mkoeppe"
}

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


archive/issue_events_284769.json:

{
    "actor": "https://github.com/mkoeppe",
    "created_at": "2016-04-05T16:59:05Z",
    "event": "milestoned",
    "issue": "https://github.com/sagemath/sage/issues/20360",
    "milestone_number": null,
    "milestone_title": "sage-7.2",
    "type": "issue_event",
    "url": "https://github.com/sagemath/sage/issues/20360#event-284769"
}

archive/issue_events_284770.json:

{
    "actor": "https://github.com/mkoeppe",
    "created_at": "2016-04-05T16:59:05Z",
    "event": "labeled",
    "issue": "https://github.com/sagemath/sage/issues/20360",
    "label": "https://github.com/sagemath/sage/labels/c%3A%20numerical",
    "label_color": "0000ff",
    "label_name": "c: numerical",
    "label_text_color": "ffffff",
    "type": "issue_event",
    "url": "https://github.com/sagemath/sage/issues/20360#event-284770"
}

archive/issue_events_284771.json:

{
    "actor": "https://github.com/mkoeppe",
    "created_at": "2016-04-05T16:59:05Z",
    "event": "labeled",
    "issue": "https://github.com/sagemath/sage/issues/20360",
    "label": "https://github.com/sagemath/sage/labels/p%3A%20major%20/%203",
    "label_color": "ffbb00",
    "label_name": "p: major / 3",
    "label_text_color": "ffffff",
    "type": "issue_event",
    "url": "https://github.com/sagemath/sage/issues/20360#event-284771"
}

archive/issue_events_284772.json:

{
    "actor": "https://github.com/mkoeppe",
    "created_at": "2016-04-05T16:59:05Z",
    "event": "labeled",
    "issue": "https://github.com/sagemath/sage/issues/20360",
    "label": "https://github.com/sagemath/sage/labels/enhancement",
    "label_color": "696969",
    "label_name": "enhancement",
    "label_text_color": "ffffff",
    "type": "issue_event",
    "url": "https://github.com/sagemath/sage/issues/20360#event-284772"
}

archive/issue_events_284773.json:

{
    "actor": "https://github.com/mkoeppe",
    "created_at": "2016-04-05T16:59:05Z",
    "event": "labeled",
    "issue": "https://github.com/sagemath/sage/issues/20360",
    "label": "https://github.com/sagemath/sage/labels/c%3A%20linear%20programming",
    "label_color": "0000ff",
    "label_name": "c: linear programming",
    "label_text_color": "ffffff",
    "type": "issue_event",
    "url": "https://github.com/sagemath/sage/issues/20360#event-284773"
}

archive/issue_comments_293690.json:

{
    "body": "Description changed:\n``````diff\n--- \n+++ \n@@ -9,3 +9,14 @@\n Unhandled SIGSEGV: A segmentation fault occurred.\n ```\n \n+Another one, from #20326:\n+\n+```\n+sage: coeffs = ([0, vector([1, 2])], [1, vector([2, 3])])\n+sage: upper = vector([5, 5])\n+sage: lower = vector([0, 0])\n+sage: from sage.numerical.backends.generic_backend import get_solver\n+sage: p = get_solver(solver = \"Coin\")       # optional - cbc\n+sage: p.add_linear_constraint_vector(2, coeffs, lower, upper)\n+```\n+\n``````\n",
    "created_at": "2016-04-05T19:28:09Z",
    "formatter": "markdown",
    "issue": "https://github.com/sagemath/sage/issues/20360",
    "type": "issue_comment",
    "url": "https://github.com/sagemath/sage/issues/20360#issuecomment-293690",
    "user": "https://github.com/mkoeppe"
}

Description changed:

--- 
+++ 
@@ -9,3 +9,14 @@
 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)
+```
+

archive/issue_comments_293691.json:

{
    "body": "<div id=\"comment:2\" align=\"right\">comment:2</div>\n\nI 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.\n\nYou should just check invalid input before calling COIN.\n\nThat being said, it might still be a good idea to add the `sig_on`/`sig_off` but not as a substitute for input checking.",
    "created_at": "2016-11-04T13:51:53Z",
    "formatter": "markdown",
    "issue": "https://github.com/sagemath/sage/issues/20360",
    "type": "issue_comment",
    "url": "https://github.com/sagemath/sage/issues/20360#issuecomment-293691",
    "user": "https://github.com/jdemeyer"
}
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.


archive/issue_comments_293692.json:

{
    "body": "<div id=\"comment:3\" align=\"right\">comment:3</div>\n\nReplying to [@jdemeyer](#comment%3A2):\n> 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.\n> \n> You should just check invalid input before calling COIN.\n\nIMHO it's rather the backend's task (and that's more pythonic, if you ask me). They should check for such things, and perhaps\nthey will fix it at some point.\n\n> \n> 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.",
    "created_at": "2016-11-04T19:21:49Z",
    "formatter": "markdown",
    "issue": "https://github.com/sagemath/sage/issues/20360",
    "type": "issue_comment",
    "url": "https://github.com/sagemath/sage/issues/20360#issuecomment-293692",
    "user": "https://github.com/dimpase"
}
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.


archive/issue_events_284774.json:

{
    "actor": "https://github.com/mkoeppe",
    "created_at": "2022-12-29T01:35:57Z",
    "event": "demilestoned",
    "issue": "https://github.com/sagemath/sage/issues/20360",
    "milestone_number": null,
    "milestone_title": "sage-7.2",
    "type": "issue_event",
    "url": "https://github.com/sagemath/sage/issues/20360#event-284774"
}