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

Binary compatibility issues on Python 3.7/Linux #1260

Closed
penguinolog opened this Issue Jul 18, 2018 · 11 comments

Comments

Projects
None yet
4 participants
@penguinolog

penguinolog commented Jul 18, 2018

  • gevent version: 1.3.5 (from PyPI)
  • Python version: cPython 3.7.0
  • Operating System: Gentoo Linux, Python 3.7 docker image

Description:

Run at python console: import gevent.threadpool

Warnings:

At virtualenv@gentoo linux

/home/penguinolog/virtualenvs/py37/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/home/penguinolog/virtualenvs/py37/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/home/penguinolog/virtualenvs/py37/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/home/penguinolog/virtualenvs/py37/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/home/penguinolog/virtualenvs/py37/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/home/penguinolog/virtualenvs/py37/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/home/penguinolog/virtualenvs/py37/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/home/penguinolog/virtualenvs/py37/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)

At python:3.7 docker image:

/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)

Result:

>>> executor = gevent.threadpool.ThreadPool(maxsize=20,hub=None)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/penguinolog/virtualenvs/py37/lib/python3.7/site-packages/gevent/threadpool.py", line 63, in __init__
    hub = get_hub()
  File "src/gevent/_hub_local.py", line 73, in gevent.__hub_local.get_hub_noargs
  File "src/gevent/_hub_local.py", line 80, in gevent.__hub_local.get_hub_noargs
  File "/home/penguinolog/virtualenvs/py37/lib/python3.7/site-packages/gevent/hub.py", line 390, in __init__
    WaitOperationsGreenlet.__init__(self, None, None)
  File "src/gevent/_greenlet_primitives.py", line 42, in gevent.__greenlet_primitives.TrackedRawGreenlet.__init__
SystemError: Objects/dictobject.c:1439: bad argument to internal function
>>> executor = gevent.threadpool.ThreadPool(maxsize=20,hub=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/gevent/threadpool.py", line 63, in __init__
    hub = get_hub()
  File "src/gevent/_hub_local.py", line 73, in gevent.__hub_local.get_hub_noargs
  File "src/gevent/_hub_local.py", line 80, in gevent.__hub_local.get_hub_noargs
  File "/usr/local/lib/python3.7/site-packages/gevent/hub.py", line 390, in __init__
    WaitOperationsGreenlet.__init__(self, None, None)
  File "src/gevent/_greenlet_primitives.py", line 42, in gevent.__greenlet_primitives.TrackedRawGreenlet.__init__
SystemError: Objects/dictobject.c:1439: bad argument to internal function

Temporary solution:
pip install -U --force-reinstall --no-binary :all: gevent
(Compile gevent during installation)

@penguinolog

This comment has been minimized.

penguinolog commented Jul 18, 2018

De-facto required to re-build gevent only, so :all: rule is overkill

@jamadden

This comment has been minimized.

Member

jamadden commented Jul 18, 2018

What version of greenlet is installed?

@penguinolog

This comment has been minimized.

penguinolog commented Jul 18, 2018

root@34710e4bd3c4:/# pip freeze
gevent==1.3.5
greenlet==0.4.14
@penguinolog

This comment has been minimized.

penguinolog commented Jul 18, 2018

Issue only if wheel package installed from PyPI

@jamadden

This comment has been minimized.

Member

jamadden commented Jul 18, 2018

Ok, gevent wheels are built with greenlet 0.4.13. Something must have changed in the ABI of greenlet 0.4.14 (which was released last night).

As you discovered, building gevent from source should fix the issue, and I would expect installing greenlet==0.4.13 would as well.

@pkittenis

This comment has been minimized.

pkittenis commented Jul 18, 2018

Greenlet did make an ABI change to handle a Python 3.7 crash in 0.4.14.

@jamadden

This comment has been minimized.

Member

jamadden commented Jul 18, 2018

Right, that's python-greenlet/greenlet#132

I could pull the gevent 3.7 wheels from PyPI until we're ready for a 1.3.6 release. That punishes anyone using greenlet 0.4.13, but 0.4.13 is subtlety broken anyway (not enough that it shows up in the gevent test cases, though).

@pkittenis

This comment has been minimized.

pkittenis commented Jul 18, 2018

A rebuild of gevent wheels with the 0.4.14 greenlet.h would resolve it as well, if that is preferred to waiting for 1.3.6.

Would also need requirements updating to >=0.4.14 for greenlet. I can make those changes if you'd like.

@jamadden

This comment has been minimized.

Member

jamadden commented Jul 18, 2018

Wheels cannot be rebuilt without changing the version number. And gevent has to include its own copy of greenlet.h to support certain installation scenarios using sdists so that also requires a new version number.

@jamadden jamadden closed this in 6c26ac1 Jul 18, 2018

jamadden added a commit that referenced this issue Jul 18, 2018

Merge pull request #1262 from gevent/issue1260
Update to greenlet 0.4.14. Fixes #1260.
@pkittenis

This comment has been minimized.

pkittenis commented Jul 19, 2018

Yes, meant with version change. Thanks for making the changes 👍

@AndreyBulezyuk

This comment has been minimized.

AndreyBulezyuk commented Aug 7, 2018

I had the same issue:

  • Running Docker Python3.7 on Google Cloud Kubernetes.
  • Gunicorn, Greenlet and Gevent newest versions

Issues: Workers were timing out, after some fixing, the Runtime Error.

Fixed:

  • Changed Base Image to Python3.6
  • gunicorn==19.9.0
  • gevent==1.3.4
  • greenlet==0.4.13

Thanks for your help!

tavianator added a commit to Microsoft/TextWorld that referenced this issue Aug 8, 2018

@jamadden jamadden referenced this issue Aug 10, 2018

Closed

macOS error #1269

LefterisJP added a commit to LefterisJP/raiden that referenced this issue Aug 25, 2018

Bump gevent to 1.3.6
Now that gevent has included a fix for
gevent/gevent#1260 in a release we should bump to it
so that we don't have to manually recompile gevent whenever we use python 3.7

LefterisJP added a commit to LefterisJP/raiden that referenced this issue Aug 25, 2018

Bump gevent to 1.3.6
Now that gevent has included a fix for
gevent/gevent#1260 in a release we should bump to it
so that we don't have to manually recompile gevent whenever we use python 3.7

[ci integration]

LefterisJP added a commit to raiden-network/raiden that referenced this issue Aug 25, 2018

Bump gevent to 1.3.6
Now that gevent has included a fix for
gevent/gevent#1260 in a release we should bump to it
so that we don't have to manually recompile gevent whenever we use python 3.7

[ci integration]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment