Commit b89b79d9 authored by Sarang Masti's avatar Sarang Masti Committed by Noam Lerner

Fix asan test crashes

Summary: We need to prevent the socket from being deleted while in the loopCallback.

Test Plan: --  fbconfig '--sanitize' 'address' 'folly/io/async/test' && fbmake runtests

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, folly-diffs@, yfeldblum, chalfant

FB internal diff: D2109031

Tasks: 7250307

Signature: t1:2109031:1432918801:77f0352254925d3f33f1e004c8bba89cde63e2cf

Blame Revision: D2102601
parent 8900cad8
...@@ -556,6 +556,7 @@ class AsyncSocket : virtual public AsyncTransportWrapper { ...@@ -556,6 +556,7 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
public: public:
explicit ImmediateReadCB(AsyncSocket* socket) : socket_(socket) {} explicit ImmediateReadCB(AsyncSocket* socket) : socket_(socket) {}
void runLoopCallback() noexcept override { void runLoopCallback() noexcept override {
DestructorGuard dg(socket_);
socket_->checkForImmediateRead(); socket_->checkForImmediateRead();
} }
private: private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment