diff options
| author | Spencer Low <CompareAndSwap@gmail.com> | 2015-08-12 18:19:16 -0700 |
|---|---|---|
| committer | Spencer Low <CompareAndSwap@gmail.com> | 2015-08-12 18:19:16 -0700 |
| commit | 87e97ee305627f01ad2b17220fd9a7aa2c3bef30 (patch) | |
| tree | 5c40379b5ee2773f1cb652de63370054eb710fa1 /trusty/coverage/coverage_test.cpp | |
| parent | b81c410abe92e7ebf227a633002da51bcdc6ea65 (diff) | |
adb: win32: fix shutdown deadlock
adb can hang at shutdown due to a deadlock relating to WSACleanup().
This works around the issue by not calling WSACleanup() which shouldn't
be done anyway since threads aren't done using Winsock at shutdown.
A quick way to reproduce the original problem is to run many instances
of adb, many of which will call exit() soon:
for /l %i in (1,1,20) do @start adb nodaemon server
You may have to boost the 20 to 200, or set ADB_TRACE=1 or use Windows
10 instead of Windows 7, to affect the timing, but eventually there
should be hung adb processes with that repro.
A more complete fix to prevent problems like this from occuring in the
future, would be to additionally do the following:
- Investigate all static destructors that are called when exit() is
called.
- If they don't do anything important, switch all calls to exit() to
instead call _exit() and then ban exit() from being called.
Change-Id: Id1be3bf0053809a45f2eca4461e4c35b5ef9388d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
Diffstat (limited to 'trusty/coverage/coverage_test.cpp')
0 files changed, 0 insertions, 0 deletions
