Julia: libstdc++.so.6 is outdated and breaks RCall and others on recent Linux distros

Created on 6 Jan 2020  Β·  21Comments  Β·  Source: JuliaLang/julia

As discussed on slack with and discourse ( https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/2 ) the problem of an outdated, bundled libstdc++ (e.g. Julia 1.3.1) compared to the libstdc++ provided by the OS (e.g. Ubuntu 19.10) is that it breaks RCall.jl when Rcpp is in play due to missing GLIBCXX symbols.

I quote @staticfloat

So Ubuntu 19.10 is based on GCC 9, huh. We don't have a GCC 9 shard yet; we've been using GCC 7.2 on the buildbots (which correspondes to GLIBCXX_3.4.24), but there's no reason why we can't put our own libstdc++.so.6 into a julia binary-dist. Right now we've been bundling the libstdc++.so.6 that we get from the build environment, but it would be even better for us to just use an appropriate CompilerSupportLibraries_jll release, and craft those releases to be as compatible as possible (e.g. use the absolute newest libstdc++.so.6, the appropriate libgfortran.so.X, etc...)

An intermediate workaround is described here: https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/11?u=laborg

Most helpful comment

Making good progress! The new CompilerSupportLibraries_jll enacts my plan, and I've been cranking away on https://github.com/JuliaLang/julia/issues/33973 which will ship it by default with Julia.

All 21 comments

My plan to address this is:

@staticfloat You already merged a couple PRs from your plan - how far are you away from completing this? Thanks

Making good progress! The new CompilerSupportLibraries_jll enacts my plan, and I've been cranking away on https://github.com/JuliaLang/julia/issues/33973 which will ship it by default with Julia.

I am not sure I understand how "always shipping the latest libstdc++" is gonna work, though? Suppose your fix is deployed in Julia 1.5, and suppose for the sake of the argument this is the new LTS. Then is the plan to keep releasing updates to 1.5.x promptly whenever a new libstdc++ is released, until it is no more the LTS version? And then everybody who updates GCC on their computer must remember to also update Julia at the same time, else things break down?

Hmm, to be honest, I have a hard time seeing how that will be viable in practice. Quite possible I am missing part of the plan, though. Now, if all packages in Julia that build or link external code where to consequently use a C/C++ compiler installed via Julia, instead of a system compiler, that might work. But as soon as any external code is pulled in, there is a chance it requires a newer C++ library than what Julia has, no?

You're correct in that there is a tension between Julia's precompiled binaries and system-compiled binaries. We have to work to balance two competing interests:

  • Precompiled binaries (typically generated through BinaryBuilder.jl) that use one of the compilers we provide

  • User-compiled binaries (using a user-provided compiler).

There are a lot of ways that something can be incompatible, and we do our best to deal with all of them. In the case of libstdc++, we basically just need to have a libstdc++ that is _newer_ than all pieces of code that are trying to be loaded. Note that in the case of Julia, 99% of the time the libstdc++ that ships with Julia is much newer than the libstdc++ present on the system. For the last few years, we've been shipping a libstdc++ that comes from GCC 7, which was newer then the system compiler shipped by everything up to Debian Buster or Ubuntu Bionic. Because most users are using binaries that come from BinaryBuilder, and we tend to compile with very old compilers whenever possible there (so as to maximize the chance that a user who built Julia themselves from source can still use the precompiled binaries), the binaries we generate typically "just worked".

So the only corner case that is difficult in this scenario is when the user custom-compiles a library with their system compiler, and the system compiler is newer than what will ship with Julia. Luckily, both of these situations are rare; fewer and fewer users are compiling their own libraries for use in Julia (a trend we definitely want to encourage, as it reduces package installation errors dramatically) and for those that do, us shipping a more recent libstdc++ with Julia will allow a broader range of compiler support.

We do not yet have a way to "update" the libraries that ship with Julia easily, but in the future, we may have a method by which a user can rebuild their system image and incorporate newer versions of the libraries that ship with Julia, thereby updating the libstdc++ that is shipped with Julia. That's speculative at this point though.

