qemu-alpha linux-user breaks python3.6 Running on Gentoo Linux in a chroot environment: # python3 -c 'import selectors; selectors.DefaultSelector()' Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.7/selectors.py", line 349, in __init__ self._selector = self._selector_cls() OSError: [Errno 22] Invalid argument However, on real hardware, with the same binaries there is no exception. This impacts whole python3 based Gentoo ebuild system (package management), and renders linux user mode alpha emulation in chroot environment building useless, more or less. The used systems: # qemu-alpha --version qemu-alpha version 4.2.0 Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers # uname -a Linux blackbird 5.4.28-gentoo-blackbird-06 #2 SMP Sat Apr 4 13:13:10 CEST 2020 x86_64 AMD Ryzen 5 3600 6-Core Processor AuthenticAMD GNU/Linux (chroot)# python3 --version Python 3.7.7 Hi, do you know if it works with previous version of qemu? Do you know if it works with qemu built from git repo? I know, that it is broken since I use for alpha emulation, since 2017-2018. However it worked with python2.7 before. But python 2.7 reached end of life support, and HAVE TO use 3.6 or 3.7, so this one became a pain now. I will try the git version, but have no high hopes... Tried git version qemu-alpha as well, and I can confirm it gives the same error. For additional information, neither of these has this bug (nor in 4.2.0, neither in git): - qemu-mips64 - qemu-arm - qemu-aarch64 Related Gentoo bug: https://bugs.gentoo.org/717548 Proposed possible fix as https://lists.nongnu.org/archive/html/qemu-devel/2020-04/msg02545.html Tested the proposed patch from Sergei Trofimovich, and it solves the problem, while doesn't break the other archs I use (mips64,arm,aarch64 also tested). Thank you! 386d38656889 ("linux-user/syscall.c: add target-to-host mapping for epoll_create1()")