yanglimingcn commented on PR #3140:
URL: https://github.com/apache/brpc/pull/3140#issuecomment-3500524671

   Root Cause:
   a. Premature deallocation: Parent span destroyed while child spans still in 
use
   b. Dangling pointer: Response callback accesses freed span objects
   
   The span information is a tree structure, and this relationship is 
maintained through the ref information. For example, ParentSpan initially has 
ref=1, and two ClientSpans are created, so ref becomes 3.
   
   When one ClientSpan returns, ref becomes 2; when the other ClientSpan 
returns, ref becomes 1. At this point, it can be destructed.
   
   Because a single call might be split into a tree, the bthreads generated by 
this call should follow the lifecycle principle of this call chain, which 
should be fine.


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