SIGFPE encountered when hypot_impl::run is called with two zero arguments.
Submitted by David Robinson
Assigned to Nobody
Link to original bugzilla bug (#1521)
Version: 3.3 (current stable)
Operating system: Linux
Description
Summary:
SIGFPE encountered in hypot_impl::run
with two zero arguments.
Overview:
An arithmetic error occurs in Eigen's hypot_impl::run
, during the use of Spectra to solve an eigenvalue problem. This is caused by a call to hypot_impl::run
with two zero arguments .
Steps to Reproduce:
The bug is reproduceable when hypot_impl::run
is called with two zero values.
Obviously the bug can be avoided by disabling FE_INVALID but this is an unattractive option in a large simulation.
Example Code:
#include <Eigen/Core>
#include <fenv.h>
int main()
{
feenableexcept(FE_INVALID);
double a=0,b=0;
using namespace Eigen::internal;
double c = hypot_impl<double>::run(a,b);
}
Results:
The program throws a SIGFPE, crashing. If the FE_INVALID is disabled the exception is avoided and the expected result is obtained.
Edited by Eigen Bugzilla