Package: release.debian.org Severity: normal Tags: bullseye User: [email protected] Usertags: pu X-Debbugs-Cc: [email protected] Control: affects -1 + src:lapack
Dear Release Team, [ Reason ] This oldstable update fixes important bug #1037188. The bug is in LAPACKE (the C interface to LAPACK, which is in Fortran). For symmetric eigenvalue problems, the returned eigenvector matrix is incorrect (when row-major layout of matrices is used). This is a regression from buster. The bug has been fixed in bookworm and sid. [ Impact ] Incorrect numerical result (one of the worst kind of bug for numerical software) [ Tests ] I verified that the proposed upload fixes the bug. It introduces no regression in the internal LAPACK testsuite. [ Risks ] The patch affects a couple of leaf functions, so the risk is limited. [ Checklist ] [X] *all* changes are documented in the d/changelog [X] I reviewed all changes and I approve them [X] attach debdiff against the package in (old)stable [X] the issue is verified as fixed in unstable [ Changes ] A quilt patch added, containing an upstream commit. -- ⢀⣴⠾⠻⢶⣦⠀ Sébastien Villemot ⣾⠁⢠⠒⠀⣿⡁ Debian Developer ⢿⡄⠘⠷⠚⠋⠀ https://sebastien.villemot.name ⠈⠳⣄⠀⠀⠀⠀ https://www.debian.org
diff -Nru lapack-3.9.0/debian/changelog lapack-3.9.0/debian/changelog --- lapack-3.9.0/debian/changelog 2020-08-01 16:15:54.000000000 +0200 +++ lapack-3.9.0/debian/changelog 2023-06-23 14:53:50.000000000 +0200 @@ -1,3 +1,11 @@ +lapack (3.9.0-3+deb11u1) bullseye; urgency=medium + + * lapacke-syev-heev.patch: new patch, fixes eigenvector matrix in + LAPACKE’s interface to symmetric eigenvalue problem (syev and heev + functions) (Closes: #1037242) + + -- Sébastien Villemot <[email protected]> Fri, 23 Jun 2023 14:53:50 +0200 + lapack (3.9.0-3) unstable; urgency=medium [ Sébastien Villemot ] diff -Nru lapack-3.9.0/debian/patches/lapacke-syev-heev.patch lapack-3.9.0/debian/patches/lapacke-syev-heev.patch --- lapack-3.9.0/debian/patches/lapacke-syev-heev.patch 1970-01-01 01:00:00.000000000 +0100 +++ lapack-3.9.0/debian/patches/lapacke-syev-heev.patch 2023-06-23 14:53:50.000000000 +0200 @@ -0,0 +1,215 @@ +Description: Fix eigenvector matrix in LAPACKE’s interface to symmetric eigenvalue problem + The syev and heev functions, when passed jobz=V and called in row major order + mode, would return an incorrect eigenvector matrix (incorrect lower- or + upper-triangle part). +Origin: upstream, https://github.com/Reference-LAPACK/lapack/commit/7d5bb9e5e641772227022689162dd9cc47e64de0 +Bug: https://github.com/Reference-LAPACK/lapack/issues/850 +Bug-Debian: https://bugs.debian.org/1037242 +Last-Update: 2023-06-23 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +diff --git a/LAPACKE/src/lapacke_cheev_work.c b/LAPACKE/src/lapacke_cheev_work.c +index f505dfab0..aa78e678e 100644 +--- a/LAPACKE/src/lapacke_cheev_work.c ++++ b/LAPACKE/src/lapacke_cheev_work.c +@@ -78,7 +78,11 @@ lapack_int LAPACKE_cheev_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_cheevd_2stage_work.c b/LAPACKE/src/lapacke_cheevd_2stage_work.c +index e9e6a5d1d..d26c84785 100644 +--- a/LAPACKE/src/lapacke_cheevd_2stage_work.c ++++ b/LAPACKE/src/lapacke_cheevd_2stage_work.c +@@ -79,7 +79,11 @@ lapack_int LAPACKE_cheevd_2stage_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_cheevd_work.c b/LAPACKE/src/lapacke_cheevd_work.c +index 4c5f352a8..e8f212efb 100644 +--- a/LAPACKE/src/lapacke_cheevd_work.c ++++ b/LAPACKE/src/lapacke_cheevd_work.c +@@ -79,8 +79,11 @@ lapack_int LAPACKE_cheevd_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); +- ++ if ( jobz == 'V') { ++ LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_dsyev_work.c b/LAPACKE/src/lapacke_dsyev_work.c +index 5a416ff45..f696c608f 100644 +--- a/LAPACKE/src/lapacke_dsyev_work.c ++++ b/LAPACKE/src/lapacke_dsyev_work.c +@@ -72,7 +72,11 @@ lapack_int LAPACKE_dsyev_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_dsy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_dge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_dsy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_dsyevd_2stage_work.c b/LAPACKE/src/lapacke_dsyevd_2stage_work.c +index 90d8ce8dc..6f9c02f6a 100644 +--- a/LAPACKE/src/lapacke_dsyevd_2stage_work.c ++++ b/LAPACKE/src/lapacke_dsyevd_2stage_work.c +@@ -76,7 +76,11 @@ lapack_int LAPACKE_dsyevd_2stage_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_dsy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_dge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_dsy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_dsyevd_work.c b/LAPACKE/src/lapacke_dsyevd_work.c +index fff476445..81ba2acb3 100644 +--- a/LAPACKE/src/lapacke_dsyevd_work.c ++++ b/LAPACKE/src/lapacke_dsyevd_work.c +@@ -76,7 +76,11 @@ lapack_int LAPACKE_dsyevd_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_dsy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_dge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_dsy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_ssyev_work.c b/LAPACKE/src/lapacke_ssyev_work.c +index 6a2f8fce3..abd62ddf3 100644 +--- a/LAPACKE/src/lapacke_ssyev_work.c ++++ b/LAPACKE/src/lapacke_ssyev_work.c +@@ -72,7 +72,11 @@ lapack_int LAPACKE_ssyev_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_ssy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_ssy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_ssyevd_2stage_work.c b/LAPACKE/src/lapacke_ssyevd_2stage_work.c +index 9394f822f..d9fe47599 100644 +--- a/LAPACKE/src/lapacke_ssyevd_2stage_work.c ++++ b/LAPACKE/src/lapacke_ssyevd_2stage_work.c +@@ -76,7 +76,11 @@ lapack_int LAPACKE_ssyevd_2stage_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_ssy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_ssy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_ssyevd_work.c b/LAPACKE/src/lapacke_ssyevd_work.c +index 12d9e84e6..bfbf49aee 100644 +--- a/LAPACKE/src/lapacke_ssyevd_work.c ++++ b/LAPACKE/src/lapacke_ssyevd_work.c +@@ -76,7 +76,11 @@ lapack_int LAPACKE_ssyevd_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_ssy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_ssy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_zheev_work.c b/LAPACKE/src/lapacke_zheev_work.c +index ce278b272..d4e93aed2 100644 +--- a/LAPACKE/src/lapacke_zheev_work.c ++++ b/LAPACKE/src/lapacke_zheev_work.c +@@ -78,7 +78,11 @@ lapack_int LAPACKE_zheev_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_zhe_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_zge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_zhe_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_zheevd_2stage_work.c b/LAPACKE/src/lapacke_zheevd_2stage_work.c +index bf2e2c828..fb33c3e2a 100644 +--- a/LAPACKE/src/lapacke_zheevd_2stage_work.c ++++ b/LAPACKE/src/lapacke_zheevd_2stage_work.c +@@ -79,7 +79,11 @@ lapack_int LAPACKE_zheevd_2stage_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_zhe_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_zge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_zhe_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: +diff --git a/LAPACKE/src/lapacke_zheevd_work.c b/LAPACKE/src/lapacke_zheevd_work.c +index f09cfe49d..5af2a1269 100644 +--- a/LAPACKE/src/lapacke_zheevd_work.c ++++ b/LAPACKE/src/lapacke_zheevd_work.c +@@ -79,7 +79,11 @@ lapack_int LAPACKE_zheevd_work( int matrix_layout, char jobz, char uplo, + info = info - 1; + } + /* Transpose output matrices */ +- LAPACKE_zhe_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ if ( jobz == 'V') { ++ LAPACKE_zge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda ); ++ } else { ++ LAPACKE_zhe_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); ++ } + /* Release memory and exit */ + LAPACKE_free( a_t ); + exit_level_0: diff -Nru lapack-3.9.0/debian/patches/series lapack-3.9.0/debian/patches/series --- lapack-3.9.0/debian/patches/series 2020-04-02 15:51:00.000000000 +0200 +++ lapack-3.9.0/debian/patches/series 2023-06-23 14:25:22.000000000 +0200 @@ -5,3 +5,4 @@ python3.patch missing-lapacke-prototypes.patch combssq-nan-propagation.patch +lapacke-syev-heev.patch

