[ 
https://issues.apache.org/jira/browse/THRIFT-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

JinHai updated THRIFT-5831:
---------------------------
        Fix Version/s:     (was: 0.20.0)
    Affects Version/s: 0.20.0

> Threadsanitizer reports data race on Thrift c++ 
> ------------------------------------------------
>
>                 Key: THRIFT-5831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5831
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.20.0
>         Environment: Ubuntu 24.04, Clang-18
>            Reporter: JinHai
>            Priority: Major
>
> {code:c++}
>  * Data race (pid=689591)
>  * Read of size 8 at 0x72b0000000e0 by thread T370:
>  * 0x5555558f11fb send
>  * 0x55555918b3c2 apache::thrift::transport::TServerSocket::notify 
> TServerSocket.cpp:713
>  * 0x55555918b4bb apache::thrift::transport::TServerSocket::interrupt 
> TServerSocket.cpp:722
>  * 0x5555591a05d2 apache::thrift::server::TServerFramework::stop 
> TServerFramework.cpp:221
>  * 0x5555561b597d (infinity+0xc6197c) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) thrift_server.cpp:127
>  * 0x555555945869 main::$_1::operator() const infinity_main.cpp:215
>  * 0x555555945816 std::__invoke[abi:ne180100]<…> invoke.h:344
>  * 0x555555945786 std::__invoke_void_return_wrapper::__call[abi:ne180100]<…> 
> invoke.h:419
>  * 0x55555594573e std::__function::__alloc_func::operator()[abi:ne180100] 
> function.h:169
>  * 0x55555594417a std::__function::__func::operator() function.h:311
>  * 0x555555a1f3e2 std::__function::__value_func::operator()[abi:ne180100] 
> const function.h:428
>  * 0x555555a1f346 std::function::operator() const function.h:981
>  * 0x555555ab9c93 (infinity+0x565c92) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) infinity_context.cpp:475
>  * 0x555555aba4a6 (infinity+0x5664a5) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) infinity_context.cpp:401
>  * 0x55555594701c ShutdownServer infinity_main.cpp:87
>  * 0x555555946ee2 main::$_4::operator() const infinity_main.cpp:250
>  * 0x555555946e56 std::__invoke[abi:ne180100]<…> invoke.h:344
>  * 0x555555946e0e (infinity+0x3f2e0d) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) thread.h:193
>  * 0x555555946af3 std::__thread_proxy[abi:ne180100]<…> thread.h:202
>  * Previous write of size 8 at 0x72b0000000e0 by thread T302:
>  * 0x5555558c3e0b socketpair
>  * 0x555559189273 apache::thrift::transport::TServerSocket::listen 
> TServerSocket.cpp:388
>  * 0x55555919efcd apache::thrift::server::TServerFramework::serve 
> TServerFramework.cpp:117
>  * 0x5555591916ba apache::thrift::server::TThreadPoolServer::serve 
> TThreadPoolServer.cpp:97
>  * 0x5555561b58f4 (infinity+0xc618f3) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) thrift_server.cpp:122
>  * 0x555555942fe9 ::operator() const infinity_main.cpp:191
>  * 0x555555942f56 (infinity+0x3eef55) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) invoke.h:344
>  * 0x555555942f0e (infinity+0x3eef0d) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) thread.h:193
>  * 0x555555942bf3 std::__thread_proxy[abi:ne180100]<…> thread.h:202
>  * Location is file descriptor 7 created by thread T302 at:
>  * 0x5555558c3e0b socketpair
>  * 0x555559189273 apache::thrift::transport::TServerSocket::listen 
> TServerSocket.cpp:388
>  * 0x55555919efcd apache::thrift::server::TServerFramework::serve 
> TServerFramework.cpp:117
>  * 0x5555591916ba apache::thrift::server::TThreadPoolServer::serve 
> TThreadPoolServer.cpp:97
>  * 0x5555561b58f4 (infinity+0xc618f3) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) thrift_server.cpp:122
>  * 0x555555942fe9 ::operator() const infinity_main.cpp:191
>  * 0x555555942f56 (infinity+0x3eef55) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) invoke.h:344
>  * 0x555555942f0e (infinity+0x3eef0d) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) thread.h:193
>  * 0x555555942bf3 std::__thread_proxy[abi:ne180100]<…> thread.h:202
>  * Thread T370 (tid=689990, running) created by main thread at:
>  * 0x5555558be8f0 pthread_create
>  * 0x555555a2ecaa std::__libcpp_thread_create[abi:ne180100] 
> __threading_support:317
>  * 0x55555594023f std::thread::thread<…> thread.h:212
>  * 0x55555593fa91 main infinity_main.cpp:250
>  * Thread T302 (tid=689922, running) created by main thread at:
>  * 0x5555558be8f0 pthread_create
>  * 0x555555a2ecaa std::__libcpp_thread_create[abi:ne180100] 
> __threading_support:317
>  * 0x555555942853 std::thread::thread<…> thread.h:212
>  * 0x5555559425f5 main::$_0::operator() const infinity_main.cpp:191
>  * 0x5555559424d6 std::__invoke[abi:ne180100]<…> invoke.h:344
>  * 0x555555942446 std::__invoke_void_return_wrapper::__call[abi:ne180100]<…> 
> invoke.h:419
>  * 0x5555559423fe std::__function::__alloc_func::operator()[abi:ne180100] 
> function.h:169
>  * 0x555555940e3a std::__function::__func::operator() function.h:311
>  * 0x555555a1f3e2 std::__function::__value_func::operator()[abi:ne180100] 
> const function.h:428
>  * 0x555555a1f346 std::function::operator() const function.h:981
>  * 0x555555ab9ba7 (infinity+0x565ba6) (BuildId: 
> 0a6a1911ecd8983e7950e68f2e2135adab24a457) infinity_context.cpp:468
>  * 0x55555593f9fd main infinity_main.cpp:243
> {code}
> I am using thrift as below.
> https://github.com/infiniflow/infinity/blob/d1301a0867447bc80f60ff8b16be2fc8b10344f3/src/network/thrift_server.cpp#L93



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to