-
Notifications
You must be signed in to change notification settings - Fork 16
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
Modify-after-free bug #202
Comments
This comment was marked as outdated.
This comment was marked as outdated.
I haven't tried to reproduce locally, but this is a pretty bad error. Let me see if I can find a minimal example. |
I can reproduce this on macOS. Working on simplifying. |
(hyp) pkg> st
Status `/private/tmp/hyp/Project.toml`
[87dc4568] HiGHS v1.8.1
[b99e6be6] Hypatia v0.7.4
[4076af6c] JuMP v1.19.0
[2f354839] Pajarito v0.8.2
[ab19e554] PajaritoExtras v0.0.0 `https://github.com/chriscoey/PajaritoExtras.jl#main`
[37e2e46d] LinearAlgebra
[9a3f8284] Random
(hyp) pkg> st -m HiGHS_jll
Status `/private/tmp/hyp/Manifest.toml`
[8fd58aa0] HiGHS_jll v1.6.0+1
julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (x86_64-apple-darwin22.4.0)
CPU: 8 × Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
Threads: 1 on 8 virtual cores A smaller example is using JuMP
import HiGHS
import Hypatia
import Pajarito
import PajaritoExtras # https://github.com/chriscoey/PajaritoExtras.jl
import Random
function main()
Random.seed!(2)
A = rand(30,7)
m, n = size(A)
opt = optimizer_with_attributes(
Pajarito.Optimizer,
"oa_solver" => optimizer_with_attributes(
HiGHS.Optimizer,
"mip_feasibility_tolerance" => 1e-8,
"mip_rel_gap" => 1e-6,
),
"conic_solver" => optimizer_with_attributes(Hypatia.Optimizer),
)
model = Model(opt)
@variables(model, begin
w[1:m]
x[1:m], Int
Z_mat[1:m, 1:n]
T_mat[1:m, 1:n]
J_mat[1:n, 1:n]
t
end)
@objective(model, Max, t)
J_diag = [J_mat[i, i] for i in 1:n]
@constraints(model, begin
sum(w) == 1
x .≤ 3
x .>= 0
w .>= 0
x .== 10w
sum(A[i, :] * Z_mat[i,:]' for i in 1:m) .== J_mat
[j in 1:n], sum(T_mat[:,j]) <= J_mat[j,j]
T_mat .>= 0
[t; J_diag] in Hypatia.HypoGeoMeanCone{Float64}(n+1)
[i in 1:m, j in 1:n], [T_mat[i,j]/2, w[i], Z_mat[i,j]] in Hypatia.EpiPerSquareCone{Float64}(3)
end)
for i in 1:(n-1), j in (i+1):n
JuMP.fix(J_mat[i,j], 0)
end
optimize!(model)
return
end
main()
|
So I caught the failing MPS file, but solving it in a new session doesn't trigger the crash. I think the problem is I'm missing the MIP start. So let me try and snatch that.
|
@dhendryc perhaps in the mean time, use a different MIP solver, like Gurobi or SCIP. |
I'm really struggling to create a standalone reproducer. A large part of it seems to be the iterative nature of the Pajarito solve. @jajhall is this stack trace helpful at all? julia(53732,0x7ff84b818700) malloc: Incorrect checksum for freed object 0x7fb3c477d200: probably modified after being freed.
Corrupt value: 0x0
julia(53732,0x7ff84b818700) malloc: *** set a breakpoint in malloc_error_break to debug
[53732] signal (6): Abort trap: 6
in expression starting at /private/tmp/hypatia.jl:51
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
pthread_kill at /usr/lib/system/libsystem_pthread.dylib (unknown line)
abort at /usr/lib/system/libsystem_c.dylib (unknown line)
malloc_vreport at /usr/lib/system/libsystem_malloc.dylib (unknown line)
malloc_zone_error at /usr/lib/system/libsystem_malloc.dylib (unknown line)
small_free_list_remove_ptr_no_clear at /usr/lib/system/libsystem_malloc.dylib (unknown line)
free_small at /usr/lib/system/libsystem_malloc.dylib (unknown line)
_ZNK11HSimplexNla16debugCheckInvertENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEi at /Users/oscar/.julia/artifacts/c0c2656556da74046e66a7912b6d3d299b4c5a2d/lib/libhighs.1.6.0.dylib (unknown line)
_ZNK4HEkk19debugNlaCheckInvertENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEi at /Users/oscar/.julia/artifacts/c0c2656556da74046e66a7912b6d3d299b4c5a2d/lib/libhighs.1.6.0.dylib (unknown line)
_ZN4HEkk13computeFactorEv at /Users/oscar/.julia/artifacts/c0c2656556da74046e66a7912b6d3d299b4c5a2d/lib/libhighs.1.6.0.dylib (unknown line) |
Here's a different one:
|
I managed to trigger this in a very unhelpful way WARNING: Failed to solve node with all integer columns fixed. Declaring node infeasible.
547 14 234 94.56% -0.1546302467 -0.1536649524 0.63% 135 0 332 259760 200.7s
581 11 251 96.72% -0.1546302467 -0.1536649524 0.63% 137 0 356 271128 205.7s
614 6 270 99.65% -0.1538506824 -0.1536649524 0.12% 150 0 390 280301 211.3s
Solving report
Status Optimal
Primal bound -0.153664952386
Dual bound -0.153665178278
Gap 0.000147% (tolerance: 0.000651%)
Solution status feasible
-0.153664952386 (objective)
0 (bound viol.)
0 (int. viol.)
0 (row viol.)
Timing 211.42 (total)
0.01 (presolve)
0.00 (postsolve)
Nodes 620
LP iterations 280918 (total)
47854 (strong br.)
0 (separation)
56809 (heuristics)
julia> import MathOptInterface as MOI; import LinearAlgebra
julia> x = MOI.VariableIndex(1)
julia(55690,0x7ff84b818700) malloc: Heap corruption detected, free list is damaged at 0x600000947200
*** Incorrect guard value: 8589934593992
julia(55690,0x7ff84b818700) malloc: *** set a breakpoint in malloc_error_break to debug
[55690] signal (6): Abort trap: 6
in expression starting at none:0
julia(55690,0x700005667000) malloc: Heap corruption detected, free list is damaged at 0x600000946000
*** Incorrect guard value: 4631491120
julia(55690,0x700005667000) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort julia --project=. |
The warning you get from the HiGHS MIP solver is not one I've ever seen. It could be that it yields incorrect behaviour. I'll have a look. Rather than use gurobi or SCIP, users can try setting a different random seed before calling HiGHS::run() |
It works with SCIP. And it does work for HiGHS in some instances. Would be weird if that was due to a random seed, though. |
I don't think the |
OK Fair enough |
With a different random seed the solver will take a different path so maybe not hit the same error |
Hi all,
I'm trying to solve some MISOCP with Pajarito using Hypatia as conic solver and HiGHS as MIP solver, see the attached files.
Weird_HiGHS_error.txt
spectral_functions_JuMP.txt
It works for some instances but for others I get a weird error, see
error_message.txt .
It seems to me that some HiGHS library files are not found. This also completely crashes my terminal, as in both Ctrl + C as well the ESC don't work.
Additionally, this happens on both my linux as well as my windows computer.
I'm on Julia 1.9.0 and have the most up-to-date HiGHS version.
Thank you for your help!
The text was updated successfully, but these errors were encountered: