Skip to content

Bug with valgrind (rounding mode?) #113

Description

@SimonRohou

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions