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

Using libstdc++.so.6.0.28 and libLLVM-10.so causes a segfault when creating windows #37200

Closed
ambiso opened this issue Aug 25, 2020 · 8 comments

Comments

@ambiso
Copy link

ambiso commented Aug 25, 2020

As requested by @staticfloat in #34276 I'm creating a new issue regarding this.

I've built julia from scratch and experience a segfault inside LLVM-10 when I execute the following:

using GLFW, ModernGL
window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)
Here's the full gdb trace
gdb ./julia                                                                                                                                                                   
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➤  set args -e 'using GLFW, ModernGL; window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)'
gef➤  run
Starting program: /home/ambiso/Downloads/julia/julia -e 'using GLFW, ModernGL; window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff398d640 (LWP 74968)]
[New Thread 0x7fffe2634640 (LWP 74969)]
[New Thread 0x7fffdfe33640 (LWP 74970)]
[New Thread 0x7fffdf632640 (LWP 74971)]
[New Thread 0x7fffdae31640 (LWP 74972)]
[New Thread 0x7fffd8630640 (LWP 74973)]
[New Thread 0x7fffd5e2f640 (LWP 74974)]
[New Thread 0x7fffd362e640 (LWP 74975)]
[New Thread 0x7fffb7b56640 (LWP 74977)]
[New Thread 0x7fffb7214640 (LWP 74978)]
[New Thread 0x7fffb6a13640 (LWP 74979)]
[New Thread 0x7fffb6212640 (LWP 74980)]
[New Thread 0x7fffb5a11640 (LWP 74981)]
[New Thread 0x7fffb5210640 (LWP 74982)]
[New Thread 0x7fffb4a0f640 (LWP 74983)]
[New Thread 0x7fff97fff640 (LWP 74984)]
[New Thread 0x7fff8f7fe640 (LWP 74985)]
[New Thread 0x7fff977fe640 (LWP 74986)]
[New Thread 0x7fff96ffd640 (LWP 74987)]
[New Thread 0x7fff967fc640 (LWP 74988)]
[New Thread 0x7fff95ffb640 (LWP 74989)]
[New Thread 0x7fff957fa640 (LWP 74990)]
[New Thread 0x7fff94ff9640 (LWP 74991)]
[New Thread 0x7fff8ffff640 (LWP 74992)]

Thread 16 "julia:sh1" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffb4a0f640 (LWP 74983)]
0x00007fffb8d1dd2d in llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool) () from /usr/lib/libLLVM-10.so
[ Legend: Modified register | Code | Heap | Stack | String ]
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── registers ────
$rax   : 0x0
$rbx   : 0x00007fff9c009310  →  0x00007fffbceaef08  →  0x00007fffba497b00  →   lea rax, [rip+0x2a16fd9]        # 0x7fffbceaeae0
$rcx   : 0x1
$rdx   : 0x1
$rsp   : 0x00007fffb4a06f20  →  0x00007fffbb3ecd86  →  "Machine Instruction Scheduler"
$rbp   : 0x00007fff9c009310  →  0x00007fffbceaef08  →  0x00007fffba497b00  →   lea rax, [rip+0x2a16fd9]        # 0x7fffbceaeae0
$rsi   : 0x0
$rdi   : 0x00007fff9c009310  →  0x00007fffbceaef08  →  0x00007fffba497b00  →   lea rax, [rip+0x2a16fd9]        # 0x7fffbceaeae0
$rip   : 0x00007fffb8d1dd2d  →  <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov rbp, QWORD PTR [rsi+0x10]
$r8    : 0x00007fff980042e0  →  0x00007fffbb8eb4a2  →  "SI Form memory clauses"
$r9    : 0xff
$r10   : 0x2
$r11   : 0x3
$r12   : 0x0
$r13   : 0x00007fff9c009f90  →  0x00007fffbce65940  →  0x00007fffb8b13520  →   mov rax, QWORD PTR [rip+0x43fe459]        # 0x7fffbcf11980
$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 ────
0x00007fffb4a06f20│+0x0000: 0x00007fffbb3ecd86  →  "Machine Instruction Scheduler"	 ← $rsp
0x00007fffb4a06f28│+0x0008: 0x000000000000001d
0x00007fffb4a06f30│+0x0010: 0x0000000000000002
0x00007fffb4a06f38│+0x0018: 0x000000000000001d
0x00007fffb4a06f40│+0x0020: 0x00007fff9c033070  →  0x00007ff863fbb353
0x00007fffb4a06f48│+0x0028: 0x0000000000000023 ("#"?)
0x00007fffb4a06f50│+0x0030: 0x0000000000000023 ("#"?)
0x00007fffb4a06f58│+0x0038: 0x0000000000000000
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── code:x86:64 ────
   0x7fffb8d1dd22 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> push   rbx
   0x7fffb8d1dd23 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rbx, rdi
   0x7fffb8d1dd26 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> sub    rsp, 0xc8
 → 0x7fffb8d1dd2d <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rbp, QWORD PTR [rsi+0x10]
   0x7fffb8d1dd31 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rax, QWORD PTR fs:0x28
   0x7fffb8d1dd3a <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    QWORD PTR [rsp+0xb8], rax
   0x7fffb8d1dd42 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> xor    eax, eax
   0x7fffb8d1dd44 <llvm::TargetPassConfig::addPass(llvm::Pass*,+0> mov    rax, QWORD PTR [rdi+0x38]
   0x7fffb8d1dd48 <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] 0x7fffb8d1dd2d → llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool)()
