这是indexloc提供的服务,不要输入任何密码
Skip to content

Problem: zmq_abort() may be called on Windows if polling fails #4809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

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