You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/03/06 07:42:18 UTC

[GitHub] [incubator-brpc] yockie opened a new pull request #1056: fix heap overflow in simple_data_pool

yockie opened a new pull request #1056: fix heap overflow in simple_data_pool
URL: https://github.com/apache/incubator-brpc/pull/1056
 
 
   1.代码bug:
   _capacity初始值为1时,在扩容过程中,由于 1 * 3/2 == 1,所以并没有扩容,而最后的_pool[_size++] = data;并没有再判断size与_capacity的关系,导致堆溢出
   
   2.复现条件:
   设置了brpc server option的session_local_data_factory,并且设置reserved_session_local_data为1,client多并发请求时,是必现的。
   
   3.修复方法
   _capacity初始值为1时,同_capacity初始值为0一样,强制设为128,而不是通过(_capacity * 3 / 2)计算。

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-brpc] jamesge merged pull request #1056: fix heap overflow in simple_data_pool

Posted by GitBox <gi...@apache.org>.
jamesge merged pull request #1056: fix heap overflow in simple_data_pool
URL: https://github.com/apache/incubator-brpc/pull/1056
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-brpc] jamesge commented on issue #1056: fix heap overflow in simple_data_pool

Posted by GitBox <gi...@apache.org>.
jamesge commented on issue #1056: fix heap overflow in simple_data_pool
URL: https://github.com/apache/incubator-brpc/pull/1056#issuecomment-596180265
 
 
   Thanks for the fix which is really hard to spot 👍 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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