zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.62k stars 2.35k forks source link

Crashes when running in Wine #4447

Open Greatsamps opened 1 year ago

Greatsamps commented 1 year ago

Hi,

We are using this library in a C++ DLL referenced by a 3rd party windows application. Everything runs fine on Windows, however we need to run it in Linux via Wine.

When trying to connect to the zeromq remote, the application crashes with the following logs recorded:

02a8:fixme:secur32:schan_QueryContextAttributesA Unhandled attribute 0x6e 02c4:fixme:secur32:schan_QueryContextAttributesA Unhandled attribute 0x6e 029c:fixme:winsock:WSAIoctl unimplemented ioctl _WSAIOW(IOC_VENDOR, 16) 029c:fixme:winsock:server_ioctl_sock Unsupported ioctl 120348 (device=12 access=0 func=d2 method=0) 029c:fixme:winsock:WSAIoctl unimplemented ioctl _WSAIOW(IOC_VENDOR, 16) 029c:fixme:winsock:server_ioctl_sock Unsupported ioctl 120348 (device=12 access=0 func=d2 method=0) 029c:fixme:winsock:WSAIoctl unimplemented ioctl _WSAIOW(IOC_VENDOR, 16) 029c:fixme:winsock:server_ioctl_sock Unsupported ioctl 120348 (device=12 access=0 func=d2 method=0) 029c:fixme:winsock:WSAIoctl unimplemented ioctl _WSAIOW(IOC_VENDOR, 16) 029c:fixme:winsock:server_ioctl_sock Unsupported ioctl 120348 (device=12 access=0 func=d2 method=0) 029c:fixme:winsock:WSAIoctl unimplemented ioctl _WSAIOW(IOC_VENDOR, 16) 029c:fixme:winsock:server_ioctl_sock Unsupported ioctl 120348 (device=12 access=0 func=d2 method=0) 029c:fixme:winsock:WSAIoctl unimplemented ioctl _WSAIOW(IOC_VENDOR, 16) 029c:fixme:winsock:server_ioctl_sock Unsupported ioctl 120348 (device=12 access=0 func=d2 method=0) Invalid argument (C:\FileShare\Development\vcpkg\buildtrees\zeromq\src\v4.3.4-93 3c603e1e.clean\src\epoll.cpp:187) 029c:fixme:winsock:WSAIoctl unimplemented ioctl _WSAIOW(IOC_VENDOR, 16) 029c:fixme:winsock:server_ioctl_sock Unsupported ioctl 120348 (device=12 access=0 func=d2 method=0) Invalid argument (C:\FileShare\Development\vcpkg\buildtrees\zeromq\src\v4.3.4-93 3c603e1e.clean\src\epoll.cpp:187)

Is this something that is fixable?

quepas commented 4 months ago

I wouldn't care about this wine warning:

029c:fixme:winsock:WSAIoctl unimplemented ioctl _WSAIOW(IOC_VENDOR, 16)
029c:fixme:winsock:server_ioctl_sock Unsupported ioctl 120348 (device=12 access=0 func=d2 method=0)

If I am not mistaken, this warning is about the fact that wine doesn't implement one specific Winsock Socket input/output control code (IOCTL). I get the same warning in my application, but it still works.

It seems that the real issue is in your ZMQ code:

Invalid argument (C:\FileShare\Development\vcpkg\buildtrees\zeromq\src\v4.3.4-93
3c603e1e.clean\src\epoll.cpp:187)

Somewhere around here: https://github.com/zeromq/libzmq/blob/v4.3.4/src/epoll.cpp#L187. So, maybe the call to epoll_wait(), which is just before and could generate this error, gets an invalid argument?

const int n = epoll_wait (_epoll_fd, &ev_buf[0], max_io_events,
                                      timeout ? timeout : -1);