You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the investigation of the CI valgrind failures of PR #736, the concern raised in my mind if we correctly instrumented atomic-store-with-release and atomic-load-with-acquire operations.
Current instrumentation in UMF
In utils_concurrency.h there are two macros:
#defineutils_atomic_load_acquire(object, dest) \
do { \
utils_annotate_acquire((void *)object); \
__atomic_load(object, dest, memory_order_acquire); \
} while (0)
#defineutils_atomic_store_release(object, desired) \
do { \
__atomic_store_n(object, desired, memory_order_release); \
utils_annotate_release((void *)object); \
} while (0)
The utils_annotate_acquire and utils_annotate_release functions defined in the utils_sanitizers.h as follows:
It looks like the utils_annotate_* calls are actually placed incorrectly in those wrappers. I believe utils_annotate_acquire should be placed AFTER load and release BEFORE the store.
During the investigation of the CI valgrind failures of PR #736, the concern raised in my mind if we correctly instrumented atomic-store-with-release and atomic-load-with-acquire operations.
Current instrumentation in UMF
In
utils_concurrency.h
there are two macros:The
utils_annotate_acquire
andutils_annotate_release
functions defined in theutils_sanitizers.h
as follows:My understanding of Annotation Placement:
ANNOTATE_HAPPENS_BEFORE
andANNOTATE_HAPPENS_AFTER
):ANNOTATE_HAPPENS_BEFORE
should be placed immediately before the actual atomic-store-with-release.ANNOTATE_HAPPENS_AFTER
should be placed immediately after the actual atomic_load with acquire semantics.__tsan_release
and__tsan_acquire
):__tsan_release
should be placed immediately after the actual atomic_store with release semantics.__tsan_acquire
should be placed immediately after the actual atomic_load with acquire semantics.The text was updated successfully, but these errors were encountered: