JuliaPolyhedra / Polyhedra.jl

Polyhedral Computation Interface
Other
174 stars 27 forks source link

polyhedron(h) from docs causes infinite loop #230

Closed PythonNut closed 2 years ago

PythonNut commented 4 years ago

The following code runs "forever" on my system before being killed due to OOM.

using Polyhedra
h = HalfSpace([1, 1], 1) ∩ HalfSpace([-1, 0], 0) ∩ HalfSpace([0, -1], 0)
p = polyhedron(h)

Sending SIGTERM to Julia causes the following trace to be printed many times:

typeinf_edge at ./compiler/typeinfer.jl:484
abstract_call_method at ./compiler/abstractinterpretation.jl:419
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:111
abstract_call_known at ./compiler/abstractinterpretation.jl:904
abstract_call at ./compiler/abstractinterpretation.jl:926
abstract_call at ./compiler/abstractinterpretation.jl:911
abstract_eval at ./compiler/abstractinterpretation.jl:1005
typeinf_local at ./compiler/abstractinterpretation.jl:1270
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1326
typeinf at ./compiler/typeinfer.jl:12
blegat commented 4 years ago

This is due to printing, if you replace it with polyhedron(h). I get the same thing and I am also o' ArchLinux. https://github.com/JuliaPolyhedra/Polyhedra.jl/issues/216 Help is most welcome on this issue!

blegat commented 4 years ago

My current iterator is to avoid calling the itetators halfspaces, points either directly or indirectly (e.g. through printing) on polyhedra. You should first call hrep or vrep and use this instead. Note that the time is compilation time so it seems to be a Julia bug.

blegat commented 2 years ago

See https://github.com/JuliaPolyhedra/Polyhedra.jl/issues/216#issuecomment-1066128472