Skip to content
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

RequestSocket crash #1108

Open
cduret opened this issue Nov 8, 2024 · 0 comments
Open

RequestSocket crash #1108

cduret opened this issue Nov 8, 2024 · 0 comments

Comments

@cduret
Copy link

cduret commented Nov 8, 2024

Environment

NetMQ Version:    4.0.1.13
Operating System:  WSL2 / Linux Debian
.NET Version:     dotnet sdk 8

I have a crash when using RequestSocket with a pyzmq Response server

server.py (pyzmq version 4.3.5)

import zmq

ctx = zmq.Context()
sock = ctx.socket(zmq.REP)
sock.bind('tcp://localhost:5554')
while True:
  message = sock.recv().decode()
  sock.send('hello {0} !'.format().encode())

client.cs

using System;
using NetMQ;
using NetMQ.Sockets;

namespace Test {
  class Program {
    private static void Main(string[] args) {
      using (var socket = new RequestSocket()) {
        socket.Connect("tcp://localhost:5554");
        socket.SendFrame("world");
        string res = socket.ReceiveFrameString();
        Console.WriteLine(res);
      }
    }
  }
}

Expected behaviour

Expect to have a response: "hello world !"

Actual behaviour

$ ./bin/Debug/net8.0/test 
Process terminated. Assertion failed.
Unexpected null of type Byte[]
   at NetMQ.Assumes.NotNull[T](T o) in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Utils/Assumes.cs:line 12
   at NetMQ.Core.Transports.V2Encoder.SizeReady() in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/V2Encoder.cs:line 36
   at NetMQ.Core.Transports.V2Encoder.Next() in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/V2Encoder.cs:line 25
   at NetMQ.Core.Transports.EncoderBase.Encode(ByteArraySegment& data, Int32 size) in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/EncoderBase.cs:line 103
   at NetMQ.Core.Transports.StreamEngine.BeginSending() in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/StreamEngine.cs:line 451
   at NetMQ.Core.Transports.StreamEngine.ProcessHandshakeCommand(Msg& msg) in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/StreamEngine.cs:line 1186
   at NetMQ.Core.Transports.V2Decoder.PushMsg(ProcessMsgDelegate sink) in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/V2Decoder.cs:line 133
   at NetMQ.Core.Transports.StreamEngine.ProcessInput() in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/StreamEngine.cs:line 982
   at NetMQ.Core.Transports.StreamEngine.Handle(Action action, SocketError socketError, Int32 bytesTransferred) in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/StreamEngine.cs:line 385
   at NetMQ.Core.Transports.StreamEngine.FeedAction(Action action, SocketError socketError, Int32 bytesTransferred) in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/StreamEngine.cs:line 333
   at NetMQ.Core.Transports.StreamEngine.InCompleted(SocketError socketError, Int32 bytesTransferred) in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Transports/StreamEngine.cs:line 1008
   at NetMQ.Core.IOObject.InCompleted(SocketError socketError, Int32 bytesTransferred) in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/IOObject.cs:line 108
   at NetMQ.Core.Utils.Proactor.Loop() in /home/cydu/DEV/zmq/netmq-4.0.1.13/src/NetMQ/Core/Utils/Proactor.cs:line 123
Aborted (core dumped)
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

No branches or pull requests

1 participant