I wanted to add that this appeared in a completely different context. After an update of CImGui.jl my application segfaulted. Setting the environment variable Β΄LIBGL_DEBUGΒ΄ showed that this is again is due to the libstdc++ mismatch.

libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/gerhard/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/gerhard/.drirc: No such file or directory.
libGL: pci id for fd 30: 8086:9bca, driver iris
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/iris_dri.so: /home/gerhard/julia-1.4.2/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /lib/x86_64-linux-gnu/libLLVM-9.so.1)
libGL: MESA-LOADER: failed to open \$${ORIGIN}/dri/iris_dri.so: \$${ORIGIN}/dri/iris_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/dri/iris_dri.so: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: iris
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/gerhard/.drirc: No such file or directory.
libGL: pci id for fd 30: 8086:9bca, driver iris
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/iris_dri.so: /home/gerhard/julia-1.4.2/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /lib/x86_64-linux-gnu/libLLVM-9.so.1)
libGL: MESA-LOADER: failed to open \$${ORIGIN}/dri/iris_dri.so: \$${ORIGIN}/dri/iris_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/dri/iris_dri.so: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: iris
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so: /home/gerhard/julia-1.4.2/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /lib/x86_64-linux-gnu/libLLVM-9.so.1)
libGL: MESA-LOADER: failed to open \$${ORIGIN}/dri/swrast_dri.so: \$${ORIGIN}/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/dri/swrast_dri.so: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
β”Œ Error: GLFW ERROR: code VERSION_UNAVAILABLE msg: GLX: Failed to create context: GLXBadFBConfig
β”” @ ActTools.Hub /projects/actibelt/code/act-jl-tools/src/hub/hubconsole.jl:128

signal (11): Segmentation fault
in expression starting at REPL[2]:1
glfwSetWindowUserPointer at /home/gerhard/.julia/artifacts/a1e91245761ea49ceed2c708a278f8d90a3d88ad/lib/libglfw.so (unknown line)
CreateWindow at /home/gerhard/.julia/packages/GLFW/g1nX6/src/glfw3.jl:490
CreateWindow at /home/gerhard/.julia/packages/GLFW/g1nX6/src/glfw3.jl:487 [inlined]
hub at /projects/actibelt/code/act-jl-tools/src/hub/hubconsole.jl:232
unknown function (ip: 0x7fd361c3185c)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2159 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2323
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1700 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:369
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:458
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:409 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:817
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:911
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:819
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:769
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:848
eval at ./boot.jl:331
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2145 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2323
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
run_backend at /home/gerhard/.julia/packages/Revise/jVsKo/src/Revise.jl:1023
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2159 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2323
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1700 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:369
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:458
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:409 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:817
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:911
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:819
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:848
eval at ./boot.jl:331
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2145 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2323
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:118 [inlined]
#26 at ./task.jl:358
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2145 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2323
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1700 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:687
unknown function (ip: (nil))
Allocations: 119940032 (Pool: 119907715; Big: 32317); GC: 97
Segmentation fault (core dumped)

@Gnimuc , this might be of interest for you.

Is there a workaround for this?
Do I need to build Julia myself?

@ambiso The workaround is linked in the first post:

An intermediate workaround is described here: https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/11?u=laborg

ubuntu Release 20.04 LTS (Focal Fossa) 64-bit
Kernel Linux 5.4.0-40-generic x86_64
Official https://julialang.org/ release Version 1.4.2 (2020-05-23)
Fresh install of all of them yesterday, July 16, 2020!

using RCall;
R"require(forecast)";

Warning: RCall.jl: Loading required package: forecast β”‚ Error: package or namespace load failed for β€˜forecast’ in dyn.load(file, DLLpath = DLLpath, ...): β”‚ unable to load shared object '/home/..../R/x86_64-pc-linux-gnu-library/4.0/Rcpp/libs/Rcpp.so': β”‚ /usr/local/julia/julia-1.4.2/bin/../lib/julia/libstdc++.so.6: versionGLIBCXX_3.4.26' not found (required by /home/..../R/x86_64-pc-linux-gnu-library/4.0/Rcpp/libs/Rcpp.so)
β”” @ RCall /home/..../.julia/packages/RCall/Qzssx/src/io.jl:160`

I had a crashed update on ubuntu 16.04 and had to clear system disc and start over.
I chose to use current releases, since my system was very old and ran into this very old julia bug that kills my program.
Isn't it about time the official releases get it fixed?

@ambiso The workaround is linked in the first post:

An intermediate workaround is described here: https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/11?u=laborg

This workaround now segfaults for me on Julia 1.5.0 (official x64 binary) when running:

using GLFW, ModernGL
window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)

with GLFW 3.3.2.

Is there a roadmap to get this issue fixed? E.g. building with a non-legacy libstdc++.so?

The segfault happens here:

[#0] 0x7fffbc521d2d β†’ llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool)()
[#1] 0x7fffbc524bf8 β†’ llvm::TargetPassConfig::addRegAssignmentOptimized()()
[#2] 0x7fffbc524fbe β†’ llvm::TargetPassConfig::addOptimizedRegAlloc()()
[#3] 0x7fffbc52521d β†’ llvm::TargetPassConfig::addMachinePasses()()
[#4] 0x7fffbc283152 β†’ mov rax, r12
[#5] 0x7fffbc287e41 β†’ llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::MachineModuleInfoWrapperPass*)()
[#6] 0x7fffc1213c00 β†’ pop rdx
[#7] 0x7fffc116cd5a β†’ mov rdi, QWORD PTR [rbx+0x20]
[#8] 0x7fffc11ae03b β†’ jmp 0x7fffc11adc97
[#9] 0x7fffc0e5d9c8 β†’ xor eax, eax

inside of libLLVM-10.so

LLVM 10?

Yes. Does Julia require a legacy version of LLVM?

Julia 1.5.0 should not be using LLVM 10; that segfault sounds like you are somehow forcing Julia to use a different LLVM than the one it ships with, which will cause segfaults; LLVM is not compatible across versions.

You're right according to ldd it should be using LLVM9:

$ ldd `which julia`
# ...
    libLLVM-9jl.so => /usr/bin/../lib/julia/libLLVM-9jl.so
# ...

I was thinking this could maybe be a misattribution of gdb but at least libLLVM-10 is loaded as can be seen from vmmap:

0x00007fffb9d26000 0x00007fffba514000 0x0000000000000000 r-- /usr/lib/libLLVM-10.so
0x00007fffba514000 0x00007fffbd2e6000 0x00000000007ee000 r-x /usr/lib/libLLVM-10.so
0x00007fffbd2e6000 0x00007fffbe9b8000 0x00000000035c0000 r-- /usr/lib/libLLVM-10.so
0x00007fffbe9b8000 0x00007fffbe9b9000 0x0000000004c92000 --- /usr/lib/libLLVM-10.so
0x00007fffbe9b9000 0x00007fffbeeb6000 0x0000000004c92000 r-- /usr/lib/libLLVM-10.so
0x00007fffbeeb6000 0x00007fffbf0de000 0x000000000518f000 rw- /usr/lib/libLLVM-10.so


Here is the full information from gdb

gdb julia                                                                                                                                                                  18:29:36  139 ↡
GEF for linux ready, type `gef' to start, `gef config' to configure
80 commands loaded for GDB 9.2 using Python engine 3.8
Reading symbols from julia...
gef➀  run
Starting program: /usr/bin/julia
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff35d9640 (LWP 70673)]
[New Thread 0x7fffe0de0640 (LWP 70674)]
[New Thread 0x7fffe05df640 (LWP 70675)]
[New Thread 0x7fffdbdde640 (LWP 70676)]
[New Thread 0x7fffd95dd640 (LWP 70677)]
[New Thread 0x7fffd6ddc640 (LWP 70678)]
[New Thread 0x7fffd45db640 (LWP 70679)]
[New Thread 0x7fffd1dda640 (LWP 70680)]
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.0 (2020-08-01)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using GLFW, ModernGL

julia> window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)
[New Thread 0x7fffb9b33640 (LWP 70687)]
[New Thread 0x7fffb91f1640 (LWP 70688)]
[New Thread 0x7fffb89f0640 (LWP 70689)]
[New Thread 0x7fffabfff640 (LWP 70690)]
[New Thread 0x7fffa37fe640 (LWP 70691)]
[New Thread 0x7fffab7fe640 (LWP 70692)]
[New Thread 0x7fffaaffd640 (LWP 70693)]
[New Thread 0x7fffaa7fc640 (LWP 70694)]
[New Thread 0x7fffa9ffb640 (LWP 70695)]
[New Thread 0x7fffa97fa640 (LWP 70696)]
[New Thread 0x7fffa8ff9640 (LWP 70697)]
[New Thread 0x7fffa3fff640 (LWP 70698)]
[New Thread 0x7fffa2ffd640 (LWP 70699)]
[New Thread 0x7fffa27fc640 (LWP 70700)]
[New Thread 0x7fffa1ffb640 (LWP 70701)]
[New Thread 0x7fffa17fa640 (LWP 70702)]

Thread 16 "julia:sh1" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffaaffd640 (LWP 70693)]
0x00007fffbacb3d2d in llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool) () from /usr/bin/../lib/libLLVM-10.so
[ Legend: Modified register | Code | Heap | Stack | String ]
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── registers ────
$rax   : 0x0
$rbx   : 0x00007fff98008660  β†’  0x00007fffbee44f08  β†’  0x00007fffbc42db00  β†’   lea rax, [rip+0x2a16fd9]        # 0x7fffbee44ae0
$rcx   : 0x1
$rdx   : 0x1
$rsp   : 0x00007fffaaff4f20  β†’  0x00007fffbd382d86  β†’  "Machine Instruction Scheduler"
$rbp   : 0x00007fff98008660  β†’  0x00007fffbee44f08  β†’  0x00007fffbc42db00  β†’   lea rax, [rip+0x2a16fd9]        # 0x7fffbee44ae0
$rsi   : 0x0
$rdi   : 0x00007fff98008660  β†’  0x00007fffbee44f08  β†’  0x00007fffbc42db00  β†’   lea rax, [rip+0x2a16fd9]        # 0x7fffbee44ae0
$rip   : 0x00007fffbacb3d2d  β†’  <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov rbp, QWORD PTR [rsi+0x10]
$r8    : 0xca
$r9    : 0x1
$r10   : 0x0
$r11   : 0x246
$r12   : 0x0
$r13   : 0x00007fff980092e0  β†’  0x00007fffbedfb940  β†’  0x00007fffbaaa9520  β†’   mov rax, QWORD PTR [rip+0x43fe459]        # 0x7fffbeea7980
$r14   : 0x1
$r15   : 0x1
$eflags: [zero carry parity adjust sign trap INTERRUPT direction overflow RESUME virtualx86 identification]
$cs: 0x0033 $ss: 0x002b $ds: 0x0000 $es: 0x0000 $fs: 0x0000 $gs: 0x0000
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── stack ────
0x00007fffaaff4f20β”‚+0x0000: 0x00007fffbd382d86  β†’  "Machine Instruction Scheduler"   ← $rsp
0x00007fffaaff4f28β”‚+0x0008: 0x000000000000001d
0x00007fffaaff4f30β”‚+0x0010: 0x0000000000000002
0x00007fffaaff4f38β”‚+0x0018: 0x000000000000001d
0x00007fffaaff4f40β”‚+0x0020: 0x00007fff98032900  β†’  0x00007ff867fbe0a2
0x00007fffaaff4f48β”‚+0x0028: 0x0000000000000023 ("#"?)
0x00007fffaaff4f50β”‚+0x0030: 0x0000000000000023 ("#"?)
0x00007fffaaff4f58β”‚+0x0038: 0x0000000000000000
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── code:x86:64 ────
   0x7fffbacb3d22 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> push   rbx
   0x7fffbacb3d23 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rbx, rdi
   0x7fffbacb3d26 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> sub    rsp, 0xc8
 β†’ 0x7fffbacb3d2d <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rbp, QWORD PTR [rsi+0x10]
   0x7fffbacb3d31 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rax, QWORD PTR fs:0x28
   0x7fffbacb3d3a <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    QWORD PTR [rsp+0xb8], rax
   0x7fffbacb3d42 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> xor    eax, eax
   0x7fffbacb3d44 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rax, QWORD PTR [rdi+0x38]
   0x7fffbacb3d48 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> cmp    QWORD PTR [rdi+0x28], rbp
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── threads ────
[#0] Id 1, Name: "julia", stopped, reason: SIGSEGV
[#1] Id 2, Name: "julia", stopped, reason: SIGSEGV
[#2] Id 3, Name: "julia", stopped, reason: SIGSEGV
[#3] Id 4, Name: "julia", stopped, reason: SIGSEGV
[#4] Id 5, Name: "julia", stopped, reason: SIGSEGV
[#5] Id 6, Name: "julia", stopped, reason: SIGSEGV
[#6] Id 7, Name: "julia", stopped, reason: SIGSEGV
[#7] Id 8, Name: "julia", stopped, reason: SIGSEGV
[#8] Id 9, Name: "julia", stopped, reason: SIGSEGV
[#9] Id 10, Name: "julia:cs0", stopped, reason: SIGSEGV
[#10] Id 11, Name: "julia:disk$0", stopped, reason: SIGSEGV
[#11] Id 12, Name: "julia:disk$1", stopped, reason: SIGSEGV
[#12] Id 13, Name: "julia:disk$2", stopped, reason: SIGSEGV
[#13] Id 14, Name: "julia:disk$3", stopped, reason: SIGSEGV
[#14] Id 15, Name: "julia:sh0", stopped, reason: SIGSEGV
[#15] Id 16, Name: "julia:sh1", stopped, reason: SIGSEGV
[#16] Id 17, Name: "julia:sh2", stopped, reason: SIGSEGV
[#17] Id 18, Name: "julia:sh3", stopped, reason: SIGSEGV
[#18] Id 19, Name: "julia:sh4", stopped, reason: SIGSEGV
[#19] Id 20, Name: "julia:sh5", stopped, reason: SIGSEGV
[#20] Id 21, Name: "julia:shlo0", stopped, reason: SIGSEGV
[#21] Id 22, Name: "julia:shlo1", stopped, reason: SIGSEGV
[#22] Id 23, Name: "julia:shlo2", stopped, reason: SIGSEGV
[#23] Id 24, Name: "julia:shlo3", stopped, reason: SIGSEGV
[#24] Id 25, Name: "julia:gdrv0", stopped, reason: SIGSEGV
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── trace ────
[#0] 0x7fffbacb3d2d β†’ llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool)()
[#1] 0x7fffbacb6bf8 β†’ llvm::TargetPassConfig::addRegAssignmentOptimized()()
[#2] 0x7fffbacb6fbe β†’ llvm::TargetPassConfig::addOptimizedRegAlloc()()
[#3] 0x7fffbacb721d β†’ llvm::TargetPassConfig::addMachinePasses()()
[#4] 0x7fffbaa15152 β†’ mov rax, r12
[#5] 0x7fffbaa19e41 β†’ llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::MachineModuleInfoWrapperPass*)()
[#6] 0x7fffbf9a5c00 β†’ pop rdx
[#7] 0x7fffbf8fed5a β†’ mov rdi, QWORD PTR [rbx+0x20]
[#8] 0x7fffbf94003b β†’ jmp 0x7fffbf93fc97
[#9] 0x7fffbf5ef9c8 β†’ xor eax, eax
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
gef➀

Are you setting LD_LIBRARY_PATH?

No.
I've tried running under a clean environment but get the same results:

See this long gdb log

env -i - DISPLAY=:0 XDG_CACHE_HOME=/home/ambiso/.cache                                                                                                                          18:43:31
XDG_CONFIG_HOME=/home/ambiso/.config
XDG_DATA_HOME=/home/ambiso/.local/share
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_CLASS=user
XDG_SESSION_ID=1
XDG_SESSION_TYPE=tty
XDG_VTNR=1
XKB_DEFAULT_LAYOUT=us gdb julia
DISPLAY=:0
XDG_CACHE_HOME=/home/ambiso/.cache
GEF for linux ready, type `gef' to start, `gef config' to configure
80 commands loaded for GDB 9.2 using Python engine 3.8
Reading symbols from julia...
gef➀  run
Starting program: /usr/bin/julia
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff35d9640 (LWP 72090)]
[New Thread 0x7fffe0de0640 (LWP 72094)]
[New Thread 0x7fffe05df640 (LWP 72095)]
[New Thread 0x7fffdbdde640 (LWP 72096)]
[New Thread 0x7fffd95dd640 (LWP 72097)]
[New Thread 0x7fffd6ddc640 (LWP 72098)]
[New Thread 0x7fffd45db640 (LWP 72099)]
[New Thread 0x7fffd3dda640 (LWP 72100)]
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.0 (2020-08-01)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using GLFW, ModernGL

julia> window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)
[New Thread 0x7fffb9b33640 (LWP 72107)]
[New Thread 0x7fffb91f1640 (LWP 72108)]
[New Thread 0x7fffb89f0640 (LWP 72109)]
[New Thread 0x7fffabfff640 (LWP 72110)]
[New Thread 0x7fffa37fe640 (LWP 72111)]
[New Thread 0x7fffab7fe640 (LWP 72112)]
[New Thread 0x7fffaaffd640 (LWP 72113)]
[New Thread 0x7fffaa7fc640 (LWP 72114)]
[New Thread 0x7fffa9ffb640 (LWP 72115)]
[New Thread 0x7fffa97fa640 (LWP 72116)]
[New Thread 0x7fffa8ff9640 (LWP 72117)]
[New Thread 0x7fffa3fff640 (LWP 72118)]
[New Thread 0x7fffa2ffd640 (LWP 72119)]
[New Thread 0x7fffa27fc640 (LWP 72120)]
[New Thread 0x7fffa1ffb640 (LWP 72121)]
[New Thread 0x7fffa17fa640 (LWP 72122)]

Thread 16 "julia:sh1" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffaaffd640 (LWP 72113)]
0x00007fffbacb3d2d in llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool) () from /usr/bin/../lib/libLLVM-10.so
[ Legend: Modified register | Code | Heap | Stack | String ]
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── registers ────
$rax   : 0x0
$rbx   : 0x00007fff98008560  β†’  0x00007fffbee44f08  β†’  0x00007fffbc42db00  β†’   lea rax, [rip+0x2a16fd9]        # 0x7fffbee44ae0
$rcx   : 0x1
$rdx   : 0x1
$rsp   : 0x00007fffaaff4f20  β†’  0x00007fffbd382d86  β†’  "Machine Instruction Scheduler"
$rbp   : 0x00007fff98008560  β†’  0x00007fffbee44f08  β†’  0x00007fffbc42db00  β†’   lea rax, [rip+0x2a16fd9]        # 0x7fffbee44ae0
$rsi   : 0x0
$rdi   : 0x00007fff98008560  β†’  0x00007fffbee44f08  β†’  0x00007fffbc42db00  β†’   lea rax, [rip+0x2a16fd9]        # 0x7fffbee44ae0
$rip   : 0x00007fffbacb3d2d  β†’  <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov rbp, QWORD PTR [rsi+0x10]
$r8    : 0xca
$r9    : 0x1
$r10   : 0x0
$r11   : 0x246
$r12   : 0x0
$r13   : 0x00007fff980091e0  β†’  0x00007fffbedfb940  β†’  0x00007fffbaaa9520  β†’   mov rax, QWORD PTR [rip+0x43fe459]        # 0x7fffbeea7980
$r14   : 0x1
$r15   : 0x1
$eflags: [zero carry parity adjust sign trap INTERRUPT direction overflow RESUME virtualx86 identification]
$cs: 0x0033 $ss: 0x002b $ds: 0x0000 $es: 0x0000 $fs: 0x0000 $gs: 0x0000
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── stack ────
0x00007fffaaff4f20β”‚+0x0000: 0x00007fffbd382d86  β†’  "Machine Instruction Scheduler"   ← $rsp
0x00007fffaaff4f28β”‚+0x0008: 0x000000000000001d
0x00007fffaaff4f30β”‚+0x0010: 0x0000000000000002
0x00007fffaaff4f38β”‚+0x0018: 0x000000000000001d
0x00007fffaaff4f40β”‚+0x0020: 0x00007fff98036db0  β†’  0x00007ff867fb25d6
0x00007fffaaff4f48β”‚+0x0028: 0x0000000000000023 ("#"?)
0x00007fffaaff4f50β”‚+0x0030: 0x0000000000000023 ("#"?)
0x00007fffaaff4f58β”‚+0x0038: 0x0000000000000000
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── code:x86:64 ────
   0x7fffbacb3d22 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> push   rbx
   0x7fffbacb3d23 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rbx, rdi
   0x7fffbacb3d26 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> sub    rsp, 0xc8
 β†’ 0x7fffbacb3d2d <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rbp, QWORD PTR [rsi+0x10]
   0x7fffbacb3d31 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rax, QWORD PTR fs:0x28
   0x7fffbacb3d3a <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    QWORD PTR [rsp+0xb8], rax
   0x7fffbacb3d42 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> xor    eax, eax
   0x7fffbacb3d44 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rax, QWORD PTR [rdi+0x38]
   0x7fffbacb3d48 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> cmp    QWORD PTR [rdi+0x28], rbp
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── threads ────
[#0] Id 1, Name: "julia", stopped, reason: SIGSEGV
[#1] Id 2, Name: "julia", stopped, reason: SIGSEGV
[#2] Id 3, Name: "julia", stopped, reason: SIGSEGV
[#3] Id 4, Name: "julia", stopped, reason: SIGSEGV
[#4] Id 5, Name: "julia", stopped, reason: SIGSEGV
[#5] Id 6, Name: "julia", stopped, reason: SIGSEGV
[#6] Id 7, Name: "julia", stopped, reason: SIGSEGV
[#7] Id 8, Name: "julia", stopped, reason: SIGSEGV
[#8] Id 9, Name: "julia", stopped, reason: SIGSEGV
[#9] Id 10, Name: "julia:cs0", stopped, reason: SIGSEGV
[#10] Id 11, Name: "julia:disk$0", stopped, reason: SIGSEGV
[#11] Id 12, Name: "julia:disk$1", stopped, reason: SIGSEGV
[#12] Id 13, Name: "julia:disk$2", stopped, reason: SIGSEGV
[#13] Id 14, Name: "julia:disk$3", stopped, reason: SIGSEGV
[#14] Id 15, Name: "julia:sh0", stopped, reason: SIGSEGV
[#15] Id 16, Name: "julia:sh1", stopped, reason: SIGSEGV
[#16] Id 17, Name: "julia:sh2", stopped, reason: SIGSEGV
[#17] Id 18, Name: "julia:sh3", stopped, reason: SIGSEGV
[#18] Id 19, Name: "julia:sh4", stopped, reason: SIGSEGV
[#19] Id 20, Name: "julia:sh5", stopped, reason: SIGSEGV
[#20] Id 21, Name: "julia:shlo0", stopped, reason: SIGSEGV
[#21] Id 22, Name: "julia:shlo1", stopped, reason: SIGSEGV
[#22] Id 23, Name: "julia:shlo2", stopped, reason: SIGSEGV
[#23] Id 24, Name: "julia:shlo3", stopped, reason: SIGSEGV
[#24] Id 25, Name: "julia:gdrv0", stopped, reason: SIGSEGV
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── trace ────
[#0] 0x7fffbacb3d2d β†’ llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool)()
[#1] 0x7fffbacb6bf8 β†’ llvm::TargetPassConfig::addRegAssignmentOptimized()()
[#2] 0x7fffbacb6fbe β†’ llvm::TargetPassConfig::addOptimizedRegAlloc()()
[#3] 0x7fffbacb721d β†’ llvm::TargetPassConfig::addMachinePasses()()
[#4] 0x7fffbaa15152 β†’ mov rax, r12
[#5] 0x7fffbaa19e41 β†’ llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::MachineModuleInfoWrapperPass*)()
[#6] 0x7fffbf9a5c00 β†’ pop rdx
[#7] 0x7fffbf8fed5a β†’ mov rdi, QWORD PTR [rbx+0x20]
[#8] 0x7fffbf94003b β†’ jmp 0x7fffbf93fc97
[#9] 0x7fffbf5ef9c8 β†’ xor eax, eax
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
gef➀

Perhaps GLFW or ModernGL is bringing in LLVM somehow. Can you run inside of strace -e openat,open to see at what point LLVM 10 is loaded?

Looks like you're right.


In the beginning it's loading LLVM9

       β”‚ File: strace -e openat,open julia -e 'using GLFW, ModernGL; window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)'
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   β”‚ openat(AT_FDCWD, "/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
   2   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/tls/x86_64/x86_64/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
   3   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/tls/x86_64/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
   4   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/tls/x86_64/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
   5   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/tls/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
   6   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/x86_64/x86_64/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
   7   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/x86_64/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
   8   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/x86_64/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
   9   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libjulia.so.1", O_RDONLY|O_CLOEXEC) = 3
  10   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
  11   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
  12   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
  13   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  14   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/julia/tls/x86_64/x86_64/libLLVM-9jl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  15   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/julia/tls/x86_64/libLLVM-9jl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  16   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/julia/tls/x86_64/libLLVM-9jl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  17   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/julia/tls/libLLVM-9jl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  18   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/julia/x86_64/x86_64/libLLVM-9jl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  19   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/julia/x86_64/libLLVM-9jl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  20   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/julia/x86_64/libLLVM-9jl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  21   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/julia/libLLVM-9jl.so", O_RDONLY|O_CLOEXEC) = 3
  22   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/julia/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3

But then after loading graphics drivers it seems to be loading LLVM-10 in line 718, possibly for shader compilation?

 693   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
 694   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
 695   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
 696   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 22
 697   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 22
 698   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
 699   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
 700   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
 701   β”‚ openat(AT_FDCWD, "/usr/share/drirc.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 21
 702   β”‚ openat(AT_FDCWD, "/usr/share/drirc.d/00-mesa-defaults.conf", O_RDONLY) = 21
 703   β”‚ openat(AT_FDCWD, "/etc/drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
 704   β”‚ openat(AT_FDCWD, "/home/ambiso/.drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
 705   β”‚ openat(AT_FDCWD, "/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 21
 706   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 22
 707   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 22
 708   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
 709   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
 710   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
 711   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 22
 712   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 22
 713   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
 714   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
 715   β”‚ openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
 716   β”‚ openat(AT_FDCWD, "/usr/lib/dri/tls/radeonsi_dri.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
 717   β”‚ openat(AT_FDCWD, "/usr/lib/dri/radeonsi_dri.so", O_RDONLY|O_CLOEXEC) = 21
 718   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libLLVM-10.so", O_RDONLY|O_CLOEXEC) = 21
 719   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libzstd.so.1", O_RDONLY|O_CLOEXEC) = 21
 720   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libsensors.so.5", O_RDONLY|O_CLOEXEC) = 21
 721   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libdrm_radeon.so.1", O_RDONLY|O_CLOEXEC) = 21
 722   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libelf.so.1", O_RDONLY|O_CLOEXEC) = 21
 723   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libdrm_amdgpu.so.1", O_RDONLY|O_CLOEXEC) = 21
 724   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libdrm_nouveau.so.2", O_RDONLY|O_CLOEXEC) = 21
 725   β”‚ openat(AT_FDCWD, "/usr/bin/../lib/libvulkan.so.1", O_RDONLY|O_CLOEXEC) = 21

Hmmmmm. Yeah, this is unfortunate. Can you open a new issue with this information, it's separate from this thread.

Note that this is only the case when using libstdc++.so.6.0.28. Either when blatantly replacing the library as suggested by the workarounds mentioned in this thread, or when building julia from scratch with that version of libstdc++ installed. (although I can't say anything about having other versions installed)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StefanKarpinski picture StefanKarpinski  Β·  3Comments

ararslan picture ararslan  Β·  3Comments

iamed2 picture iamed2  Β·  3Comments

helgee picture helgee  Β·  3Comments

tkoolen picture tkoolen  Β·  3Comments