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
ofiwg/libfabric#10528
*Describe the bug*
When using the shm provider in a simple setup with one client thread and one server thread within a single process, a data race is detected when compiled with clang-19 and run with ThreadSanitizer. The client performs one fi_send, and the server performsone fi_recv, with a message size of 1000 bytes. The data race appears during the fi_cq_read operation on the server side and the fi_send operation on the client side.
*To Reproduce*
1. Set up a process with two threads: one acting as a client and the other as a server.
2. Use the shm provider with libfabric version 1.22.0.
3. Compile the program with clang-19 and enable ThreadSanitizer (-fsanitize=thread).
4. In the client thread, perform an fi_send operation with a message of 1000 bytes.
5. In the server thread, perform an fi_recv operation to receive the message.
Observe that ThreadSanitizer reports a data race during execution
*Expected behavior*
No data race should be detected when performing simple send and receive operations between a client and server thread within the same process using the shm provider.
*Output*
WARNING: ThreadSanitizer: data race (pid=543759)
Server thread:
Read of size 8 at 0x7febb28f3000 by thread T4 (mutexes: write M0, write M1, write M2):
#0 strncmp /home/piotrchmiel/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:487:3 (test+0x9d66d) #1 smr_name_compare /home/piotrchmiel/test/third_party/libfabric/prov/shm/src/smr_util.c:351:9 (libfabric.so.1+0xe5a33)
during cq_read
Client thread:
Previous write of size 8 at 0x7febb28f3000 by main thread:
#0 memcpy /home/piotrchmiel/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc:115:5 (test+0x8e9de) #1 smr_send_name /home/piotrchmiel/test/third_party/libfabric/prov/shm/src/smr_ep.c:206:2 (libfabric.so.1+0xdcfcd)
during fi_send
*Environment:*
OS (if not Linux), provider, endpoint type, etc.
Operating System: Ubuntu 22.04
Compiler: clang-19 with ThreadSanitizer
libfabric Version: 1.22.0
Provider: shm
Endpoint Type: FI_EP_RDM
*Additional context*
The data race occurs specifically on memory access in smr_name_compare (during fi_cq_read on the server side) and in smr_send_name (during fi_send on the client side)
The text was updated successfully, but these errors were encountered:
ofiwg/libfabric#10528
*Describe the bug*
When using the shm provider in a simple setup with one client thread and one server thread within a single process, a data race is detected when compiled with clang-19 and run with ThreadSanitizer. The client performs one fi_send, and the server performsone fi_recv, with a message size of 1000 bytes. The data race appears during the fi_cq_read operation on the server side and the fi_send operation on the client side.
*To Reproduce*
1. Set up a process with two threads: one acting as a client and the other as a server.
2. Use the shm provider with libfabric version 1.22.0.
3. Compile the program with clang-19 and enable ThreadSanitizer (-fsanitize=thread).
4. In the client thread, perform an fi_send operation with a message of 1000 bytes.
5. In the server thread, perform an fi_recv operation to receive the message.
Observe that ThreadSanitizer reports a data race during execution
*Expected behavior*
No data race should be detected when performing simple send and receive operations between a client and server thread within the same process using the shm provider.
*Output*
WARNING: ThreadSanitizer: data race (pid=543759)
Server thread:
Read of size 8 at 0x7febb28f3000 by thread T4 (mutexes: write M0, write M1, write M2):
#0 strncmp /home/piotrchmiel/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:487:3 (test+0x9d66d)
#1 smr_name_compare /home/piotrchmiel/test/third_party/libfabric/prov/shm/src/smr_util.c:351:9 (libfabric.so.1+0xe5a33)
Client thread:
Previous write of size 8 at 0x7febb28f3000 by main thread:
#0 memcpy /home/piotrchmiel/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc:115:5 (test+0x8e9de)
#1 smr_send_name /home/piotrchmiel/test/third_party/libfabric/prov/shm/src/smr_ep.c:206:2 (libfabric.so.1+0xdcfcd)
*Environment:*
*Additional context*
The data race occurs specifically on memory access in smr_name_compare (during fi_cq_read on the server side) and in smr_send_name (during fi_send on the client side)
The text was updated successfully, but these errors were encountered: