[ https://issues.apache.org/jira/browse/PROTON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16973217#comment-16973217 ]
Jiri Daněk commented on PROTON-2133: ------------------------------------ [~astitcher] [~cliffjansen] [~kpvdr] I think that in yesterday's discussion, the power of the helgrind/tsan algorithm was too underappreciated. If anything, these usually tend to get appeased by spurious synchronization (due to e.g. printing to stdout, if there is some lock in that [1]), rather than to produce false positives due to missed barriers, or patterns when value is not specifically "guarded by" a specific lock, but accesses are protected by piggybacking on synchronization due to some other lock. It may report "harmless" races (although any race has undefined behavior), and it has bugs, e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78158, but what it reports should be mostly real, as opposed to the "lockset" algorithms, and some other static analysis which is more prone to false positives. For example, regarding the report above, {noformat} 6: WARNING: ThreadSanitizer: data race (pid=7358) 6: Write of size 4 at 0x7b7000029818 by thread T3: 6: #0 stop_polling /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:313:10 (libqpid-proton-proactor.so.1+0xd22a) 6: #1 pconnection_cleanup /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:896:3 (libqpid-proton-proactor.so.1+0xcacb) 6: #2 pconnection_done /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1044:7 (libqpid-proton-proactor.so.1+0xa670) 6: #3 pn_proactor_done /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2166:5 (libqpid-proton-proactor.so.1+0xa670) 6: #4 broker_thread /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:439:5 (broker+0x4cb4e6) 6: 6: Previous read of size 4 at 0x7b7000029818 by thread T2 (mutexes: write M2131): 6: #0 rearm /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:720:48 (libqpid-proton-proactor.so.1+0x8703) 6: #1 pconnection_rearm /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1014:5 (libqpid-proton-proactor.so.1+0xcf78) 6: #2 pconnection_done /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1051:14 (libqpid-proton-proactor.so.1+0x9e24) 6: #3 pn_proactor_done /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2166:5 (libqpid-proton-proactor.so.1+0x9e24) 6: #4 broker_thread /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:439:5 (broker+0x4cb4e6) {noformat} {noformat} static void stop_polling(epoll_extended_t *ee, int epollfd) { // TODO: check for error, return bool or just log? // TODO: is EPOLL_CTL_DEL ever needed beyond auto de-register when ee->fd is closed? if (ee->fd == -1 || !ee->polling || epollfd == -1) return; struct epoll_event ev = {0}; ev.data.ptr = ee; ev.events = 0; memory_barrier(ee); // HERE if (epoll_ctl(epollfd, EPOLL_CTL_DEL, ee->fd, &ev) == -1) EPOLL_FATAL("EPOLL_CTL_DEL", errno); ee->fd = -1; ee->polling = false; } static void rearm(pn_proactor_t *p, epoll_extended_t *ee) { struct epoll_event ev = {0}; ev.data.ptr = ee; ev.events = ee->wanted | EPOLLONESHOT; memory_barrier(ee); // HERE if (epoll_ctl(p->epollfd, EPOLL_CTL_MOD, ee->fd, &ev) == -1) EPOLL_FATAL("arming polled file descriptor", errno); } {noformat} I think what the report is about is that both threads can get to the point marked {{// HERE}}, and then there is a race on {{ee->fd}}. [1] https://mail.openjdk.java.net/pipermail/tsan-dev/2019-July/000260.html and Dmitry's response in the thread. It's for java (which synchronizes system.out.println, but the algorithm is the same there and in regular tsan. > c-fdlimit-tests with epoll is not tsan clean > -------------------------------------------- > > Key: PROTON-2133 > URL: https://issues.apache.org/jira/browse/PROTON-2133 > Project: Qpid Proton > Issue Type: Bug > Components: proton-c > Affects Versions: proton-c-0.29.0 > Reporter: Jiri Daněk > Priority: Major > > {noformat} > 6: Test timeout computed to be: 1500 > 6: E > 6: ====================================================================== > 6: ERROR: test_fd_limit_broker (__main__.FdLimitTest) > 6: Check behaviour when running out of file descriptors on accept > 6: ---------------------------------------------------------------------- > 6: Traceback (most recent call last): > 6: File "/home/jdanek/repos/qpid/qpid-proton/c/tests/fdlimit.py", line 87, > in test_fd_limit_broker > 6: self.assertIn("10 messages received", > test_subprocess.check_output(["receive", "", b.port], > universal_newlines=True)) > 6: File "/home/jdanek/repos/qpid/qpid-proton/tests/py/test_subprocess.py", > line 110, in __exit__ > 6: self.on_exit() > 6: File "/home/jdanek/repos/qpid/qpid-proton/tests/py/test_subprocess.py", > line 84, in check_kill > 6: raise TestProcessError(self, "check_kill found error output") > 6: TestProcessError: ['prlimit', '-n256', 'broker', '', '0'] pid=7358 > exit=-9: check_kill found error output > 6: ________________________________ stderr(7358) > ________________________________ > 6: ================== > 6: WARNING: ThreadSanitizer: data race (pid=7358) > 6: Write of size 4 at 0x7b7000029818 by thread T3: > 6: #0 stop_polling > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:313:10 > (libqpid-proton-proactor.so.1+0xd22a) > 6: #1 pconnection_cleanup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:896:3 > (libqpid-proton-proactor.so.1+0xcacb) > 6: #2 pconnection_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1044:7 > (libqpid-proton-proactor.so.1+0xa670) > 6: #3 pn_proactor_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2166:5 > (libqpid-proton-proactor.so.1+0xa670) > 6: #4 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:439:5 > (broker+0x4cb4e6) > 6: > 6: Previous read of size 4 at 0x7b7000029818 by thread T2 (mutexes: write > M2131): > 6: #0 rearm > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:720:48 > (libqpid-proton-proactor.so.1+0x8703) > 6: #1 pconnection_rearm > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1014:5 > (libqpid-proton-proactor.so.1+0xcf78) > 6: #2 pconnection_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1051:14 > (libqpid-proton-proactor.so.1+0x9e24) > 6: #3 pn_proactor_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2166:5 > (libqpid-proton-proactor.so.1+0x9e24) > 6: #4 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:439:5 > (broker+0x4cb4e6) > 6: > 6: Location is heap block of size 1880 at 0x7b7000029800 allocated by > thread T2: > 6: #0 calloc <null> (broker+0x45b124) > 6: #1 pn_listener_accept2 > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1795:40 > (libqpid-proton-proactor.so.1+0x7d91) > 6: #2 handle > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:306:6 > (broker+0x4cb794) > 6: #3 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:437:14 > (broker+0x4cb794) > 6: > 6: Mutex M2131 (0x7b7000029ee8) created at: > 6: #0 pthread_mutex_init <null> (broker+0x42e922) > 6: #1 pmutex_init > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:105:7 > (libqpid-proton-proactor.so.1+0x560a) > 6: #2 pconnection_setup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:853:3 > (libqpid-proton-proactor.so.1+0x560a) > 6: #3 pn_listener_accept2 > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1797:21 > (libqpid-proton-proactor.so.1+0x7dd8) > 6: #4 handle > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:306:6 > (broker+0x4cb794) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:437:14 > (broker+0x4cb794) > 6: > 6: Thread T3 (tid=7362, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: Thread T2 (tid=7361, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: SUMMARY: ThreadSanitizer: data race > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:313:10 in > stop_polling > 6: ================== > 6: ================== > 6: WARNING: ThreadSanitizer: data race (pid=7358) > 6: Write of size 8 at 0x7ba0000000e0 by thread T3: > 6: #0 close <null> (broker+0x447563) > 6: #1 pclosefd > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:805:13 > (libqpid-proton-proactor.so.1+0xcaf4) > 6: #2 pconnection_cleanup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:898:5 > (libqpid-proton-proactor.so.1+0xcaf4) > 6: #3 pconnection_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1044:7 > (libqpid-proton-proactor.so.1+0xa670) > 6: #4 pn_proactor_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2166:5 > (libqpid-proton-proactor.so.1+0xa670) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:439:5 > (broker+0x4cb4e6) > 6: > 6: Previous read of size 8 at 0x7ba0000000e0 by thread T2: > 6: [failed to restore the stack] > 6: > 6: Location is file descriptor 14 created by thread T2 at: > 6: #0 accept <null> (broker+0x435375) > 6: #1 listener_accept_lh > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1682:27 > (libqpid-proton-proactor.so.1+0xdd1c) > 6: #2 listener_process > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1718:9 > (libqpid-proton-proactor.so.1+0xdd1c) > 6: #3 proactor_do_epoll > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2146:17 > (libqpid-proton-proactor.so.1+0x99ad) > 6: #4 pn_proactor_wait > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2156:10 > (libqpid-proton-proactor.so.1+0x95fe) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:434:32 > (broker+0x4cb503) > 6: > 6: Thread T3 (tid=7362, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: Thread T2 (tid=7361, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: SUMMARY: ThreadSanitizer: data race > (/home/jdanek/repos/qpid/qpid-proton/cmake-build-debug-gcc/c/examples/broker+0x447563) > in close > 6: ================== > 6: ================== > 6: WARNING: ThreadSanitizer: data race (pid=7358) > 6: Write of size 4 at 0x7b7000017818 by main thread: > 6: #0 stop_polling > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:313:10 > (libqpid-proton-proactor.so.1+0xd22a) > 6: #1 pconnection_cleanup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:896:3 > (libqpid-proton-proactor.so.1+0xcacb) > 6: #2 pconnection_process > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c > (libqpid-proton-proactor.so.1+0xca31) > 6: #3 proactor_do_epoll > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c > (libqpid-proton-proactor.so.1+0x9a17) > 6: #4 pn_proactor_wait > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2156:10 > (libqpid-proton-proactor.so.1+0x95fe) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:434:32 > (broker+0x4cb503) > 6: #6 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:473:3 > (broker+0x4cb3d3) > 6: > 6: Previous read of size 4 at 0x7b7000017818 by thread T2 (mutexes: write > M2241): > 6: #0 rearm > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:720:48 > (libqpid-proton-proactor.so.1+0x8703) > 6: #1 pconnection_rearm > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1014:5 > (libqpid-proton-proactor.so.1+0xcf78) > 6: #2 pconnection_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1051:14 > (libqpid-proton-proactor.so.1+0x9e24) > 6: #3 pn_proactor_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2166:5 > (libqpid-proton-proactor.so.1+0x9e24) > 6: #4 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:439:5 > (broker+0x4cb4e6) > 6: > 6: Location is heap block of size 1880 at 0x7b7000017800 allocated by > thread T2: > 6: #0 calloc <null> (broker+0x45b124) > 6: #1 pn_listener_accept2 > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1795:40 > (libqpid-proton-proactor.so.1+0x7d91) > 6: #2 handle > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:306:6 > (broker+0x4cb794) > 6: #3 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:437:14 > (broker+0x4cb794) > 6: > 6: Mutex M2241 (0x7b7000017ee8) created at: > 6: #0 pthread_mutex_init <null> (broker+0x42e922) > 6: #1 pmutex_init > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:105:7 > (libqpid-proton-proactor.so.1+0x560a) > 6: #2 pconnection_setup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:853:3 > (libqpid-proton-proactor.so.1+0x560a) > 6: #3 pn_listener_accept2 > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1797:21 > (libqpid-proton-proactor.so.1+0x7dd8) > 6: #4 handle > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:306:6 > (broker+0x4cb794) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:437:14 > (broker+0x4cb794) > 6: > 6: Thread T2 (tid=7361, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: SUMMARY: ThreadSanitizer: data race > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:313:10 in > stop_polling > 6: ================== > 6: ================== > 6: WARNING: ThreadSanitizer: data race (pid=7358) > 6: Write of size 4 at 0x7b7000013018 by thread T1: > 6: #0 stop_polling > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:313:10 > (libqpid-proton-proactor.so.1+0xd22a) > 6: #1 pconnection_cleanup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:896:3 > (libqpid-proton-proactor.so.1+0xcacb) > 6: #2 pconnection_process > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c > (libqpid-proton-proactor.so.1+0xca31) > 6: #3 proactor_do_epoll > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c > (libqpid-proton-proactor.so.1+0x9a17) > 6: #4 pn_proactor_wait > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2156:10 > (libqpid-proton-proactor.so.1+0x95fe) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:434:32 > (broker+0x4cb503) > 6: > 6: Previous read of size 4 at 0x7b7000013018 by thread T2 (mutexes: write > M2164): > 6: #0 rearm > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:720:48 > (libqpid-proton-proactor.so.1+0x8703) > 6: #1 pconnection_rearm > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1014:5 > (libqpid-proton-proactor.so.1+0xcf78) > 6: #2 pconnection_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1051:14 > (libqpid-proton-proactor.so.1+0x9e24) > 6: #3 pn_proactor_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2166:5 > (libqpid-proton-proactor.so.1+0x9e24) > 6: #4 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:439:5 > (broker+0x4cb4e6) > 6: > 6: Location is heap block of size 1880 at 0x7b7000013000 allocated by > thread T1: > 6: #0 calloc <null> (broker+0x45b124) > 6: #1 pn_listener_accept2 > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1795:40 > (libqpid-proton-proactor.so.1+0x7d91) > 6: #2 handle > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:306:6 > (broker+0x4cb794) > 6: #3 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:437:14 > (broker+0x4cb794) > 6: > 6: Mutex M2164 (0x7b70000136e8) created at: > 6: #0 pthread_mutex_init <null> (broker+0x42e922) > 6: #1 pmutex_init > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:105:7 > (libqpid-proton-proactor.so.1+0x560a) > 6: #2 pconnection_setup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:853:3 > (libqpid-proton-proactor.so.1+0x560a) > 6: #3 pn_listener_accept2 > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1797:21 > (libqpid-proton-proactor.so.1+0x7dd8) > 6: #4 handle > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:306:6 > (broker+0x4cb794) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:437:14 > (broker+0x4cb794) > 6: > 6: Thread T1 (tid=7360, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: Thread T2 (tid=7361, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: SUMMARY: ThreadSanitizer: data race > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:313:10 in > stop_polling > 6: ================== > 6: ================== > 6: WARNING: ThreadSanitizer: data race (pid=7358) > 6: Write of size 8 at 0x7ba0000000d0 by thread T1: > 6: #0 close <null> (broker+0x447563) > 6: #1 pclosefd > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:805:13 > (libqpid-proton-proactor.so.1+0xcaf4) > 6: #2 pconnection_cleanup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:898:5 > (libqpid-proton-proactor.so.1+0xcaf4) > 6: #3 pconnection_process > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c > (libqpid-proton-proactor.so.1+0xca31) > 6: #4 proactor_do_epoll > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c > (libqpid-proton-proactor.so.1+0x9a17) > 6: #5 pn_proactor_wait > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2156:10 > (libqpid-proton-proactor.so.1+0x95fe) > 6: #6 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:434:32 > (broker+0x4cb503) > 6: > 6: Previous read of size 8 at 0x7ba0000000d0 by thread T2: > 6: [failed to restore the stack] > 6: > 6: Location is file descriptor 13 created by thread T1 at: > 6: #0 accept <null> (broker+0x435375) > 6: #1 listener_accept_lh > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1682:27 > (libqpid-proton-proactor.so.1+0xdd1c) > 6: #2 listener_process > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1718:9 > (libqpid-proton-proactor.so.1+0xdd1c) > 6: #3 proactor_do_epoll > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2146:17 > (libqpid-proton-proactor.so.1+0x99ad) > 6: #4 pn_proactor_wait > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2156:10 > (libqpid-proton-proactor.so.1+0x95fe) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:434:32 > (broker+0x4cb503) > 6: > 6: Thread T1 (tid=7360, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: Thread T2 (tid=7361, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: SUMMARY: ThreadSanitizer: data race > (/home/jdanek/repos/qpid/qpid-proton/cmake-build-debug-gcc/c/examples/broker+0x447563) > in close > 6: ================== > 6: ================== > 6: WARNING: ThreadSanitizer: data race (pid=7358) > 6: Write of size 8 at 0x7ba000000150 by main thread: > 6: #0 close <null> (broker+0x447563) > 6: #1 pclosefd > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:805:13 > (libqpid-proton-proactor.so.1+0xcaf4) > 6: #2 pconnection_cleanup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:898:5 > (libqpid-proton-proactor.so.1+0xcaf4) > 6: #3 pconnection_process > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c > (libqpid-proton-proactor.so.1+0xca31) > 6: #4 proactor_do_epoll > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c > (libqpid-proton-proactor.so.1+0x9a17) > 6: #5 pn_proactor_wait > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2156:10 > (libqpid-proton-proactor.so.1+0x95fe) > 6: #6 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:434:32 > (broker+0x4cb503) > 6: #7 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:473:3 > (broker+0x4cb3d3) > 6: > 6: Previous read of size 8 at 0x7ba000000150 by thread T2 (mutexes: write > M2241): > 6: #0 epoll_ctl <null> (broker+0x42f1a8) > 6: #1 rearm > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:720:7 > (libqpid-proton-proactor.so.1+0x871a) > 6: #2 pconnection_rearm > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1014:5 > (libqpid-proton-proactor.so.1+0xcf78) > 6: #3 pconnection_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1051:14 > (libqpid-proton-proactor.so.1+0x9e24) > 6: #4 pn_proactor_done > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2166:5 > (libqpid-proton-proactor.so.1+0x9e24) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:439:5 > (broker+0x4cb4e6) > 6: > 6: Location is file descriptor 21 created by thread T2 at: > 6: #0 accept <null> (broker+0x435375) > 6: #1 listener_accept_lh > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1682:27 > (libqpid-proton-proactor.so.1+0xdd1c) > 6: #2 listener_process > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1718:9 > (libqpid-proton-proactor.so.1+0xdd1c) > 6: #3 proactor_do_epoll > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2146:17 > (libqpid-proton-proactor.so.1+0x99ad) > 6: #4 pn_proactor_wait > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:2156:10 > (libqpid-proton-proactor.so.1+0x95fe) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:434:32 > (broker+0x4cb503) > 6: > 6: Mutex M2241 (0x7b7000017ee8) created at: > 6: #0 pthread_mutex_init <null> (broker+0x42e922) > 6: #1 pmutex_init > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:105:7 > (libqpid-proton-proactor.so.1+0x560a) > 6: #2 pconnection_setup > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:853:3 > (libqpid-proton-proactor.so.1+0x560a) > 6: #3 pn_listener_accept2 > /home/jdanek/repos/qpid/qpid-proton/c/src/proactor/epoll.c:1797:21 > (libqpid-proton-proactor.so.1+0x7dd8) > 6: #4 handle > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:306:6 > (broker+0x4cb794) > 6: #5 broker_thread > /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:437:14 > (broker+0x4cb794) > 6: > 6: Thread T2 (tid=7361, running) created by main thread at: > 6: #0 pthread_create <null> (broker+0x42e5a2) > 6: #1 main /home/jdanek/repos/qpid/qpid-proton/c/examples/broker.c:471:5 > (broker+0x4cb3af) > 6: > 6: SUMMARY: ThreadSanitizer: data race > (/home/jdanek/repos/qpid/qpid-proton/cmake-build-debug-gcc/c/examples/broker+0x447563) > in close > 6: ================== > 6: ________________________________ stderr(7358) > ________________________________ > 6: > 6: > 6: ---------------------------------------------------------------------- > 6: Ran 1 test in 4.261s > 6: > 6: FAILED (errors=1) > 6/24 Test #6: c-fdlimit-tests ..................***Failed 4.35 sec > {noformat} > I used clang 9.0.0 with tsan to compile. I am logging this because I intend > to start writing suppression file, and I need a Jira number to reference. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org