problems with __sync_add_and_fetch in BPF code


Pablo Alvarez
 

Hi all,

A while ago, I filed a bug with LLVM about __sync_add_and_fetch as compiled into eBPF code.

https://bugs.llvm.org/show_bug.cgi?id=36573

Both it and __sync_fetch_and_add fail to return the correct value of the item being incremented, returning instead the increment (or double the increment). This means I end up with race conditions. Has anyone else run into this, and do you have a workaround for it?

The bug report, sadly, has not been touched by anyone else.

Best

Pablo Alvarez

Join iovisor-dev@lists.iovisor.org to automatically receive all group messages.