Skip to content

[v3.12.0] sblat1.f (SNRM2) test fail on i386 architectures #963

Open

Description

@cdluminate

Description

The sblat1.f test fails on i386 architectures, including i386 (effectively i686), and hurd-i386:
https://buildd.debian.org/status/package.php?p=lapack&suite=experimental
https://buildd.debian.org/status/fetch.php?pkg=lapack&arch=i386&ver=3.12.0-1&stamp=1702247469&raw=0
https://buildd.debian.org/status/fetch.php?pkg=lapack&arch=hurd-i386&ver=3.12.0-1&stamp=1702271309&raw=0

The typical failure is the SNRM2 call, which look like:

 Test of subprogram number  7            SNRM2 
                                       FAIL
  SNRM2: N=     4, INCX=  -2, IV= 9, IW= 9, test= 0.20971520E+07
                                       FAIL
  SNRM2: N=     4, INCX=   1, IV= 9, IW= 9, test= 0.20971520E+07
                                    ----- PASS -----

I'm confused about why this failure does not occur on other 32-bit architectures such as armhf and m68k. Any idea?
It does not seem like a compiler issue neither. Both gfortran-12 and gfortran-13 lead to the same results.

The minimal example to reproduce this issue is to build this package on a clean Debian unstable (sid) chroot.

Checklist

  • I've included a minimal example to reproduce the issue
  • I'd be willing to make a PR to solve this issue

Activity

  1. angsch commented on Dec 20, 2023

    @angsch
    Collaborator

    There is a typo in the test that on most systems apparently yields a zero, but not on the two systems above.

    @cdluminate I sent you an email.

  2. cdluminate commented on Dec 21, 2023

    @cdluminate
    ContributorAuthor

    BTW, the following is the default build flags for Debian (distribution-wide):

    CFLAGS=-g -O2 -ffile-prefix-map=/home/lumin=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection
    CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2
    FFLAGS=-g -O2 -ffile-prefix-map=/home/lumin=. -fstack-protector-strong -fstack-clash-protection -fcf-protection
    LDFLAGS=-Wl,-z,relro
    

    I've not yet verified which argument triggered the bug. But I cannot reproduce the issue on i386 with the default flags in make.inc. The bug only appears when built using debian's flags and tools. There is a resemblance to #961 which is only triggered by coverage build.

  3. added 2 commits that reference this issue on Dec 21, 2023
    0504c35
    c6ba5cd
  4. cdluminate commented on Dec 21, 2023

    @cdluminate
    ContributorAuthor

    Ok, after fixing the test implementation (#964), the ZDNRM2 test breaks again with Debian specific build flags. I think I should try to contribute a CI test with Debian build flags. Those stack protection flags can help you guys catch more bugs.

  5. cdluminate commented on Dec 21, 2023

    @cdluminate
    ContributorAuthor

    With the default flags in make.inc. The test passed. But with stack protections, you can reproduce the issue with (1) the following config, (2) Patch #964, and (3) the command make blas_testing on an amd64 machine.

    21c21
    < FFLAGS = -O2 -frecursive
    ---
    > FFLAGS = -g -O2 -fstack-protector-strong -fstack-clash-protection -fcf-protection
    27c27
    < LDFLAGS =
    ---
    > LDFLAGS = -Wl,-z,relro

    The error looks like

     Test of subprogram number  6            DZNRM2                                                                                
                                           FAIL                                                                                    
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW= 1, test=            NaN                                                               
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW= 2, test=            NaN                                                               
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW= 3, test=            NaN                                                               
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW= 4, test=            NaN                                                               
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW= 5, test=            NaN                                                               
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW= 6, test=            NaN                                                               
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW= 7, test=            NaN                                                               
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW= 8, test=            NaN                                                               
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW= 9, test=            NaN                                                               
     DZNRM2: N=     1, INCX=  -2, IV= 9, IW=10, test=            NaN                                                               
                                           FAIL                                                                                    
     DZNRM2: N=     1, INCX=   1, IV= 9, IW= 1, test=            NaN                                                               
     DZNRM2: N=     1, INCX=   1, IV= 9, IW= 2, test=            NaN                                                               
     DZNRM2: N=     1, INCX=   1, IV= 9, IW= 3, test=            NaN                                                               
     DZNRM2: N=     1, INCX=   1, IV= 9, IW= 4, test=            NaN                                                               
     DZNRM2: N=     1, INCX=   1, IV= 9, IW= 5, test=            NaN                                                               
     DZNRM2: N=     1, INCX=   1, IV= 9, IW= 6, test=            NaN                                                               
     DZNRM2: N=     1, INCX=   1, IV= 9, IW= 7, test=            NaN                                                               
     DZNRM2: N=     1, INCX=   1, IV= 9, IW= 8, test=            NaN                                                               
     DZNRM2: N=     1, INCX=   1, IV= 9, IW= 9, test=            NaN                                                               
     DZNRM2: N=     1, INCX=   1, IV= 9, IW=10, test=            NaN                                                               
                                           FAIL                                                                                    
     DZNRM2: N=     2, INCX=  -2, IV= 1, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 2, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 3, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 4, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 5, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 6, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 7, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 8, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 9, IW= 1, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 9, IW= 2, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 9, IW= 3, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 9, IW= 4, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 9, IW= 5, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 9, IW= 6, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 9, IW= 7, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 9, IW= 8, test=            NaN                                                               
     DZNRM2: N=     2, INCX=  -2, IV= 9, IW= 9, test=            NaN                                                               
                                           FAIL                                                                                    
     DZNRM2: N=     2, INCX=   1, IV= 1, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=   1, IV= 2, IW= 9, test=            NaN                                                               
     DZNRM2: N=     2, INCX=   1, IV= 3, IW= 9, test=            NaN          
    
    [...truncated...]
    

    Update: cblas1.f fails just like zcblas1.f.

  6. angsch commented on Dec 21, 2023

    @angsch
    Collaborator

    I will have a look at this on the weekend.

  7. added a commit that references this issue on Dec 21, 2023
    d371e22
  8. added a commit that references this issue on Jun 19, 2024
    e21097d
  9. svillemot commented on Jun 21, 2024

    @svillemot
    Contributor

    @cdluminate Do you confirm that this issue is indeed fixed by #964? My understanding was that this PR was not enough.

  10. cdluminate commented on Jan 14, 2025

    @cdluminate
    ContributorAuthor

    @cdluminate Do you confirm that this issue is indeed fixed by #964? My understanding was that this PR was not enough.

    For the record. This PR is not enough to fix all issues. With Debian build flags, DZNRM2 is still showing similar test error with NaN, with the 3.12.1 release.

  11. added a commit that references this issue on Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions