bugGNU Octave - Bugs: bug #47214, isnan and isinf problems with...

 
 

bug #47214: isnan and isinf problems with C++11 and gcc 4

Submitter:  None
Submitted:  Sun 21 Feb 2016 05:12:56 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Wont Fix Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 03 Sep 2017 08:19:18 PM UTC, comment #8: 

Ack, I did the same thing again.

This bug report was primarily about tests in libinterp/corefcn/data.cc, libinterp/corefcn/str2double.cc, and scripts/general/num2str.m failing due to some differences with Inf and NaN values.

With gcc 4.8 I do not get any of the test failures mentioned in the original post relating to those files. I think these might have been due to system libraries or a gcc version that did not fully support C++11. At this point Octave should be built with gcc 4.8 or later.

Mike Miller <mtmiller>
Group Member
Sun 03 Sep 2017 08:09:46 PM UTC, comment #7: 

I am still building Octave with gcc 4.8 on Ubuntu 14.04, and the two tests mentioned in this bug report do fail.

I think the test failures are clear enough and point to bug #47775, so I don't think there's any reason to keep this open. It's a won't fix, system libraries have already fixed this, older systems will be updated eventually and this will be resolved.

This is the output with a gcc 4.8 build from a couple days ago:


>> test libinterp/corefcn/sparse-xpow.cc-tst
***** assert <47775> (sparse (2i) .^ [3, 4], sparse ([-0-8i, 16]))
!!!!! known bug: http://octave.org/testfailure/?47775
ASSERT errors for:  assert (sparse (2i) .^ [3, 4],sparse ([-0 - 8i, 16]))

  Location  |  Observed  |  Expected  |  Reason
    (1)      -1.46958e-15-8i     0-8i       Abs err 2.3054e-15 exceeds tol 0
    (2)      16-3.91887e-15i    16+0i       Abs err 4.3027e-15 exceeds tol 0
PASSES 1 out of 2 tests (1 known bug)
>> test realpow
***** assert <47775> (realpow (1i,2), -1)
!!!!! known bug: http://octave.org/testfailure/?47775
realpow: produced complex result
PASSES 7 out of 8 tests (1 known bug)


I think it's pretty clear that this is an accuracy issue and the link to the relevant bug report is provided.

Mike Miller <mtmiller>
Group Member
Sun 03 Sep 2017 01:24:24 AM UTC, comment #6: 

Is this relevant anymore?  The development branch has shifted base functions like isnan and isinf entirely to the C++ std lib and we haven't seen complaints, but most people are now running gcc > 5.

Rik <rik5>
Group administrator
Sun 01 May 2016 03:01:53 PM UTC, comment #5: 

Wrong, sorry, this was mainly about isnan and isinf, reopening.

Mike Miller <mtmiller>
Group Member
Sun 01 May 2016 02:59:54 PM UTC, comment #4: 

Might as well close this as a duplicate of bug #47775 since there is more discussion there now.

Mike Miller <mtmiller>
Group Member
Thu 14 Apr 2016 12:45:58 PM UTC, comment #3: 

Run into the sparse_xpow and realpow failure too for current development versions.

The sparse-xpow and realpow tests do pass in 4.0.1

This is on RHEL: /etc/redhat-release say this:
Red Hat Enterprise Linux Server release 6.7 (Santiago)

gcc 4.7.3

Anonymous
Sun 21 Feb 2016 10:58:07 PM UTC, comment #2: 

Yes bug #47212, bug #47213 and this are all on gcc 4.6.3 on Ubuntu 12.04 LTS. I do not know if they have the same cause. Building new gcc on the present computer is impractical but upgrading to Ubuntu 16.04 will happen this summer. If nobody else reports this problem for a few days (old versions of RHEL or Debian are common on compute servers) this bug can be downgraded to Works For Me.

Anonymous
Sun 21 Feb 2016 05:41:01 PM UTC, comment #1: 

Thanks for the report. I do not see these test failures in my build. Did you also report bug #47212? Should we consider these bugs related?

Mike Miller <mtmiller>
Group Member
Sun 21 Feb 2016 05:12:56 PM UTC, original submission:  

The builtin isnan and isinf functions in C++11 cause "make check" to fail in several places with similar errors:


>>>>> processing build/libinterp/corefcn/data.cc-tst
***** assert (log2 (complex (0,Inf)), Inf + log2 (i))
!!!!! test failed
ASSERT errors for:  assert (log2 (complex (0, Inf)),Inf + log2 (i))

  Location  |  Observed  |  Expected  |  Reason
     ()        Inf+NaNi      Inf+2i      'NaN' mismatch
