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

Bug with valgrind (rounding mode?) #113

Open
SimonRohou opened this issue Jun 18, 2024 · 1 comment
Open

Bug with valgrind (rounding mode?) #113

SimonRohou opened this issue Jun 18, 2024 · 1 comment
Labels

Comments

@SimonRohou
Copy link
Member

The debugger creates a bug...
The following code:

  Interval x(-3,-0.0599999427795410086861060960927716223523);
  Interval x_save(x);
  Interval m = -2.15;
  Interval p = x-m;
  x &= p+m;
  cout << setprecision(40) << x_save << endl;
  cout << setprecision(40) << x << endl;
  cout << "is_strict_subset: " << x.is_strict_subset(x_save) << endl;

provides, without valgrind:

[-3, -0.059999942779541]
[-3, -0.059999942779541]
is_strict_subset: 0

and with valgrind:

==62032== Memcheck, a memory error detector
==62032== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==62032== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==62032== Command: ./codac_example
==62032== 
[-3, -0.059999942779541]
[-3, -0.05999994277954101]
is_strict_subset: 1
==62032== 
==62032== HEAP SUMMARY:
==62032==     in use at exit: 0 bytes in 0 blocks
==62032==   total heap usage: 4 allocs, 4 frees, 74,784 bytes allocated
==62032== 
==62032== All heap blocks were freed -- no leaks are possible
==62032== 
==62032== For lists of detected and suppressed errors, rerun with: -s
==62032== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Using valgrind, the interval x is contracted after the operation, that should not have any effect.

The bug appears using either GAOL or Filib.
This is probably due to some rouding modes operated by valgrind.

@SimonRohou SimonRohou added the bug label Jun 18, 2024
@paulfloyd
Copy link

Quite likely a Valgrind limitation. There are numerous issues with floating point in Valgrind (no Avx512 no x87 no FPE and there are rounding mode issues on some platforms).

Could you look at bugs.kde.org and see if any existing bugs correspond? And if not open a new one?

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

No branches or pull requests

2 participants