Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaN mismatch #264

Open
dasergatskov opened this issue Feb 15, 2023 · 10 comments
Open

NaN mismatch #264

dasergatskov opened this issue Feb 15, 2023 · 10 comments

Comments

@dasergatskov
Copy link

There are multiple failures in data.cc-tst due to NaN/Inf mismatch.


>>>>> processing /app/share/octave/7.2.0/etc/tests/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
     ()         NaN+2i       Inf+2i      'NaN' mismatch
shared variables     xs =

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

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

***** test
 [f, e] = log2 (complex (zeros (3, 2), [0,-1; 2,-4; Inf,-Inf]));
 assert (f, complex (zeros (3, 2), [0,-0.5; 0.5,-0.5; Inf,-Inf]));
 assert (e(1:2,:), [0,1; 2,3]);
!!!!! test failed
ASSERT errors for:  assert (f,complex (zeros (3, 2), [0, -0.5; 0.5, -0.5; Inf, -Inf]))

  Location  |  Observed  |  Expected  |  Reason
   (3,1)       NaN+NaNi      0+Infi      'NaN' mismatch
   (3,2)       NaN+NaNi      0-Infi      'NaN' mismatch
shared variables     xs =

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

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

etc... Full log is attached.
data_fntests.log.gz

@dasergatskov
Copy link
Author

dasergatskov commented Mar 2, 2023

I would guess this is a libc problem.
Test code:

cat mylog.cc 
#include <iostream>
#include <cmath>
#include <complex>
#include <limits>

int main ()
{
	double z = std::numeric_limits<double>::infinity();
	std::complex<double> x (0, z);
	std::complex<double> y (0, 0);

	y = std::log(x);
	std::cout << "x = " << x << " log(x) = " << y << std::endl;

	return 0;
}

On native (CentOS 9 gcc version 11.3.1 20221121 (Red Hat 11.3.1-4))

$ g++ mylog.cc 
$ ./a.out 
x = (0,inf) log(x) = (inf,1.5708)
$ ldd ./a.out 
	linux-vdso.so.1 (0x00007ffcb63cf000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007faadb400000)
	libm.so.6 => /lib64/libm.so.6 (0x00007faadb325000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007faadb63b000)
	libc.so.6 => /lib64/libc.so.6 (0x00007faadb000000)
	/lib64/ld-linux-x86-64.so.2 (0x00007faadb677000)

In flatpak:

sh-5.1$ g++ mylog.cc
sh-5.1$ ./a.out
x = (0,inf) log(x) = (-nan,1.5708)
sh-5.1$ ldd ./a.out
        linux-vdso.so.1 (0x00007fff5b389000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff368a00000)
        libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007ff3688b7000)
        libgcc_s.so.1 => /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff368d21000)
        libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007ff3686d7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff368d58000)

@dasergatskov
Copy link
Author

dasergatskov commented Mar 2, 2023

Octave would not build on qt6. Are there updates for 5.15?

I see that 5.15-22.08 is available

@dasergatskov
Copy link
Author

I see the same. I guess you can push it as an update anyway, at least it will be using the latest runtime.

@dasergatskov
Copy link
Author

I did on KDE
https://invent.kde.org/packaging/flatpak-kde-runtime/-/issues/40#note_634527
and they kick me to freedesktop:
https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1558
Perhaps you could add comments about reproducibility and such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@dasergatskov and others