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

SystemError crash on get_hub with Python 3.7 on OSX and Windows #1261

Closed
pkittenis opened this Issue Jul 18, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@pkittenis

pkittenis commented Jul 18, 2018

  • gevent version: 1.3.5
  • Python version: cPython 3.7.0 from python.org
  • Operating System: Windows 2012 Server, OSX 10.10+

Description:

get_hub() causes SystemError crash:

Windows:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\projects\parallel-ssh-4nme1\pssh\clients\__init__.py", line 19, in <module>
    from .native.parallel import ParallelSSHClient
  File "C:\projects\parallel-ssh-4nme1\pssh\clients\native\__init__.py", line 19, in <module>
    from .parallel import ParallelSSHClient
  File "C:\projects\parallel-ssh-4nme1\pssh\clients\native\parallel.py", line 25, in <module>
    from .single import SSHClient
  File "C:\projects\parallel-ssh-4nme1\pssh\clients\native\single.py", line 50, in <module>
    THREAD_POOL = get_hub().threadpool
  File "src\gevent\_hub_local.py", line 70, in gevent.__hub_local.get_hub
  File "C:\Python37-x64\lib\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: c:\_work\4\s\objects\dictobject.c:1439: bad argument to internal function

OSX:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/travis/build/ParallelSSH/parallel-ssh/venv/lib/python3.7/site-packages/pssh/clients/__init__.py", line 19, in <module>
    from .native.parallel import ParallelSSHClient
  File "/Users/travis/build/ParallelSSH/parallel-ssh/venv/lib/python3.7/site-packages/pssh/clients/native/__init__.py", line 19, in <module>
    from .parallel import ParallelSSHClient
  File "/Users/travis/build/ParallelSSH/parallel-ssh/venv/lib/python3.7/site-packages/pssh/clients/native/parallel.py", line 25, in <module>
    from .single import SSHClient
  File "/Users/travis/build/ParallelSSH/parallel-ssh/venv/lib/python3.7/site-packages/pssh/clients/native/single.py", line 50, in <module>
    THREAD_POOL = get_hub().threadpool
  File "src/gevent/_hub_local.py", line 70, in gevent.__hub_local.get_hub
  File "/Users/travis/build/ParallelSSH/parallel-ssh/venv/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

Linux does not have the issue.

Here are CI logs for Windows and OSX. Other OSX versions are also available in the same build.

What I've run:

from gevent import get_hub
get_hub()

Would be happy to help resolve the issue with some pointers where to start.

_greenlet_primitives.py", line 42 is self.spawning_greenlet = wref(current) but what that has to do with dictobject.c is not clear. dictobject.c:1439 is setitem.

@penguinolog

This comment has been minimized.

penguinolog commented Jul 18, 2018

Looks like the same as #1260

@pkittenis

This comment has been minimized.

pkittenis commented Jul 18, 2018

Same stack trace but I do not see the issue on Linux either with wheels or self-built. Only occurs on OSX and Windows from wheels. Greenlet version 0.4.14.

@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

Same root cause as #1260.

@panamantis

This comment has been minimized.

panamantis commented Sep 21, 2018

On windows py3.7 the temp fix worked: pip install greenlet==0.4.13

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