xlapy2 not propagating nans

Post here if you want to report a bug to the LAPACK team

xlapy2 not propagating nans

Postby andreasnoackjensen » Thu May 11, 2017 1:46 pm


Code: Select all
program test_dlapy2
    implicit none

    double precision :: myzero, dlapy2, x, y

    write(*,*) 'write 0.0 and hit enter'
    read(*,*) myzero

    x = 0.0d0/myzero

    write(*,*) 'x is ', x

    y = dlapy2(1.0d0, x)

    write(*,*) 'y is ', y

end program test_dlapy2

Code: Select all
 write 0.0 and hit enter
 x is                        NaN
 y is    1.4142135623730951

This has severe implications because it can cause xlarfg to hang during scaling if alpha=0 and x has a nan. I.e. all code that uses elementary reflectors is vulnerable to this as e.g. reported for the SVD in https://github.com/JuliaLang/julia/issues/21757.

It appears that Intel has fixed this in MKL without upstreaming their fix.
Posts: 9
Joined: Wed Feb 20, 2013 3:40 am

Re: xlapy2 not propagating nans

Postby Julien Langou » Thu May 18, 2017 9:04 am

Julien Langou
Posts: 828
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Return to Bug report

Who is online

Users browsing this forum: No registered users and 1 guest