You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ouroboros-network/Win32-network/src/System/Win32/Async.hs implements readHandle by initiating an async read then calling waitForCompletion, which will, via an MVar, wait for c_GetQueuedCompletionStatus to complete in another thread, which passes in maxBound for timeout, which will be passed to HsGetQueuedCompletionStatus and then GetQueuedCompletionStatus, which can result in an infinite wait. ouroboros-network/Win32-network/test/Test/Async.hs includes a test interrupting this operation by calling killThread, which in combination with the surrounding code will close all the pipe and port handles. Although closing all related handles will break the infinite wait, it is a blunt hammer. Instead, prefer CancelIoEx to cancel a request individually or use timed instead of infinite waits.
As reported by Root9B.
The text was updated successfully, but these errors were encountered:
1627: CancelIoEx and overal review of Win32-network r=coot a=coot
The primary goal of this PR was to add `CancelIoEx` to fix#1574. In doing so I changed the interface and the end result is that:
* we don't use C type level wrappers for windows syscalls any more (apart from `GetQueuedCompletionStatus` where we need to use a windwo kernel C macro.
* using `GADTs` to ensure that we use the right combination of `OVERLAPPED` / `WSAOVERLAPPED`, `HANDLE` / `SOCKET` and `ErrCode` / `WsaErrCode`.
* there is a closed type family which ensures that some of the `castPtr` usage is actually safe, it is not exposed. It could be removed, but then using `castPtr` would leak out to various modules - so I preferred the more elegant and local, though type havier approach.
* more tests, especially for error conditions in which we need to assure that we are not deallocating the stable pointer twice 💣
This PR is done on top of `coot/windows-vectored-io` (and it merges into that branch) - this makes the scope of this PR adequate for the proposed changes. For the moment the windows stuff is stacked on CI, but when devops will help with it I will be able to merge all the PRs in turn.
1840: Update dependency on cardano-ledger-specs r=mrBliss a=mrBliss
Co-authored-by: Marcin Szamotulski <[email protected]>
Co-authored-by: Thomas Winant <[email protected]>
As reported by Root9B.
The text was updated successfully, but these errors were encountered: