On 5/26/22 00:36, Paul Gofman wrote:
On 5/25/22 10:28, Jacek Caban wrote:
On 5/25/22 04:00, Paul Gofman (@gofman) wrote:
Thus the second patch. In the ideal case we'd probably want to avoid crashing or handle segfault in system APC processing somehow, but I don't yet see a feasible way to do it. In theory the same may happen without ws2_32 if the app does the same, but I don't know that anything hits that case while ws2_32 queues those on stack iosbs, so avoiding that may probably avoid the practical issues.
On Windows, asyncs are terminated when owning thread is terminated. If we supported that and made sure that it happens before thread stack is deallocated, it should solve the problem.
Jacek
Do you mean, e. g., if a thread has called an overlapped DeviceIoControl() (or queued other overlapped IO) and exited, the other thread waiting for it to complete, e. g., with GetOverlappedResult() or waiting for event it will never get the completion?
Or, perhaps Windows cancels I/O operations (on thread termination) and doesn't let the thread stack go away until all I/O operations are completed?