[#1] 0x7fffb8d20bf8 → llvm::TargetPassConfig::addRegAssignmentOptimized()()
[#2] 0x7fffb8d20fbe → llvm::TargetPassConfig::addOptimizedRegAlloc()()
[#3] 0x7fffb8d2121d → llvm::TargetPassConfig::addMachinePasses()()
[#4] 0x7fffb8a7f152 → mov rax, r12
[#5] 0x7fffb8a83e41 → llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::MachineModuleInfoWrapperPass*)()
[#6] 0x7fffbda0fc00 → pop rdx
[#7] 0x7fffbd968d5a → mov rdi, QWORD PTR [rbx+0x20]
[#8] 0x7fffbd9aa03b → jmp 0x7fffbd9a9c97
[#9] 0x7fffbd6599c8 → xor eax, eax
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
gef➤

LLVM-10 is loaded after the video drivers are loaded:

 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
Here is the last few hundred lines of:
strace -e openat,open julia -e 'using GLFW, ModernGL; window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)' 2> strace.log
openat(AT_FDCWD, "/home/ambiso/.julia/compiled/v1.5/ModernGL/LZIm7_bKlCx.ji", O_WRONLY|O_CREAT|O_CLOEXEC, 0666) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/home/ambiso/.julia/compiled/v1.5/ModernGL/LZIm7_bKlCx.ji", O_RDONLY|O_CLOEXEC) = 20
openat(AT_FDCWD, "/home/ambiso/.julia/artifacts/3972ca006494ebc42af5d795a626fc324f15e313/lib/libGLX_mesa.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 20
openat(AT_FDCWD, "/usr/lib/libGLX_mesa.so.0", O_RDONLY|O_CLOEXEC) = 20
openat(AT_FDCWD, "/usr/bin/../lib/libglapi.so.0", O_RDONLY|O_CLOEXEC) = 20
openat(AT_FDCWD, "/usr/bin/../lib/libdrm.so.2", O_RDONLY|O_CLOEXEC) = 20
openat(AT_FDCWD, "/usr/bin/../lib/libXdamage.so.1", O_RDONLY|O_CLOEXEC) = 20
openat(AT_FDCWD, "/usr/bin/../lib/libexpat.so.1", O_RDONLY|O_CLOEXEC) = 20
openat(AT_FDCWD, "/usr/bin/../lib/libxshmfence.so.1", O_RDONLY|O_CLOEXEC) = 20
openat(AT_FDCWD, "/usr/share/drirc.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 21
openat(AT_FDCWD, "/usr/share/drirc.d/00-mesa-defaults.conf", O_RDONLY) = 21
openat(AT_FDCWD, "/etc/drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/ambiso/.drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 21
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
openat(AT_FDCWD, "/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 21
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
openat(AT_FDCWD, "/usr/share/drirc.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 21
openat(AT_FDCWD, "/usr/share/drirc.d/00-mesa-defaults.conf", O_RDONLY) = 21
openat(AT_FDCWD, "/etc/drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/ambiso/.drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 21
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 22
openat(AT_FDCWD, "/usr/lib/dri/tls/radeonsi_dri.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/dri/radeonsi_dri.so", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/libLLVM-10.so", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/libzstd.so.1", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/libsensors.so.5", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/libdrm_radeon.so.1", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/libelf.so.1", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/libdrm_amdgpu.so.1", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/libdrm_nouveau.so.2", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/libvulkan.so.1", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/../lib/tls/x86_64/x86_64/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/../lib/../lib/tls/x86_64/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/../lib/../lib/tls/x86_64/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/../lib/../lib/tls/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/../lib/../lib/x86_64/x86_64/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/../lib/../lib/x86_64/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/../lib/../lib/x86_64/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/../lib/../lib/libffi.so.7", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/../lib/libedit.so.0", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/bin/../lib/../lib/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/proc/cpuinfo", O_RDONLY|O_CLOEXEC) = 21
openat(AT_FDCWD, "/usr/share/drirc.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 21
openat(AT_FDCWD, "/usr/share/drirc.d/00-mesa-defaults.conf", O_RDONLY) = 21
openat(AT_FDCWD, "/etc/drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/ambiso/.drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 23
openat(AT_FDCWD, "/usr/share/drirc.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 22
openat(AT_FDCWD, "/usr/share/drirc.d/00-mesa-defaults.conf", O_RDONLY) = 22
openat(AT_FDCWD, "/etc/drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/ambiso/.drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 22
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 23
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 23
openat(AT_FDCWD, "/usr/share/drirc.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 22
openat(AT_FDCWD, "/usr/share/drirc.d/00-mesa-defaults.conf", O_RDONLY) = 22
openat(AT_FDCWD, "/etc/drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/ambiso/.drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/libdrm/amdgpu.ids", O_RDONLY) = 24
openat(AT_FDCWD, "/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 24
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 25
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 25
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 25
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 25
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 25
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/uevent", O_RDONLY) = 25
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/vendor", O_RDONLY) = 25
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/device", O_RDONLY) = 25
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_vendor", O_RDONLY) = 25
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/subsystem_device", O_RDONLY) = 25
openat(AT_FDCWD, "/home/ambiso/.cache/mesa_shader_cache/index", O_RDWR|O_CREAT|O_CLOEXEC, 0644) = 24
openat(AT_FDCWD, "/dev/urandom", O_RDONLY) = 24
openat(AT_FDCWD, "/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 24
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.dir", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.dir", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.dir", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.dir", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.dir", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/workspace/destdir/share/X11/locale/locale.dir", O_RDONLY) = -1 ENOENT (No such file or directory)
+++ killed by SIGSEGV (core dumped) +++
@staticfloat
Copy link
Member

So if you ldd /usr/lib/dri/radeonsi_dri.so, it shows a dependence on LLVM 10, right?

@vchuravy I thought we namespace things such that loading a new LLVM version shouldn't cause a segfault anymore? Or is that not the case?

@ambiso
Copy link
Author

ambiso commented Aug 25, 2020

Yeah:

ldd /usr/lib/dri/radeonsi_dri.so
# ...
	libLLVM-10.so => /usr/lib/libLLVM-10.so (0x00007f81ed33c000)
# ...

@vchuravy
Copy link
Member

vchuravy commented Aug 25, 2020

~ Is this using the LLVM 10 BB, I think I noticed that we might be missing the patch to set the version suffix on the so. ~

We do namespace things, but we are using symbol versioning. I have seen that not be sufficient for libraries that use weak symbols.

@staticfloat
Copy link
Member

No, this is the Julia 1.5.0 official binary, using LLVM 9.

@vchuravy
Copy link
Member

No, this is the Julia 1.5.0 official binary, using LLVM 9.

Yeah I figured. As I mentioned in the edit, we do our best to separate things by using symbol versioning and adding a version suffix, but the thing I never have figured out are weak symbols: JuliaGPU/OpenCL.jl#165 (comment)

@vchuravy
Copy link
Member

Well this has come back to bite me....

0x00007fffc010121d in llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool) () from /usr/lib/libLLVM-11.so
(gdb) bt
#0  0x00007fffc010121d in llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool) () from /usr/lib/libLLVM-11.so
#1  0x00007fffc0104048 in llvm::TargetPassConfig::addRegAssignmentOptimized() () from /usr/lib/libLLVM-11.so
#2  0x00007fffc010440e in llvm::TargetPassConfig::addOptimizedRegAlloc() () from /usr/lib/libLLVM-11.so
#3  0x00007fffc0104a06 in llvm::TargetPassConfig::addMachinePasses() () from /usr/lib/libLLVM-11.so
#4  0x00007fffbfe53652 in ?? () from /usr/lib/libLLVM-11.so
#5  0x00007fffbfe57921 in llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::MachineModuleInfoWrapperPass*) ()
   from /usr/lib/libLLVM-11.so
#6  0x00007fffc5380686 in ?? () from /usr/lib/dri/radeonsi_dri.so
#7  0x00007fffc52e1bd5 in ?? () from /usr/lib/dri/radeonsi_dri.so
#8  0x00007fffc530fb1b in ?? () from /usr/lib/dri/radeonsi_dri.so
#9  0x00007fffc4fc9998 in ?? () from /usr/lib/dri/radeonsi_dri.so
#10 0x00007fffc4fc97d8 in ?? () from /usr/lib/dri/radeonsi_dri.so
#11 0x00007ffff77443e9 in start_thread () from /usr/lib/libpthread.so.0
#12 0x00007ffff7672293 in clone () from /usr/lib/libc.so.6

@vchuravy
Copy link
Member

and alternative to the full Mesa build is to do statically link Julia against LLVM. This will break other things (namely CUDA.jl and my heart) you can use the Make.user here #38481 (comment)

@vtjnash
Copy link
Member

vtjnash commented Mar 15, 2021

Resolved by #39390

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

4 participants