lday0321 commented on issue #1687:
URL: 
https://github.com/apache/incubator-brpc/issues/1687#issuecomment-1024219849


   另外,这个UT程序,跑到server.Join的时候就挂掉了, 非TSAN时,能够正常结束。
   ```cpp
   TEST_F(MyTest, TSAN_Check_brpc) {
     LOG(INFO) << "Hello, TSAN brpc!";
     butil::ip_t ip = butil::my_ip();
     uint16_t port = 12345;
     brpc::Server server;
     butil::EndPoint end_point = butil::EndPoint(ip, port);
     int rc = server.Start(end_point, NULL);
     ASSERT_EQ(0, rc);
     LOG(INFO) << "Hello, before sleep";
     std::this_thread::sleep_for(std::chrono::seconds(10));
     LOG(INFO) << "Hello, before stop";
     server.Stop(0);
     LOG(INFO) << "Hello, before join";
     server.Join();
     LOG(INFO) << "Hello, before exit";
   }
   ```
   
   出错信息:
   ```
   I0128 20:44:08.095814 12180 tsan_test.cc:33] Hello, before stop
   I0128 20:44:08.095880 12180 server.cpp:1101] Server[] is going to quit
   I0128 20:44:08.097417 12180 tsan_test.cc:35] Hello, before join
   ThreadSanitizer:DEADLYSIGNAL
   ==12180==ERROR: ThreadSanitizer: SEGV on unknown address 0x000000000000 (pc 
0x7f25c05052be bp 0x000000000000 sp 0x7f25961fe9e8 T12233)
   ==12180==The signal is caused by a WRITE memory access.
   ==12180==Hint: address points to the zero page.
       #0 __sanitizer::internal_memcpy(void*, void const*, unsigned long) 
<null> (tsan_test+0x1952bd)
       #1 __tsan::VarSizeStackTrace::Init(unsigned long const*, unsigned long, 
unsigned long) <null> (tsan_test+0x229813)
       #2 __tsan::ReportRace(__tsan::ThreadState*) <null> (tsan_test+0x2278db)
       #3 <null> <null> (tsan_test+0x22c6dd)
       #4 __tsan_write4 <null> (tsan_test+0x21c41c)
       #5 bthread::TaskGroup::task_runner(long) 
/v/brpc/incubator-brpc/src/bthread/task_group.cpp (tsan_test+0x31bcc7)
       #6 bthread_make_fcontext <null> (tsan_test+0x2f74c0)
   
   ThreadSanitizer can not provide additional info.
   SUMMARY: ThreadSanitizer: SEGV (/v/tsan_demo/build_tsan/tsan_test+0x1952bd) 
in __sanitizer::internal_memcpy(void*, void const*, unsigned long)
   ==12180==ABORTING
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to