Segmentation fault when using Polymake in Julia

Questions and problems about using polymake go here.
tojon11
Posts: 5
Joined: 13 Apr 2021, 18:37

Segmentation fault when using Polymake in Julia

Postby tojon11 » 13 Apr 2021, 18:54

Hello,

I am using Polymake in a Julia REPL and the following occurs:

julia> using Polymake
polymake version 4.2
Copyright (c) 1997-2020
Ewgenij Gawrilow, Michael Joswig, and the polymake team
Technische Universität Berlin, Germany
https://polymake.org

This is free software licensed under GPL; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


julia> P = polytope.Polytope(INEQUALITIES=[1 0 0; 0 1 0])
type: Polytope<Rational>

INEQUALITIES
1 0 0
0 1 0


julia> polytope.dim(P)
polymake: used package cdd
cddlib
Implementation of the double description method of Motzkin et al.
Copyright by Komei Fukuda.
http://www-oldurls.inf.ethz.ch/personal ... /cdd_home/

2

julia> polytope.integer_points_bbox(P)

signal (11): Segmentation fault: 11
in expression starting at none:1
_platform_memmove$VARIANT$Haswell at /usr/lib/system/libsystem_platform.dylib (unknown line)
Allocations: 108357215 (Pool: 108300630; Big: 56585); GC: 57

Julia has exited.



Why does polytope.dim(P) work but not polytope.integer_points_bbox(P)? Somehow all function I tried whose name does not contain "_" worked, but those which contain a "_" always lead to this kind of error. I don't know whether this is a coincidence or not.

If someone could help me, I was very grateful :-)

Kind regards,
tojon11

blorenz
Developer
Posts: 138
Joined: 10 Jan 2011, 17:21

Re: Segmentation fault when using Polymake in Julia

Postby blorenz » 14 Apr 2021, 10:17

Hi,

it is rather hard to say what can be causing this, I have seen a similar error once or twice on our MacOS CI but it was not really reproducible.

Can you please provide some more details on your configuration, i.e.

Code: Select all

versioninfo(); using Pkg; Pkg.status();
You can also try updating your packages (and maybe also julia), there are polymake 4.3 binaries available via julia.

You could also try to obtain a more meaningful backtrace by running julia within lldb:

Code: Select all

lldb -- julia (lldb) r
Then run the commands causing the crash and when it returns to the lldb prompt type bt for a backtrace.
Instead of just julia you might need to specify the full path which you can retrieve in the julia shell via Base.julia_cmd().

Best
Benjamin

tojon11
Posts: 5
Joined: 13 Apr 2021, 18:37

Re: Segmentation fault when using Polymake in Julia

Postby tojon11 » 14 Apr 2021, 13:30

Hello Benjamin,

first of all: Thank you for your reply! I am very desperate.
I did the first thing you said and the following happened:

julia> versioninfo();
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
CPU: Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = atom -a
JULIA_NUM_THREADS = 4

julia> using Pkg; Pkg.status();
Status `~/.julia/environments/v1.5/Project.toml`
[c3fe647b] AbstractAlgebra v0.10.0
[c52e3926] Atom v0.12.24
[3e1990a7] Hecke v0.8.5
[e5e0dc1b] Juno v0.8.4
[2edaba10] Nemo v0.18.2
[f1435218] Oscar v0.5.0
[d720cf60] Polymake v0.5.3
[295af30f] Revise v3.1.14


Regarding the second hint: I don't know where I have to use the command

lldb -- julia
(lldb) r

Maybe the following information is of relevance: I am using the IDE Atom.

Best Wishes
Jonas

blorenz
Developer
Posts: 138
Joined: 10 Jan 2011, 17:21

Re: Segmentation fault when using Polymake in Julia

Postby blorenz » 14 Apr 2021, 13:51

For updating the packages can you try running

Code: Select all

using Pkg; Pkg.update();
(Latest versions are Polymake.jl 0.5.5 and Oscar.jl 0.5.1.)

For lldb, and also to test this in a clean environment it would be good to try this directly in the julia shell. So please run

Code: Select all

Base.julia_cmd()
in your REPL. This should print some command like:

Code: Select all

`/Applications/...../julia ...`
This is the command that you need to start julia in your terminal and for lldb, the backticks and the extra arguments after julia can be ignored.

Then open the MacOS terminal app and enter that command to directly start the julia REPL. Here you can also try the lldb command (which I think comes with the xcode command line tools), probably something like this should start the debugger:

Code: Select all

lldb -- /Applications/Julia-1.5.app/bin/julia
Benjamin

tojon11
Posts: 5
Joined: 13 Apr 2021, 18:37

Re: Segmentation fault when using Polymake in Julia

Postby tojon11 » 14 Apr 2021, 20:27

Thank you very much again!

There happened some things now:

1) "using Pkg; Pkg.update();"

julia> using Pkg; Pkg.update();
Updating registry at `~/.julia/registries/General`
######################################################################## 100,0%
Installed NetworkOptions ─── v1.2.0
Installed LoweredCodeUtils ─ v1.4.0
Installed URIs ───────────── v1.2.0
Installed HTTP ───────────── v0.9.5
Installed JuliaFormatter ─── v0.12.3
Installed Documenter ─────── v0.26.3
Installed Atom ───────────── v0.12.30
Installed FuzzyCompletions ─ v0.4.1
Updating `~/.julia/environments/v1.5/Project.toml`
[c3fe647b] ↑ AbstractAlgebra v0.10.0 ⇒ v0.13.6
[c52e3926] ↑ Atom v0.12.24 ⇒ v0.12.30
[3e1990a7] ↑ Hecke v0.8.5 ⇒ v0.9.5
[2edaba10] ↑ Nemo v0.18.2 ⇒ v0.20.1
[f1435218] ↑ Oscar v0.5.0 ⇒ v0.5.1
[d720cf60] ↑ Polymake v0.5.3 ⇒ v0.5.5
Updating `~/.julia/environments/v1.5/Manifest.toml`
[c3fe647b] ↑ AbstractAlgebra v0.10.0 ⇒ v0.13.6
[e21ec000] ↑ Antic_jll v0.2.2+1 ⇒ v0.200.301+0
[d9960996] ↑ Arb_jll v2.18.1+1 ⇒ v200.1900.1+0
[c52e3926] ↑ Atom v0.12.24 ⇒ v0.12.30
[e30172f5] ↑ Documenter v0.25.5 ⇒ v0.26.3
[e134572f] ↑ FLINT_jll v2.6.3+1 ⇒ v200.700.100+0
[fb4132e2] ↑ FuzzyCompletions v0.2.6 ⇒ v0.4.1
[c863536a] ↑ GAP v0.4.4 ⇒ v0.5.2
[5cd7a574] + GAP_jll v400.1100.1+0
[de1ad85e] + GAP_lib_jll v400.1100.0+0
[cd3eb016] ↑ HTTP v0.8.19 ⇒ v0.9.5
[3e1990a7] ↑ Hecke v0.8.5 ⇒ v0.9.5
[98e50ef6] ↑ JuliaFormatter v0.10.9 ⇒ v0.12.3
[472f376f] ↑ LoadFlint v0.3.4 ⇒ v0.5.1
[6f1432cf] ↑ LoweredCodeUtils v1.2.9 ⇒ v1.4.0
[2edaba10] ↑ Nemo v0.18.2 ⇒ v0.20.1
[ca575930] + NetworkOptions v1.2.0
[f1435218] ↑ Oscar v0.5.0 ⇒ v0.5.1
[d720cf60] ↑ Polymake v0.5.3 ⇒ v0.5.5
[bcd08a7b] ↑ Singular v0.4.2 ⇒ v0.4.6
[43d676ae] ↑ Singular_jll v4.1.3+6 ⇒ v402.0.104+0
[5c2747f8] + URIs v1.2.0
[4d8266f6] ↑ libpolymake_julia_jll v0.3.0+0 ⇒ v0.4.105+0
[ae4fbd8f] ↑ libsingular_julia_jll v0.2.0+0 ⇒ v0.9.205+0
[6690c6e9] ↑ normaliz_jll v3.8.5+2 ⇒ v300.800.901+0
[7c209550] ↑ polymake_jll v4.2.1+0 ⇒ v400.300.1+0


2) "Base.julia_cmd()"

julia> Base.julia_cmd()
`/Applications/Julia-1.5.app/Contents/Resources/julia/bin/julia -Cnative -J/Applications/Julia-1.5.app/Contents/Resources/julia/lib/julia/sys.dylib --depwarn=yes -g1 --color=yes`


3)
But then when I wanted to use lldb something did not work as expected I think:

lldb -- /Applications/Julia-1.5.app/Contents/Resources/julia/bin/julia
(lldb) target create "/Applications/Julia-1.5.app/Contents/Resources/julia/bin/julia"
Current executable set to '/Applications/Julia-1.5.app/Contents/Resources/julia/bin/julia' (x86_64).
(lldb) r
error: process exited with status -1 (Error 1)
(lldb)


I think something else should have happened after typing "r", or did I do something wrong?

Best wishes,
Jonas

P.S.: I tried the exact same Polymake commands in the terminal as in Atom (as described in my first post) and the same thing happened.

User avatar
joswig
Main Author
Posts: 279
Joined: 24 Dec 2010, 11:10

Re: Segmentation fault when using Polymake in Julia

Postby joswig » 15 Apr 2021, 13:10

Does this also happen with julia-1.6?

https://julialang.org/downloads/

tojon11
Posts: 5
Joined: 13 Apr 2021, 18:37

Re: Segmentation fault when using Polymake in Julia

Postby tojon11 » 15 Apr 2021, 20:45

Thank you! Updating to 1.6 worked, this problem is solved!

However, something else happened, but probably because I gave a wrong input and not because the original problem persists:

Code: Select all

julia> P = polytope.Polytope(INEQUALITIES=[-1 1 0; -1 0 1]) type: Polytope<Rational> INEQUALITIES -1 1 0 -1 0 1 1 0 0 julia> polytope.integer_points_bbox(P) ERROR: Cannot determine upper bounds for generating integer points at -e line 0.
Best Wishes,
Jonas

User avatar
joswig
Main Author
Posts: 279
Joined: 24 Dec 2010, 11:10

Re: Segmentation fault when using Polymake in Julia

Postby joswig » 16 Apr 2021, 09:33

That polyhedron is unbounded; so the function says it cannot count the lattice points.

Notice the extra inequality "1 0 0" (which amounts to 1 >= 0) that was added by polymake to your input. This is useful for combinatorial reasons:
https://polymake.org/doku.php/user_guid ... oordinates

tojon11
Posts: 5
Joined: 13 Apr 2021, 18:37

Re: Segmentation fault when using Polymake in Julia

Postby tojon11 » 16 Apr 2021, 10:06

Ah I see, I think it works now. Thank you both very much for your effort!

Best Wishes,
Jonas


Return to “Helpdesk”