zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1

Home Page:https://www.zeromq.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to achieve self-repair, instead of crashing, when the loopback connection within zmq::signaler_t is interrupted in a Windows environment?

hjyheb opened this issue · comments

Problem Description

A firewall or certain network control programs have interrupted the local loopback connection, causing the TCP connection within zmq::signaler_t to be disconnected. This triggers an exception, leading to a crash in the program that is loading libzmq.

Environment

libzmq version: 4.3.5
Operating System: Windows 11

Minimal Test Code/Steps to Reproduce the Issue

  1. Start the HttpDebuggerPro service.
  2. Check the status of the HttpDebuggerSdk driver to see if it is running: sc query HttpDebuggerSdk.
  3. Run test_xpub_welcome_msg.exe and let it sleep before test_context_socket_close.
  4. Stop the HttpDebuggerSdk driver.
  5. Stop the HttpDebuggerPro service.
  6. test_xpub_welcome_msg.exe crashes.

Actual Results? (If applicable, include assertion messages and call stack)

Assertion failed: Assertion failed: nbytes == sizeof (dummy) (..\src\signaler.cpp:375)
Assertion failed: Assertion failed: nbytes == sizeof (dummy) (..\src\signaler.cpp:375)

Expected Results

Inability to prevent a third-party program from interrupting the loopback connection. libzmq should have self-healing capabilities, and the TCP connection within signaler_t should support reconnection or be returned to the higher-level caller instead of causing a crash in the calling layer.

The internal control socket on the loopback needs to work, otherwise nothing will work. It's internal-only so either allow it or use a windows build with af_unix.