Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False-positive data races need to be masked #724

Closed
dongahn opened this issue Jul 8, 2016 · 1 comment
Closed

False-positive data races need to be masked #724

dongahn opened this issue Jul 8, 2016 · 1 comment

Comments

@dongahn
Copy link
Member

dongahn commented Jul 8, 2016

Creating a new issue for these likely false positive data races reported in #694:

I see many data race reports at czmq routines called by service callback routines. My initial guess is these are false positives: in particular if czmq/zmq uses its own way to synchronize memory accesses across threads... One representative report looks like the following.

Essentially, the report says: strncpy called by the main thread and memcpy in czmq by Pthread #4 access the same memory location without a synchronization known to TSan (e.g., pthread mutex).

We need to look into this class of reports to see if they are indeed false positives. If so, it is likely czmq has its own thread synchronization that TSan doesn't know about. We need to annotate those synchronization to make TSan more useful for us.

==================
WARNING: ThreadSanitizer: data race (pid=149830)
  Read of size 1 at 0x7d1c0000a400 by main thread:
    #0 strncpy /collab/usr/global/tools/clang/chaos_5_x86_64_ib/clang-omp-3.5.0/src/llvm-3.5.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:665 (lt-flux-broker+0x000000048efa)
    #1 stdlog_decode /g/g0/dahn/workspace/Flux/flux-core/src/common/libutil/stdlog.c:106:5 (lt-flux-broker+0x0000000bb05e)
    #2 logbuf_append /g/g0/dahn/workspace/Flux/flux-core/src/broker/log.c:493:9 (lt-flux-broker+0x0000000b0db0)
    #3 cmb_log_cb /g/g0/dahn/workspace/Flux/flux-core/src/broker/broker.c:2172:9 (lt-flux-broker+0x0000000a4230)
    #4 svc_sendmsg /g/g0/dahn/workspace/Flux/flux-core/src/broker/service.c:141:10 (lt-flux-broker+0x0000000ad62a)
    #5 broker_request_sendmsg /g/g0/dahn/workspace/Flux/flux-core/src/broker/broker.c:2837:14 (lt-flux-broker+0x0000000a29ee)
    #6 module_cb /g/g0/dahn/workspace/Flux/flux-core/src/broker/broker.c:2686:18 (lt-flux-broker+0x0000000a6512)
    #7 module_cb /g/g0/dahn/workspace/Flux/flux-core/src/broker/module.c:358:9 (lt-flux-broker+0x0000000a8e15)
    #8 zmq_cb /g/g0/dahn/workspace/Flux/flux-core/src/common/libflux/reactor.c:395:9 (libflux-core.so.0+0x00000001152b)
    #9 check_cb /g/g0/dahn/workspace/Flux/flux-core/src/common/libutil/ev_zmq.c:77:9 (libflux-core.so.0+0x00000003e40a)
    #10 ev_invoke_pending /g/g0/dahn/workspace/Flux/flux-core/src/common/libev/ev.c:3088:11 (libflux-core.so.0+0x0000000509c7)
    #11 ev_run /g/g0/dahn/workspace/Flux/flux-core/src/common/libev/ev.c:3488:7 (libflux-core.so.0+0x0000000520f6)
    #12 flux_reactor_run /g/g0/dahn/workspace/Flux/flux-core/src/common/libflux/reactor.c:134:13 (libflux-core.so.0+0x0000000108d3)
    #13 main /g/g0/dahn/workspace/Flux/flux-core/src/broker/broker.c:672:9 (lt-flux-broker+0x0000000a1065)

  Previous write of size 1 at 0x7d1c0000a400 by thread T4:
    #0 memcpy /collab/usr/global/tools/clang/chaos_5_x86_64_ib/clang-omp-3.5.0/src/llvm-3.5.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:608 (lt-flux-broker+0x00000003f846)
    #1 <null> <null>:0 (libczmq.so.3+0x000000024ad5)
    #2 op_send /g/g0/dahn/workspace/Flux/flux-core/src/connectors/shmem/shmem.c:105:25 (shmem.so+0x000000008d11)
    #3 flux_send /g/g0/dahn/workspace/Flux/flux-core/src/common/libflux/handle.c:445:9 (libflux-core.so.0+0x00000000f630)
    #4 client_read_cb /g/g0/dahn/workspace/Flux/flux-core/src/modules/connector-local/local.c:559:21 (connector-local.so+0x00000000a5c5)
    #5 fd_cb /g/g0/dahn/workspace/Flux/flux-core/src/common/libflux/reactor.c:338:9 (libflux-core.so.0+0x0000000111c5)
    #6 ev_invoke_pending /g/g0/dahn/workspace/Flux/flux-core/src/common/libev/ev.c:3088:11 (libflux-core.so.0+0x0000000509c7)
    #7 ev_run /g/g0/dahn/workspace/Flux/flux-core/src/common/libev/ev.c:3488:7 (libflux-core.so.0+0x0000000520f6)
    #8 flux_reactor_run /g/g0/dahn/workspace/Flux/flux-core/src/common/libflux/reactor.c:134:13 (libflux-core.so.0+0x0000000108d3)
    #9 mod_main /g/g0/dahn/workspace/Flux/flux-core/src/modules/connector-local/local.c:773:9 (connector-local.so+0x00000000952a)
    #10 module_thread /g/g0/dahn/workspace/Flux/flux-core/src/broker/module.c:145:9 (lt-flux-broker+0x0000000a7ec7)

  Location is heap block of size 100 at 0x7d1c0000a3a0 allocated by thread T4:
    #0 malloc /collab/usr/global/tools/clang/chaos_5_x86_64_ib/clang-omp-3.5.0/src/llvm-3.5.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:461 (lt-flux-broker+0x0000000475ef)
    #1 <null> <null>:0 (libzmq.so.5+0x000000022f58)
    #2 op_send /g/g0/dahn/workspace/Flux/flux-core/src/connectors/shmem/shmem.c:105:25 (shmem.so+0x000000008d11)
    #3 flux_send /g/g0/dahn/workspace/Flux/flux-core/src/common/libflux/handle.c:445:9 (libflux-core.so.0+0x00000000f630)
    #4 client_read_cb /g/g0/dahn/workspace/Flux/flux-core/src/modules/connector-local/local.c:559:21 (connector-local.so+0x00000000a5c5)
    #5 fd_cb /g/g0/dahn/workspace/Flux/flux-core/src/common/libflux/reactor.c:338:9 (libflux-core.so.0+0x0000000111c5)
    #6 ev_invoke_pending /g/g0/dahn/workspace/Flux/flux-core/src/common/libev/ev.c:3088:11 (libflux-core.so.0+0x0000000509c7)
    #7 ev_run /g/g0/dahn/workspace/Flux/flux-core/src/common/libev/ev.c:3488:7 (libflux-core.so.0+0x0000000520f6)
    #8 flux_reactor_run /g/g0/dahn/workspace/Flux/flux-core/src/common/libflux/reactor.c:134:13 (libflux-core.so.0+0x0000000108d3)
    #9 mod_main /g/g0/dahn/workspace/Flux/flux-core/src/modules/connector-local/local.c:773:9 (connector-local.so+0x00000000952a)
    #10 module_thread /g/g0/dahn/workspace/Flux/flux-core/src/broker/module.c:145:9 (lt-flux-broker+0x0000000a7ec7)

  Thread T4 (tid=150139, running) created by main thread at:
    #0 pthread_create /collab/usr/global/tools/clang/chaos_5_x86_64_ib/clang-omp-3.5.0/src/llvm-3.5.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:848 (lt-flux-broker+0x000000051233)
    #1 module_start /g/g0/dahn/workspace/Flux/flux-core/src/broker/module.c:368:19 (lt-flux-broker+0x0000000a9666)
    #2 module_start_all /g/g0/dahn/workspace/Flux/flux-core/src/broker/module.c:655 (lt-flux-broker+0x0000000a9666)
    #3 load_modules /g/g0/dahn/workspace/Flux/flux-core/src/broker/broker.c:1427:5 (lt-flux-broker+0x0000000a0ec6)
    #4 main /g/g0/dahn/workspace/Flux/flux-core/src/broker/broker.c:645 (lt-flux-broker+0x0000000a0ec6)

SUMMARY: ThreadSanitizer: data race /g/g0/dahn/workspace/Flux/flux-core/src/common/libutil/stdlog.c:106 stdlog_decode

@dongahn dongahn changed the title These Likely false-positive data race need to be masked False-positive data races need to be masked Jul 8, 2016
@garlick
Copy link
Member

garlick commented Aug 17, 2022

Now that asan is running in CI, presumably we've worked through this.

@garlick garlick closed this as completed Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants