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

SegFault for BlockElimination #65

Closed
mengyuest opened this issue May 13, 2021 · 8 comments · Fixed by #88
Closed

SegFault for BlockElimination #65

mengyuest opened this issue May 13, 2021 · 8 comments · Fixed by #88
Assignees

Comments

@mengyuest
Copy link

mengyuest commented May 13, 2021

I encountered Segmentation Fault when using BlockElimination function. The minimum test code is as followed:

using Polyhedra, CDDLib
A=[-0.5458700320410754 -0.43028245741634163 -0.32949085078374596 -2.0178905562651726 1.0 0.0 0.0; -0.001696359345425646 -0.5944052771561518 -0.14259145370038157 -0.5715464802979783 0.0 1.0 0.0; 0.11176371186473642 0.16920950931092318 -0.6603345932930139 -0.11228115664803578 0.0 0.0 1.0; 0.5458700320410754 0.43028245741634163 0.32949085078374596 2.0178905562651726 -1.0 0.0 0.0; 0.001696359345425646 0.5944052771561518 0.14259145370038157 0.5715464802979783 0.0 -1.0 0.0; -0.11176371186473642 -0.16920950931092318 0.6603345932930139 0.11228115664803578 0.0 0.0 -1.0; -1.0 0.10091143255328394 3.4102811211934987 -6.813065334385856 0.0 0.0 0.0; 1.0 -0.8932312066317769 0.7730763460460294 2.524023981062126 0.0 0.0 0.0; 1.0 -0.0930882189983393 1.7475328342666678 4.495570410302662 0.0 0.0 0.0; -1.0 -0.05182954771533831 -1.1189515717142475 -3.9532525226843815 0.0 0.0 0.0; 1.0 4.239841226638941 -8.774257911319019 -2.2499336877985545 0.0 0.0 0.0; -1.0 1.0414219678515158 1.033883503426593 -0.9840648095304564 0.0 0.0 0.0; 1.0 -0.001284573155440541 -1.6845061382720732 -1.0153065939984884 0.0 0.0 0.0; 1.0 -4.299428761845123 -3.940453969462597 6.702373679526568 0.0 0.0 0.0; -1.0 0.0 0.0 0.0 0.0 0.0 0.0; 0.0 1.0 0.0 0.0 0.0 0.0 0.0]
b=[0.3653256599471767, 0.4574210313524346, 0.35534066564751254, -0.3653256599471767, -0.4574210313524346, -0.35534066564751254, -2.9769531018983972, 0.8613646098710365, 3.3649667529429204, -2.093853811646953, 8.893608931702863, 0.7565246179371888, 1.433621499051063, -3.9487728883626625, -1.0, 2.0]
poly_in = polyhedron(hrep(A,b), CDDLib.Library(:float))
poly_out = eliminate(poly_in, collect(1:4), BlockElimination())

I am using Julia v1.4.2 and Ubuntu 18.04. Further package details are as followed:

  [6e4b80f9] BenchmarkTools v0.5.0
  [3391f64e] CDDLib v0.6.3
  [5789e2e9] FileIO v1.4.5
  [587475ba] Flux v0.11.1
  [60bf3e95] GLPK v0.13.0
  [033835bb] JLD2 v0.3.1
  [682c06a0] JSON v0.21.1
  [4076af6c] JuMP v0.21.5
  [b4f0291d] LazySets v1.37.14
  [23992714] MAT v0.9.2
  [15e1cf62] NPZ v0.4.0
  [91a5bcdd] Plots v1.6.12
  [67491407] Polyhedra v0.6.11
  [d330b81b] PyPlot v2.9.0
  [9f7883ad] Tracker v0.2.13
  [37e2e46d] LinearAlgebra

Any suggestion on this? Thanks.

@mforets
Copy link
Member

mforets commented May 15, 2021

fwiw, i can repro on Julia v1.6.0 and Polyhedra v0.6.13.

@blegat
Copy link
Member

blegat commented May 15, 2021

Thanks for the small reproducible example! Turns out this is a bug in cddlib: cddlib/cddlib#61.
Once this is fixed, this should throw Numerically inconsistent. It still won't make it work but it's considerably better than a segfault ^^

@nsajko
Copy link

nsajko commented Apr 13, 2022

ftr this still isn't fixed after the cddlib pull request is merged

@blegat
Copy link
Member

blegat commented Apr 13, 2022

Do you get a segfault or another error ?

@schillic
Copy link

Do you get a segfault or another error ?

Julia v1.8 is still affected by the segfault.

  [3391f64e] CDDLib v0.9.1
  [67491407] Polyhedra v0.7.5

I am not very familiar with how the jll library is built, but maybe it has to be updated to include the fix. The latest release over at cddlib is from December 2020 (i.e., does not contain the fix), and the version used at juliapackages indicates this even older commit from February 2020 (i.e., does not contain the fix either).

@odow
Copy link
Contributor

odow commented Feb 21, 2024

This is still a problem. Yggdrasil build is missing these commits:

cddlib/cddlib@87220b4...master

I guess the hesitation is because there hasn't been an official release yet.

@odow
Copy link
Contributor

odow commented Feb 21, 2024

See JuliaPackaging/Yggdrasil#8142

@schillic
Copy link

schillic commented Jul 7, 2024

Thanks for the small reproducible example! Turns out this is a bug in cddlib: cddlib/cddlib#61. Once this is fixed, this should throw Numerically inconsistent.

Well, not quite:

ERROR: ddf_BlockElimination returned a NULL pointer but did not provide any error.
Please report this by opening an issue at https://github.com/JuliaPolyhedra/CDDLib.jl.

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

Successfully merging a pull request may close this issue.

6 participants