Skip to content

Conversation

@frederikaalund
Copy link

When importing uvloop, I got the following error:

>>> import uvloop
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/projects/RedPitaya/OS/buildroot/buildroot-2017.02/output/target/usr/lib/python3.5/site-packages/uvloop/__init__.py", line 7, in <module>
ImportError: /usr/lib/python3.5/site-packages/uvloop/loop.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: pthread_atfork

This is fixed by linking the plugin (loop.cpython-35m-arm-linux-gnueabihf.so) to pthread as done in this patch.

When importing uvloop, I got the following error:

    >>> import uvloop
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/projects/RedPitaya/OS/buildroot/buildroot-2017.02/output/target/usr/lib/python3.5/site-packages/uvloop/__init__.py", line 7, in <module>
    ImportError: /usr/lib/python3.5/site-packages/uvloop/loop.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: pthread_atfork

This is fixed by linking the plugin (`loop.cpython-35m-arm-linux-gnueabihf.so`) to pthread as done in this patch.
@1st1
Copy link
Member

1st1 commented Apr 29, 2017

Do we need to do this for all platforms or for Linux+arm only?

@frederikaalund
Copy link
Author

Do we need to do this for all platforms or for Linux+arm only?

Good point. Theoretically, it's needed for all operating systems that use POSIX threads, which is most Unix-like operating systems (Linux, MacOS, etc.). Practically speaking, that is every platform except Windows.

I'm surprised that I'm the first person to get the undefined symbol error. Apparently, this error only triggers in the Linux + ARM combination? Anyhow, linking explicitly against pthread is the way to go.

Also, consider using -pthread instead of -lpthread. I know that I use -lpthread in my patch; I learnt about the difference after making the pull request.

@1st1 1st1 merged commit 357cb60 into MagicStack:master Nov 10, 2017
@1st1
Copy link
Member

1st1 commented Nov 10, 2017

Merged as is. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants