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
Deal with a trivial case in dlx_solver #13882
Comments
comment:1
Smaller example:
|
Attachment: trac13882_trivial_dlx_solver.patch.gz |
comment:2
The problem occurs in the add_rows method, if no rows are given: we would then have an uninitialised vector_vector_int that is used in some c-level function - and this is asking for trouble. My suggestion: If the input is empty, then return before using the uninitialized value. |
Author: Simon King |
comment:3
Nice we had that crash previously in sage-on-gentoo good to have a fix. I remember that in the original tiling.py the test would fail in the command after the call to the solver and for that reason that command wasn't tested. So I think that particular test should also be re-enabled in tiling.py. |
comment:4
With your change the following in combinat/tiling.py will have to be changed
|
comment:5
Replying to @kiwifb:
Why? It still goes "BOOM". Actually, the fix from here is responsible for the fact that in the debug version the line |
comment:6
Apologies! When I saw your patch I became convinced it would do something for this. To the point of obsession only once, I posted (and gone to bed) did it occur to me that it wouldn't. I'll do one or two extra tests and give this ticket a positive review later today. |
Reviewer: Francois Bissey |
comment:7
Pass my tests. Looks good to me. Positive review as is. |
Merged: sage-5.6.beta3 |
Changed reviewer from Francois Bissey to François Bissey |
Using Sage's debug version from #13864, the following crashes:
My guess is that one can check whether the input is empty, dealing with that special case separately. Alternatively, if empty columns are acceptable, the assertion should be
nr_columns >= 0
rather thannr_columns > 0
.Component: combinatorics
Keywords: dlx_solver nr_columns
Author: Simon King
Reviewer: François Bissey
Merged: sage-5.6.beta3
Issue created by migration from https://trac.sagemath.org/ticket/13882
The text was updated successfully, but these errors were encountered: