OpenBLAS: Calculating eigenvalues crashes R and Julia

Hello,

I tried to calculate eigenvalues in both Julia and R, and it throws an error. Even small matrices, like 10 x 10 and symmetric, throws an error. Here is an example in R:

aa <- matrix(rnorm(50*10),ncol=10)
 B <- t(aa)%*%aa
eigen(B)

And the core dump:

PID: 3209 (R)
           UID: 1000 (danielc)
           GID: 1000 (danielc)
        Signal: 4 (ILL)
     Timestamp: Thu 2020-12-17 17:48:18 -03 (7min ago)
  Command Line: /usr/lib64/R/bin/exec/R
    Executable: /usr/lib/R/bin/exec/R
 Control Group: /user.slice/user-1000.slice/session-2.scope
          Unit: session-2.scope
         Slice: user-1000.slice
       Session: 2
     Owner UID: 1000 (danielc)
      Hostname: daniel-vostro3560
       Storage: /var/lib/systemd/coredump/core.R.1000.5a08490df9c74153aa26c65ab6554092.3209.1608238>
       Message: Process 3209 (R) of user 1000 dumped core.
                
                Stack trace of thread 3209:
                #0  0x00007f0f5395cf76 dsymv_thread_L (libblas.so.3 + 0xccf76)
                #1  0x00007f0f5392f8e7 dsymv_ (libblas.so.3 + 0x9f8e7)
                #2  0x00007f0f2fd05b7f dsytd2_ (liblapack.so.3 + 0x237b7f)
                #3  0x00007f0f2fd0720c dsytrd_ (liblapack.so.3 + 0x23920c)
                #4  0x00007f0f2fcffcd1 dsyevr_ (liblapack.so.3 + 0x231cd1)
                #5  0x00007f0f54d85b50 n/a (lapack.so + 0x3b50)
                #6  0x00007f0f54ecfa26 n/a (libR.so + 0x136a26)
                #7  0x00007f0f54ee9a80 Rf_eval (libR.so + 0x150a80)
                #8  0x00007f0f54eeb7b7 n/a (libR.so + 0x1527b7)
                #9  0x00007f0f54eec614 Rf_applyClosure (libR.so + 0x153614)
                #10 0x00007f0f54ee9cb1 Rf_eval (libR.so + 0x150cb1)
                #11 0x00007f0f54f1e046 Rf_ReplIteration (libR.so + 0x185046)
                #12 0x00007f0f54f1e3e1 n/a (libR.so + 0x1853e1)
                #13 0x00007f0f54f1e499 run_Rmainloop (libR.so + 0x185499)
                #14 0x000055c0bb8ea03d main (R + 0x103d)
                #15 0x00007f0f54bc2152 __libc_start_main (libc.so.6 + 0x28152)
                #16 0x000055c0bb8ea07e _start (R + 0x107e)

I moved from OpenBLAS to BLAS and this solved the error, so I am guessing the issue is with OpenBLAS? I was using OpenBLAS 0.3.13 and the LAPACK version is 3.9.0-3, in EndeavourOS (arch based).

I will be glad to provide any other details if you need them.

Thanks in advance

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 28 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@brada4 Thank you. I have added a task here: https://bugs.archlinux.org/task/69032

Can confirm that the update posted on Arch today has resolved the issue on my apparently outdated i7.

I’m also affected by this (openblas 0.3.13 from the Arch repos, Intel Core i5-760).

For me it crashes on a vmovdqa instruction in openblas_get_config():

(gdb) disassemble
Dump of assembler code for function openblas_get_config:
   0x00007ffff6f3b4a0 <+0>:     push   %rbp
   0x00007ffff6f3b4a1 <+1>:     sub    $0x20,%rsp
=> 0x00007ffff6f3b4a5 <+5>:     vmovdqa 0xf91c53(%rip),%xmm0        # 0x7ffff7ecd100
   0x00007ffff6f3b4ad <+13>:    mov    %fs:0x28,%rax
   0x00007ffff6f3b4b6 <+22>:    mov    %rax,0x18(%rsp)
   0x00007ffff6f3b4bb <+27>:    xor    %eax,%eax
   0x00007ffff6f3b4bd <+29>:    movabs $0x504d4e45504f5f45,%rax
[snip]

Minimal reproducer:

#include <stdio.h>

char* openblas_get_config(void);

int main(void) {
    puts(openblas_get_config());
}

Compile with

$ gcc -std=c18 -Wall -Wextra -pedantic -lopenblas -o openblas_sigill openblas_sigill.c

and

$ ./openblas_sigill
[1]    4774 illegal hardware instruction (core dumped)  ./openblas_sigill

Interestingly, rebuilding the package locally fixes it for me. (@martin-frbg The PKGBUILD you linked is indeed the current build file.) The R example also works for me with my local build.