From Sergio (for the technical interested):

Just as a data point, the problem is that in a code such as this one:

  static force_inline void
  memmove_movnt_avx512f(char *dest, const char *src, size_t len, flush_fn flush,
                barrier_fn barrier)
  {
        if ((uintptr_t)dest - (uintptr_t)src >= len)
                memmove_movnt_avx512f_fw(dest, src, len, flush);
        else
                memmove_movnt_avx512f_bw(dest, src, len, flush);

        barrier();

        VALGRIND_DO_FLUSH(dest, len);
  }

you can see that the function received a function pointer called
"barrier", which supposedly is that should get called when "barrier();"
is invoked, but due to (a) "barrier" being also a macro (defined as
'#define barrier() asm volatile("" ::: "memory")'), and (b) the
GCC preprocessor running before the actual compilation phase, we end up
with the code executing the "asm volatile" operation instead of calling
the function pointer provided.

You can reproduce this locally with:

--8<---------------cut here---------------start------------->8---
#include <stdio.h>

#define foo() printf ("Called the macro.\n");

static void
myfoo ()
{
  printf ("Called the myfoo function.\n");
}

static void
callfoo (void (*foo) ())
{
  foo ();
}

int
main ()
{
  callfoo (myfoo);
}

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1945694

Title:
  Sync 1.11.1-2 for impish

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pmdk/+bug/1945694/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to