[Rd] external BLAS library triggering erroneous ill-condtionned matrices

b@stie@_ch@ss@g@oi m@iii@g oii i@poste@@et b@stie@_ch@ss@g@oi m@iii@g oii i@poste@@et
Thu Oct 29 10:02:01 CET 2026


Dear R developers,

 

It's not a direct bug in R but a computational issue I report

because the error users see from `eigen()` gives no hint of its cause,

while this function is fundamental in numerous statistical and machine-learning

applications at the core of

R paradigm development.

 

Set-up: R 4.6.1 (Ubuntu 22.04 build), linked to the system OpenBLAS

0.3.20+ds-1 for both BLAS and LAPACK (`La_library()`:

`libopenblasp-r0.3.20.so`, `La_version()`: 3.10.0); Intel Xeon w9-3575X.

 

A well-conditioned 200 x 200 symmetric positive-definite matrix (eigenvalues

in [0.0143, 0.205]; `chol()` succeeds) makes

 

```r

eigen(A, symmetric = TRUE)

#> Error in eigen(A, symmetric = TRUE) :

#> error code 2 from LAPACK routine 'dsyevr'

```

 

| LAPACK | BLAS | `eigen(A, symmetric = TRUE)` |

|---|---|---|

| OpenBLAS 0.3.20 | OpenBLAS (default or SkylakeX kernel) | error code 2 |

| OpenBLAS 0.3.20 | OpenBLAS (Haswell kernel) | ok |

| reference 3.10.0 | OpenBLAS (SkylakeX kernel) | error code 2 |

| reference 3.10.0 | reference 3.10.0 | ok |

 

The reference libraries were loaded with `LD_PRELOAD`; the kernel was set

with `OPENBLAS_CORETYPE`. In a simulation study, 6 of 1,004 such calls

failed, and `MASS::mvrnorm()` stopped with them. The OpenBLAS side is

reported to Ubuntu (Launchpad #2040027).

 

R Installation and Administration, A.3.3 "Caveats", already warns that an

external LAPACK may carry bugs. Two small changes might still help users who

meet this error:

 

1. For INFO > 0 from `dsyevr`, an error message that says the

eigendecomposition algorithm failed internally and names the LAPACK in

use (as `La_library()` reports it), so that users can check the library

before their matrix.

2. Possibly, a retry with `dsyevd` (divide and conquer) when `dsyevr`

returns INFO > 0, as some numerical libraries do, since the two

algorithms do not share the MRRR code path.

 

The matrix (17 significant digits, plain text) and the reproduction are

available on request or, if you prefer, I can provide you with a GitHub repository instead.

 

Note I will raise an issue in parallel with the OpenBLAS Launchpad developers

 

Best regards,
‌

 

 

‌‌Bastien CHASSAGNOL, Post-Doc student, supervised by Pr. Anais Baudot

 

Affiliation: MMG, Marseille Medical Genetics

U 1251, Faculté de Médecine de La Timone,

27 Bd Jean Moulin

13005 Marseille – France

Tél: 07 88 09 09 47

Site : https://www.marseille-medical-genetics.org/a-baudot/
   ͏‌ 


 
Scientific Communication and Volunteer Activity: 

Vice-Treasury, JeBiF - RSG France.

Website: https://jebif.fr/



 


 




 


Website:   https://github.com/bastienchassagnol.
LinkedIn:  www.linkedin.com/in/bastien-chassagnol-677b67140.͏‌ 

Mails: bastien_chassagnol using laposte.net // chassagnolbastien using gmail.com // bastien.chassagnol using univ-amu.fr 


















 








































 

 

	[[alternative HTML version deleted]]



More information about the R-devel mailing list