wuxcer commented on issue #13358:
URL: 
https://github.com/apache/trafficserver/issues/13358#issuecomment-4967377130

   Hey guys, there is another case here.
   Before the issue, I tried to mitigate like this:
   ```c++
   bool
   UnixNetVConnection::add_to_active_queue()
   {
     // Only safe on the netvc owner thread; skip off-thread instead of 
asserting.
     if (this->thread != this_ethread()) { // 1437
       Warning("cross-thread add_to_active_queue skipped: vc=%p vc->thread=%p 
cur=%p", this, this->thread, this_ethread());
       return true;
     }
   
     bool result = false;
   
     MUTEX_TRY_LOCK(lock, nh->mutex, this_ethread());
     if (lock.is_locked()) {
       result = nh->add_to_active_queue(this);
     } else {
       ink_release_assert(!"BUG: It must have acquired the NetHandler's lock 
before doing anything on active_queue.");
     }
     return result;
   
   }
   ```
   And after some days of running, I got one crash log:
   ```
   Thread 522574, [ET_NET 0]:
   0    0x000000000054ff62 crash_logger_invoke(int, siginfo_t*, void*) + 0x72
   1    0x00007f6f6164e990 funlockfile + 0x50
   2    0x00007f6f612b352f gsignal + 0x10f
   3    0x00007f6f61286e65 abort + 0x127
   4    0x000000000056b31b ink_abort(char const*, ...) + 0x9b
   5    0x0000000000568ad5 _ink_assert(char const*, char const*, int) + 0x15
   6    0x0000000000848524 UnixNetVConnection::add_to_active_queue() + 0x204
   7    0x0000000000673180 Http2ConnectionState::create_stream(unsigned int, 
Http2Error&) + 0x30
   8    0x00000000006737e1 Http2ConnectionState::rcv_headers_frame(Http2Frame 
const&) + 0x161
   9    0x000000000066c7bd Http2ConnectionState::rcv_frame(Http2Frame const*) + 
0x10d
   10   0x0000000000667aa1 Http2CommonSession::do_complete_frame_read() + 0xe1
   11   0x0000000000667f26 Http2CommonSession::do_process_frame_read(int, VIO*, 
bool) + 0x326
   12   0x0000000000668378 Http2CommonSession::state_start_frame_read(int, 
void*) + 0xa8
   13   0x000000000068de1d Http2ClientSession::main_event_handler(int, void*) + 
0x2dd
   14   0x00000000008a9a88 EThread::process_event(Event*, int) + 0x388
   15   0x00000000008aa673 EThread::execute_regular() + 0x333
   16   0x00000000008ab049 EThread::execute() + 0x179
   17   0x00000000008a8622 spawn_thread_internal(void*) + 0x62
   18   0x00007f6f616441ca start_thread + 0xea
   19   0x00007f6f6129e8d3 clone + 0x43
   ```
   It looked like that the line ```  if (this->thread != this_ethread()) { // 
1437``` had passed, which meant the vc->thread was not same as the 
nh->mutex->thread_holding.


-- 
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]

Reply via email to