chenBright commented on PR #2931:
URL: https://github.com/apache/brpc/pull/2931#issuecomment-2772069677

   > 需要在环境中显式设置 detect_stack_use_after_return=1 来验证 fake_stack 是否正确构建和析构吗?
   
   在UT里验证过了。
   
   修复了另一个问题:bthread结束后,__sanitizer_start_switch_fiber(NULL)会删除fake 
stack,当前bthread栈不可用了。当下一个bthread复用栈,就会出现stack use after return的问题。
   
   
修复方案:bthread栈会复用,所以即使bthread结束了,也不调__sanitizer_start_switch_fiber(NULL),保证fake 
stack不会被删除。bthread栈在放回池时,会poison,可以起到stack use after return类似的检查效果。


-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to