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

Arch Linux: bundled runtime fails with `CURL_OPENSSL_4' not found/can't connect to GKS socket #528

Open
lsandig opened this issue Oct 13, 2023 · 6 comments

Comments

@lsandig
Copy link

lsandig commented Oct 13, 2023

GR.jl stopped working on Arch Linux with the bundled runtime, but works with GR compiled from source.

Reading the other issues here (e.g., #319), it seems that installing the gr-framework AUR package is the recommended way of using GR.jl on Arch? If so, maybe it would be helpful to put this information in some more prominent place in the README? (Apologies if it already is there and I just missed it).

Details when using the bundled runtime:

julia> ENV["JULIA_DEBUG"] = "GR"; using GR; histogram(randn(10000))
┌ Debug: Artifacts setup
│   ENV["GKSwstype"] = "gksqt"ENV["GKS_QT"] = "env LD_LIBRARY_PATH=/home/sandig/.julia/artifacts/7661e5a9aa217ce3c468389d834a4fb43
b0911e8/lib:/home/sandig/.julia/artifacts/e4e0c1bb8f52a7a9d586af15bc1713e83c1f42af/lib:/home/sandig/.jul
ia/artifacts/d00220164876dea2cb19993200662745eed5e2db/lib:/usr/bin/../lib/julia:/home/sandig/.julia/arti
facts/fe5a1a3ce046f07a35c636ff7a75c2185ff45536"  4603 bytes  "andig/.julia/artifacts/f03dd5ac03468009d
5a99bbfcdf336c2dc372de4/lib:/home/sandig/.julia/artifacts/8a8d0ba819ce1e30b93f34cc61f891d1334be59d/lib:/
home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/lib:/usr/bin/../lib/julia:/usr/bin
/../lib /home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/bin/gksqt"
└ @ GR ~/.julia/packages/GR/yBe3g/src/GR.jl:349
┌ Debug: Default GKS_ENCODING
│   ENV["GKS_ENCODING"] = "utf8"
└ @ GR ~/.julia/packages/GR/yBe3g/src/GR.jl:363
/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/bin/gksqt: /usr/bin/../lib/julia/
libcurl.so.4: version `CURL_OPENSSL_4' not found (required by /usr/lib/libproxy/libpxbackend-1.0.so)
connect: Connection refused
GKS: can't connect to GKS socket application

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE

With runtime built from source everything works:

julia> ENV["JULIA_DEBUG"] = "GR"; 
julia> ENV["GRDIR"] = "/usr/gr";
julia> using GR; 
julia> histogram(randn(10000))
┌ Debug: Artifacts setup
│   ENV["GKSwstype"] = "gksqt"ENV["GKS_QT"] = "env LD_LIBRARY_PATH=/usr/gr/lib/ /usr/gr/bin/gksqt"
└ @ GR ~/.julia/packages/GR/yBe3g/src/GR.jl:349
┌ Debug: Default GKS_ENCODING
│   ENV["GKS_ENCODING"] = "utf8"
└ @ GR ~/.julia/packages/GR/yBe3g/src/GR.jl:363

Package versions:

(@v1.9) pkg> status GR
Status `~/.julia/environments/v1.9/Project.toml`
  [28b8d3ca] GR v0.72.10
$ pacman -Qi mesa qt5-base julia-bin gr-framework | grep 'Name\|Version'
Name            : mesa
Version         : 1:23.2.1-2
Name            : qt5-base
Version         : 5.15.11+kde+r136-1
Name            : julia-bin
Version         : 1.9.3-1
Name            : gr-framework
Version         : 0.72.10-1
@IngoMeyer441
Copy link
Contributor

Installing the AUR package is only an additional alternative to install the GR runtime. If you would like to also use GR without Julia, this is the recommended way. If you only want to create plots in Julia, you can use the pre-built binaries and don't get in touch with C-GR at all.

I have tested the GR installation both on a fresh Manjaro XFCE and an Arch with XFCE desktop and cannot reproduce the problem. Since the problem is related to libcurl and Julia's curl links to the system library: Can you use curl without problems, for example

curl -L https://google.de

?

@lsandig
Copy link
Author

lsandig commented Oct 17, 2023

Running

$ curl -L https://google.de

outputs some html to the console as expected. The different libcurls on my system are

$ locate libcurl.so
/opt/mambaforge/lib/libcurl.so
/opt/mambaforge/lib/libcurl.so.4
/opt/mambaforge/lib/libcurl.so.4.8.0
/usr/lib/libcurl.so
/usr/lib/libcurl.so.4
/usr/lib/libcurl.so.4.8.0
/usr/lib/julia/libcurl.so
/usr/lib/julia/libcurl.so.4
/usr/lib/julia/libcurl.so.4.8.0
$ pacman -Qo /usr/lib/libcurl.so /usr/lib/julia/libcurl.so /opt/mambaforge/lib/libcurl.so
/usr/lib/libcurl.so is owned by curl 8.4.0-2
/usr/lib/julia/libcurl.so is owned by julia-bin 1.9.3-1
/opt/mambaforge/lib/libcurl.so is owned by mambaforge 23.3.1.1-1

(Note that I'm using the AUR julia-bin package as recommended in the Arch Wiki.)
I also tried to see whether the bundled and external versions of gksqt try to load different (versions of) shared libraries:

$ ldd /usr/gr/bin/gksqt | cut -d\( -f1 | sort > ldd_ext
$ ldd ~/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/bin/gksqt | cut -d\( -f1 | sort > ldd_int
$ diff ldd_int ldd_ext
13d12
<       libdl.so.2 => /usr/lib/libdl.so.2
54d52
<       libpthread.so.0 => /usr/lib/libpthread.so.0

The difference does not seem to be related to libcurl.

If I remember correctly, this problem had already come up some months ago, but fixed itself with some Arch and/or Julia update, but unfortunately I can't remember the details.

Is there anything else I can do to help to debug this?

@lsandig
Copy link
Author

lsandig commented Oct 17, 2023

Here are the GR.GRPreferences.diagnostics()':

$ julia -e 'delete!(ENV, "GRDIR"); using GR; GR.GRPreferences.diagnostics()'
┌ Info: GRDIR Environment Variable
└   get(ENV, "GRDIR", missing) = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6"
┌ Info: GR Preferences
│   binary = nothing
└   grdir = nothing
┌ Info: resolved_grdir
│   resolved_grdir = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6"
│   isdir(resolved_grdir) = true
└   isdir.(joinpath.((resolved_grdir,), ("bin", "lib", "include", "fonts"))) = (true, true, true, true)
┌ Info: GR_jll Preferences
│   libGR_path = nothing
│   libGR3_path = nothing
│   libGRM_path = nothing
│   libGKS_path = nothing
│   gksqt_path = nothing
└   grplot_path = nothing
┌ Info: GR_jll Overrides.toml
│   overrides_toml_path = "/home/sandig/.julia/artifacts/Overrides.toml"
│   isfile(overrides_toml_path) = false
└   get(gr_jll_override_dict, "GR", nothing) = nothing
┌ Info: GR_jll
│   GR_jll.libGR_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/lib/libGR.so"
│   GR_jll.libGR3_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/lib/libGR3.so"
│   GR_jll.libGRM_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/lib/libGRM.so"
│   GR_jll.libGKS_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/lib/libGKS.so"
│   GR_jll.gksqt_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/bin/gksqt"
└   GR_jll.grplot_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/bin/grplot"
$ julia -e 'ENV["GRDIR"] = "/usr/gr"; using GR; GR.GRPreferences.diagnostics()'
┌ Info: GRDIR Environment Variable
└   get(ENV, "GRDIR", missing) = "/usr/gr"
┌ Info: GR Preferences
│   binary = nothing
└   grdir = nothing
┌ Info: resolved_grdir
│   resolved_grdir = "/usr/gr"
│   isdir(resolved_grdir) = true
└   isdir.(joinpath.((resolved_grdir,), ("bin", "lib", "include", "fonts"))) = (true, true, true, true)
┌ Info: GR_jll Preferences
│   libGR_path = nothing
│   libGR3_path = nothing
│   libGRM_path = nothing
│   libGKS_path = nothing
│   gksqt_path = nothing
└   grplot_path = nothing
┌ Info: GR_jll Overrides.toml
│   overrides_toml_path = "/home/sandig/.julia/artifacts/Overrides.toml"
│   isfile(overrides_toml_path) = false
└   get(gr_jll_override_dict, "GR", nothing) = nothing
┌ Info: GR_jll
│   GR_jll.libGR_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/lib/libGR.so"
│   GR_jll.libGR3_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/lib/libGR3.so"
│   GR_jll.libGRM_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/lib/libGRM.so"
│   GR_jll.libGKS_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/lib/libGKS.so"
│   GR_jll.gksqt_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/bin/gksqt"
└   GR_jll.grplot_path = "/home/sandig/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/bin/grplot"

@jheinen
Copy link
Owner

jheinen commented Oct 17, 2023

Did you switch to the GR system binary?

using GR
GR.GRPreferences.use_system_binary("/usr/gr"; force = true)

The diagnostics should look like this:

using GR; GR.GRPreferences.diagnostics()
┌ Info: GRDIR Environment Variable
└   get(ENV, "GRDIR", missing) = "/usr/gr"
┌ Info: GR Preferences
│   binary = "system"
└   grdir = "/usr/gr"
┌ Info: resolved_grdir
│   resolved_grdir = "/usr/gr"isdir(resolved_grdir) = trueisdir.(joinpath.((resolved_grdir,), ("bin", "lib", "include", "fonts"))) = (true, true, true, true)
┌ Info: GR_jll Preferences
│   libGR_path = nothing
│   libGR3_path = nothing
│   libGRM_path = nothing
│   libGKS_path = nothing
│   gksqt_path = nothing
└   grplot_path = nothing
┌ Info: GR_jll Overrides.toml
│   overrides_toml_path = "/home/sandig/.julia/artifacts/Overrides.toml"isfile(overrides_toml_path) = falseget(gr_jll_override_dict, "GR", nothing) = nothing
┌ Info: GR_jll
│   GR_jll.libGR_path = "/usr/gr/lib/libGR.so"
│   GR_jll.libGR3_path = "/usr/gr/lib/libGR3.so"
│   GR_jll.libGRM_path = "/usr/gr/lib/libGRM.so"
│   GR_jll.libGKS_path = "/usr/gr/lib/libGKS.so"
│   GR_jll.gksqt_path = "/usr/gr/bin/gksqt"
└   GR_jll.grplot_path = "/usr/gr/bin/grplot"
(binary = "system", grdir = "/usr/gr", libGR_path = nothing, libGR3_path = nothing, libGRM_path = nothing, libGKS_path = nothing, gksqt_path = nothing, grplot_path = nothing, overrides_toml_path = "/home/sandig/.julia/artifacts/Overrides.toml", gr_jll_override_dict = Dict{String, Any}())

@lsandig
Copy link
Author

lsandig commented Oct 17, 2023

Did you switch to the GR system binary?

Oh, my bad. I had incorrectly assumed that setting the environment variable would be sufficient. Including

GR.GRPreferences.use_system_binary("/usr/gr"; force = true)

results in the output that you posted.

@lsandig
Copy link
Author

lsandig commented Oct 17, 2023

Aha! I just noticed that the julia and julia-bin packages have a different pkgrel:

$ pacman -Si julia-bin julia | grep 'Name\|Version'
Name            : julia-bin
Version         : 1.9.3-1
Name            : julia
Version         : 2:1.9.3-2

The package julia (Arch package repo, linked against system libraries) seems to be a newer build than the official binaries (from the Julia project, standalone) in julia-bin. With julia I can confirm that the bundled GR works, just as you said.

So it looks like this was not a GR problem after all. Thanks for your help and sorry for the noise.

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

No branches or pull requests

3 participants