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

illegal instruction in try/finally #29382

Closed
mlubin opened this issue Sep 27, 2018 · 3 comments
Closed

illegal instruction in try/finally #29382

mlubin opened this issue Sep 27, 2018 · 3 comments

Comments

@mlubin
Copy link
Member

mlubin commented Sep 27, 2018

To reproduce:

  1. Check out this PR: [release-0.18] Readd GLPK jump-dev/JuMP.jl#1498
  2. Run JuMP's tests
  3. Wait a few minutes
  4. Expected output: https://travis-ci.org/JuliaOpt/JuMP.jl/jobs/433523251#L864

@tkoolen correctly guessed an issue with try/finally. The illegal instruction goes away when I comment out the try/finally/end lines at https://github.com/JuliaOpt/GLPKMathProgInterface.jl/blob/fdad2fb72a93be219573e48248b141380c821ee8/src/GLPKInterfaceMIP.jl#L457-L471 leaving the code in between.

Note that this code involves callbacks through C back to Julia which has caused issues with exception handling in the past (#14284).

@mlubin
Copy link
Member Author

mlubin commented Sep 27, 2018

Reduced test case. Using JuMP@1fd17f17 (release-0.18) and GLPKMathProgInterface v0.4.3

using JuMP, GLPKMathProgInterface

mod = Model(solver=GLPKSolverMIP())
@variable(mod, 0 <= x <= 2, Int)
@variable(mod, 0 <= y <= 2, Int)
@objective(mod, Max, y + 0.5x)
function corners(cb)
    x_val = getvalue(x)
    y_val = getvalue(y)
    TOL = 1e-6
    if y_val + x_val > 3 + TOL
        @lazyconstraint(cb, y + 0.5x + 0.5x <= 3)
    end
end
addlazycallback(mod, corners)
@show solve(mod)

Interestingly enough, the crash goes away with JuliaOpt/GLPKMathProgInterface.jl#54. So it looks like it was the missing method errors that turned into illegal instructions.

@c42f
Copy link
Member

c42f commented Oct 3, 2018

This sounds familiar, I've seen the missing method error turn into an illegal instruction. I think it was over at JuliaArrays/StaticArrays.jl#493, but annoyingly I can't put my finger on the exact code now.

@ViralBShah
Copy link
Member

Reopen if still an issue.

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

No branches or pull requests

3 participants