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

MemoryError in Cython backend #1227

Open
linnik opened this issue Sep 13, 2018 · 4 comments
Open

MemoryError in Cython backend #1227

linnik opened this issue Sep 13, 2018 · 4 comments

Comments

@linnik
Copy link

linnik commented Sep 13, 2018

Hi!
After upgrade from 16.0.2 to 17.1.2 pyzmq occasionally gives me MemoryError in zmq.backend.cython.message.copy_zmq_msg_bytes

Fatal read error on zmq socket transport
protocol: <aiozmq.stream.ZmqStreamProtocol object at 0x7f6617d48b00>
transport: <ZmqTransport sock=<zmq.sugar.socket.Socket object at 0x7f6617d318d0> type=SUB read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiozmq/core.py", line 707, in _do_read
    data = self._zmq_sock.recv_multipart(zmq.NOBLOCK)
  File "/usr/local/lib/python3.7/site-packages/zmq/sugar/socket.py", line 467, in recv_multipart
    parts = [self.recv(flags, copy=copy, track=track)]
  File "zmq/backend/cython/socket.pyx", line 788, in zmq.backend.cython.socket.Socket.recv
  File "zmq/backend/cython/socket.pyx", line 824, in zmq.backend.cython.socket.Socket.recv
  File "zmq/backend/cython/socket.pyx", line 195, in zmq.backend.cython.socket._recv_copy
  File "zmq/backend/cython/message.pxd", line 61, in zmq.backend.cython.message.copy_zmq_msg_bytes
MemoryError
*** Error in `python3': free(): invalid next size (normal): 0x00007f6610003420 ***

libzmq-4.2.5
pyzmq-17.1.2
Python-3.7.0 (default, Sep 5 2018, 03:29:17)
[GCC 6.3.0 20170516]

@linnik
Copy link
Author

linnik commented Sep 13, 2018

Stable version that works for me is

libzmq-4.1.6
pyzmq-16.0.2
Python-3.5.4 (default, Sep 13 2017, 14:41:13)
[GCC 4.9.2]

@minrk
Copy link
Member

minrk commented Sep 14, 2018

Do you have an example to reproduce the error? Is this a 32 or 64b system?

@Machoney
Copy link

Machoney commented Mar 19, 2020

have also occurred the same error now. I want to reproduce it. I was a SUB module running of different thread.
pyzmq==18.0.1
python-3.7.4
Windows 10

assertion failed: check () (bundled\zeromq\src\msg.cpp:347)
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "path/to/my/file", line 55, in run
    received_data = self._socket.recv()  # receive data from publish
  File "zmq\backend\cython\socket.pyx", line 788, in zmq.backend.cython.socket.Socket.recv
  File "zmq\backend\cython\socket.pyx", line 824, in zmq.backend.cython.socket.Socket.recv
  File "zmq\backend\cython\socket.pyx", line 195, in zmq.backend.cython.socket._recv_copy
  File "zmq\backend\cython\message.pxd", line 61, in zmq.backend.cython.message.copy_zmq_msg_bytes
MemoryError
Process finished with exit code 1073741845

@SokolovSD
Copy link

SokolovSD commented Dec 21, 2021

Same error code 1073741845 while creating socket at second line of:
context = zmq.Context()
socket = context.socket(zmq_type)

pyzmq 22.3.0
Python 3.9
windows 11

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

4 participants