Skip to content

Conversation

dz-fsd
Copy link
Contributor

@dz-fsd dz-fsd commented Jul 21, 2025

Summary

Fixes occasional abort()s on Windows platform caused by unhandled errors returned by WSAPoll(), causing occasional crashes.

Problem

Error handling for the poll() function is left to the caller, that should remember to use WSAGetLastError() instead of using errno to find out the error reason. This requires #ifdef ZMQ_HAVE_WINDOWS ... #endif and Windows-specific code to be done for each poll() invocation.

Solution

On Windows platform, implement custom WSA error to errno translation in the poll() function itself. The goal is to make Windows-specific poll() to appear more Unixy to the callers.

Changes

  • Windows-specific poll() function implementation in windows.hpp

Platforms affected

  • Windows

Checklist

  • Code compiles correctly
  • No new compiler warnings
  • No breaking API changes
  • Comments added where needed
  • Change is scoped to Windows-specific logic

dz-fsd added 2 commits July 21, 2025 15:20
Solution: On Windows platform, implement custom WSA error to errno
translation in the poll() function. The goal is to make
Windows-specific poll() to appear more Unixy to the callers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant