Open ferrolho opened 4 years ago
The hchebyshevcenter
needs the H-representation so it triggers computehrep!
which calls the QHull library which seems to be what is segfaulting. Could you try replacing hchebyshevcenter(my_polyhedron, lp_solver)
by computehrep!(my_polyhedron)
and check whether it still fails ?
Hi, @blegat! For the MWE above, I have replaced the line
hchebyshevcenter(my_polyhedron, lp_solver)
with
Polyhedra.computehrep!(my_polyhedron)
The resulting output is below:
I am thread #2.
I am thread #3.
I am thread #4.
I am thread #1.
ERROR: TaskFailedException:
MethodError: no method matching computehrep!(::QHull.Polyhedron)
Closest candidates are:
computehrep!(::DefaultPolyhedron) at /home/henrique/.julia/packages/Polyhedra/w0Toa/src/defaultlibrary.jl:84
Stacktrace:
[1] macro expansion at ./REPL[11]:11 [inlined]
[2] (::var"#3#threadsfor_fun#7"{UnitRange{Int64}})(::Bool) at ./threadingconstructs.jl:61
[3] (::var"#3#threadsfor_fun#7"{UnitRange{Int64}})() at ./threadingconstructs.jl:28
Stacktrace:
[1] wait(::Task) at ./task.jl:267
[2] top-level scope at ./threadingconstructs.jl:69
I am testing this using Polyhedra v0.6.3
.
Arf, this is an issue with QHull.jl (opened in https://github.com/JuliaPolyhedra/QHull.jl/issues/33), replace it with hrep(my_polyhedron)
then
Thanks for opening the issue on the right place. I replaced Polyhedra.computehrep!(my_polyhedron)
with hrep(my_polyhedron)
and it went back to segfaulting; output follows below:
I am thread #2.
I am thread #4.
I am thread #3.
I am thread #1.
signal (11): Segmentation fault
signal (11): Segmentation fault
in expression starting at REPL[10]:1
in expression starting at REPL[10]:1
_PyObject_Malloc at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyObject_Malloc at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyUnicode_New at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyUnicodeWriter_PrepareInternal at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyUnicode_DecodeUTF8Stateful at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyObject_GetAttrString at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyUnicode_New at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyUnicodeWriter_PrepareInternal at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyUnicode_DecodeUTF8Stateful at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyUnicode_FromFormatV at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyErr_FormatV at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyErr_Format at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyObject_GetBuffer at /home/henrique/miniconda3/lib/libpython3.7m.so.1.0 (unknown line)
isbuftype! at /home/henrique/.julia/packages/PyCall/zqDXB/src/pybuffer.jl:134 [inlined]
isbuftype at /home/henrique/.julia/packages/PyCall/zqDXB/src/pybuffer.jl:148 [inlined]
pysequence_query at /home/henrique/.julia/packages/PyCall/zqDXB/src/conversions.jl:756
getproperty at /home/henrique/.julia/packages/PyCall/zqDXB/src/PyCall.jl:298
pytype_query at /home/henrique/.julia/packages/PyCall/zqDXB/src/conversions.jl:770
pytype_query at /home/henrique/.julia/packages/PyCall/zqDXB/src/conversions.jl:803 [inlined]
convert at /home/henrique/.julia/packages/PyCall/zqDXB/src/conversions.jl:828
getproperty at /home/henrique/.julia/packages/PyCall/zqDXB/src/PyCall.jl:306 [inlined]
chull at /home/henrique/.julia/packages/QHull/ck7jQ/src/QHull.jl:34
getproperty at /home/henrique/.julia/packages/PyCall/zqDXB/src/PyCall.jl:306 [inlined]
chull at /home/henrique/.julia/packages/QHull/ck7jQ/src/QHull.jl:34
qhull at /home/henrique/.julia/packages/QHull/ck7jQ/src/polyhedron.jl:83
qhull at /home/henrique/.julia/packages/QHull/ck7jQ/src/polyhedron.jl:83
jl_apply_generic at /opt/julia-1.4.1/bin/../lib/libjulia.so.1 (unknown line)
qhull at /home/henrique/.julia/packages/QHull/ck7jQ/src/polyhedron.jl:62
qhull at /home/henrique/.julia/packages/QHull/ck7jQ/src/polyhedron.jl:61
getine at /home/henrique/.julia/packages/QHull/ck7jQ/src/polyhedron.jl:167
hrep at /home/henrique/.julia/packages/QHull/ck7jQ/src/polyhedron.jl:211
jl_apply_generic at /opt/julia-1.4.1/bin/../lib/libjulia.so.1 (unknown line)
macro expansion at ./REPL[10]:11 [inlined]
#3#threadsfor_fun at ./threadingconstructs.jl:61
#3#threadsfor_fun at ./threadingconstructs.jl:28
unknown function (ip: 0x7f375a84d42c)
[1] 2167 segmentation fault (core dumped) julia
I have been trying this with four threads:
Minimal working example:
I am not even sure I need a distinct
lib
andlp_solver
per thread, but I tried it anyway to check whether that was the cause of the problem...Output log: