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

Python 3.7 failures on 32bit systems #172

Closed
hroncok opened this issue Jun 21, 2018 · 5 comments
Closed

Python 3.7 failures on 32bit systems #172

hroncok opened this issue Jun 21, 2018 · 5 comments

Comments

@hroncok
Copy link
Contributor

hroncok commented Jun 21, 2018

  • uvloop version: master
  • Python version: 3.7.0rc1
  • Platform: Linux (Fedora 29), 32bit only (both i383 and armv7hl)
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: yes

The test suite fails on Python 3.7 on 32bit Linux.

It's a couple of errors (256) but it look like all are related to:

Traceback (most recent call last):
  File "/builddir/uvloop/uvloop/_testbase.py", line 81, in setUp
    self.loop = self.new_loop()
  File "/builddir/uvloop/uvloop/_testbase.py", line 299, in new_loop
    return uvloop.new_event_loop()
  File "/builddir/uvloop/uvloop/__init__.py", line 20, in new_event_loop
    return Loop()
  File "uvloop/loop.pyx", line 110, in uvloop.loop.Loop.__cinit__
    self._transports = weakref_WeakValueDictionary()
TypeError: 'NoneType' object is not callable

This might be related to reference counting and the fact that weakref is now not loaded at start time:

Python 3.6.5 (default, Mar 29 2018, 18:20:46) 
[GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> 'weakref' in sys.modules
True
Python 3.7.0rc1 (default, Jun 12 2018, 11:19:29) 
[GCC 8.1.1 20180502 (Red Hat 8.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> 'weakref' in sys.modules
False

Why this happens only on 32bits, I have no idea.

@1st1
Copy link
Member

1st1 commented Jun 21, 2018

This is weird. The weakref module is referenced from uvloop/includes/__init__.py, and the includes module is then imported from uvloop/__init__.py to specifically guard against this scenario.

Seems like a bug in Python 3.7 to be honest.

@jamesjer
Copy link

Actually, the first error I see in the logs is this one:

ERROR: test_aiohttp (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_aiohttp
Traceback (most recent call last):
  File "/usr/lib/python3.7/unittest/loader.py", line 434, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.7/unittest/loader.py", line 375, in _get_module_from_name
    __import__(name)
  File "/builddir/build/BUILD/uvloop-0.10.1/tests/test_aiohttp.py", line 12, in <module>
    from uvloop import _testbase as tb
  File "/builddir/build/BUILD/uvloop-0.10.1/uvloop/__init__.py", line 7, in <module>
    from .loop import Loop as __BaseLoop  # NOQA
  File "uvloop/includes/stdlib.pxi", line 128, in init uvloop.loop
    cdef long MAIN_THREAD_ID = <long>threading.main_thread().ident
OverflowError: Python int too large to convert to C long

Changing the type from long to long long fixes that, and then the other errors all disappear.

@hroncok
Copy link
Contributor Author

hroncok commented Jun 22, 2018

Oh. I should have posted full log in the first place. Nice catch!

@1st1 1st1 closed this as completed in a68f3c9 Jun 22, 2018
@1st1
Copy link
Member

1st1 commented Jun 22, 2018

Should be fixed in master, please test. Thanks!

1st1 added a commit that referenced this issue Jun 25, 2018
Fixes #172.

Thanks to @vstinner, @jamesjer, and @hroncok for discovering this
problem and suggesting a fix.
@vstinner
Copy link
Contributor

It seems like the bug has been fixed by the commit a68f3c9.

Most uvloop tests pass on my 32-bit Ubuntu and Python master (future 3.8). I have a few failures coming from the fact that I didn't install Python, but ran it from the directory where I compiled it from source.

1st1 added a commit that referenced this issue Jul 4, 2018
1st1 added a commit that referenced this issue Jul 4, 2018
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