shared variables
  scalar structure containing the fields:

    xs =

Compressed Column Sparse (rows = 1, cols = 4, nnz = 3 [75%])

  (1, 2) ->  1
  (1, 3) ->  2
  (1, 4) ->  3

>>>>> processing build/libinterp/corefcn/str2double.cc-tst
***** assert (str2double ("Inf*i"), complex (0, Inf))
!!!!! test failed
ASSERT errors for:  assert (str2double ("Inf*i"),complex (0, Inf))

  Location  |  Observed  |  Expected  |  Reason
     ()         0+Infi      NaN+Infi     'NaN' mismatch
***** assert (str2double ("iNF*i"), complex (0, Inf))
!!!!! test failed
ASSERT errors for:  assert (str2double ("iNF*i"),complex (0, Inf))

  Location  |  Observed  |  Expected  |  Reason
     ()         0+Infi      NaN+Infi     'NaN' mismatch
***** assert (str2double ("Inf - Inf*i"), complex (Inf, -Inf))
!!!!! test failed
ASSERT errors for:  assert (str2double ("Inf - Inf*i"),complex (Inf, -Inf))

  Location  |  Observed  |  Expected  |  Reason
     ()        Inf-Infi     NaN-Infi     'NaN' mismatch
***** assert (str2double ("-i*NaN - Inf"), complex (-Inf, -NaN))
!!!!! test failed
ASSERT errors for:  assert (str2double ("-i*NaN - Inf"),complex (-Inf, -NaN))

  Location  |  Observed  |  Expected  |  Reason
     ()       -Inf+NaNi     NaN+NaNi     'NaN' mismatch
>>>>> processing octave/scripts/general/num2str.m
***** assert (num2str ([complex(Inf,0), complex(0,-Inf)]), "Inf+0i   0-Infi")
!!!!! test failed
ASSERT errors for:  assert (num2str ([complex(Inf, 0), complex(0, -Inf)]),"Inf+0i   0-Infi")

  Location  |  Observed  |  Expected  |  Reason
     []      Inf+0i NaN-Infi Inf+0i   0-Infi   Strings don't match
***** assert (num2str (complex(1,Inf)), "1+Infi")
!!!!! test failed
ASSERT errors for:  assert (num2str (complex (1, Inf)),"1+Infi")

  Location  |  Observed  |  Expected  |  Reason
     []        NaN+Infi      1+Infi      Strings don't match
***** assert (num2str (complex (1, NaN)), "1+NaNi")
!!!!! test failed
ASSERT errors for:  assert (num2str (complex (1, NaN)),"1+NaNi")

  Location  |  Observed  |  Expected  |  Reason
     []        NaN+NaNi      1+NaNi      Strings don't match
***** assert (num2str (complex (1, NA)), "1+NAi")
!!!!! test failed
ASSERT errors for:  assert (num2str (complex (1, NA)),"1+NAi")

  Location  |  Observed  |  Expected  |  Reason
     []         NA+NAi       1+NAi       Strings don't match


Changing to C++11 also gives two new failures in rounding small numbers:


>>>>> processing build/libinterp/corefcn/sparse-xpow.cc-tst
***** assert (sparse (2i) .^ [3, 4], sparse ([-0-8i, 16]))
!!!!! test failed
ASSERT errors for:  assert (sparse (2i) .^ [3, 4],sparse ([-0 - 8i, 16]))

  Location  |  Observed  |  Expected  |  Reason
    (1)      -1.46953e-15-8i     0-8i       Abs err 2.3054e-15 exceeds tol 0
    (2)      16-3.91874e-15i    16+0i       Abs err 4.3026e-15 exceeds tol 0
>>>>> processing octave/scripts/specfun/realpow.m
***** assert (realpow (1i,2), -1)
!!!!! test failed
realpow: produced complex result


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-12 mtmiller Carbon-CopyRemoved 80942 -
    2017-09-03 mtmiller StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2016-05-01 mtmiller Summaryisnan and isinf problems with C++11 isnan and isinf problems with C++11 and gcc 4
    2016-05-01 mtmiller StatusDuplicate Confirmed
        Open/ClosedClosed Open
    2016-05-01 mtmiller Dependencies- Depends on bugs #47775
    2016-05-01 mtmiller StatusNone Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code