Ticket #11528 (closed defect: fixed)
wxMSW: socket-based IPC hangs
| Reported by: | alarsen | Owned by: | vadz |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9.1 |
| Component: | network | Version: | 2.9-svn |
| Keywords: | wxMSW, wxSocket, IPC | Cc: | |
| Blocked By: | Patch: | no | |
| Blocking: |
Description
In a wxMSW release-build IPC stops working after the exchange of a few large messages; a debug-build asserts:
src/common/socket.cpp(207): assert "!m_socket->m_reading" failed in wxSocketReadGuard(): read reentrancy?
The assert can be reproduced using samples/ipc/ipc{server,client}.exe (compiled with wxUSE_DDE_FOR_IPC=0) and clicking "Request" a few times.
(The samples continue to work afterwards, perhaps due to the short messages exchanged.)
Tracing the internals with some strategic wxLogMessage() revealed that the following happens (in order):
wxTCPEventHandler::Client_OnRequest() calls
wxSocketBase::Read() which calls
wxSocketBase::DoRead() which calls
wxSocketBase::DoWait() which calls
wxEventLoopBase::GetActive()->DispatchTimeout();
from the event-loop
wxTCPEventHandler::Client_OnRequest() is called again on the same connection leading to
wxSocketBase::Read() being called recursively.
AFAICT the bug was introduced with r61488
I haven't seen this problem on Linux (despite wxIPC being used 24/7 on that platform)

