nnnjkk opened a new issue #1084: FlatMap::erase在特定情况下,可能会出现Bug。
URL: https://github.com/apache/incubator-brpc/issues/1084
 
 
   **Describe the bug (描述bug)**
   如果,Value的结构体存储了类似文件描述符这样的系统资源,且在析构时释放系统资源。
   当删除一个bucket的第一个node,且第二个node非空的时候,会出现Bug。
   因为operator=方法,一般只会把系统资源的ID赋值,而并不会主动释放系统资源;所以第一个node的系统资源不能得到释放。
   又因为调用了第二个node的析构,所以会释放掉第二个node的资源,让以后使用这个node的时候出异常。
   
   **To Reproduce (复现方法)**
   
   
   **Expected behavior (期望行为)**
   将“用第二个node赋值第一个node;析构第二个node;”
   改成“析构第一个node;用第二个node拷贝构造第一个node;”
   
   **Versions (各种版本)**
   OS:
   Compiler:
   brpc:
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to