facebook / facebook/folly

EventBase crash when destruction on windows

Open
#1,571 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
30.5k
Forks
5.9k
PR merge metrics
No merged PRs in 30d

Description

EventBase may crash on windows(vs2019) when destruct. It happens both when delete EventBase pointer or using folly::ScopedEventBaseThread to hold the EventBase's life, the test of orgin ScopedEventBaseThreadTest.cpp may failed.

I tracked EventBase.cpp, line 225 cause the crash
````cpp // Call all destruction callbacks, before we start cleaning up our state.
while (!onDestructionCallbacks_.rlock()->empty()) {
OnDestructionCallback::List callbacks;
onDestructionCallbacks_.swap(callbacks);
while (!callbacks.empty()) {
auto& callback = callbacks.front();
callbacks.pop_front();
callback.runCallback(); # <--- this line crash
}
}
````

![image](https://user-images.githubusercontent.com/665400/117097158-70456980-ad9d-11eb-9193-f8b3e37e011f.png)
![image](https://user-images.githubusercontent.com/665400/117097228-9d921780-ad9d-11eb-9217-fbce40a13225.png)
![image](https://user-images.githubusercontent.com/665400/117097420-23ae5e00-ad9e-11eb-8dc0-4368c56bc94b.png)
![image](https://user-images.githubusercontent.com/665400/117097703-ee564000-ad9e-11eb-87bd-eb2ec0987085.png)
![image](https://user-images.githubusercontent.com/665400/117097781-32e1db80-ad9f-11eb-9eeb-3b97eb4df95d.png)

I had test this on windows 10/windows server 2019/linux, linux is ok, but both windows crashed.

thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.