qemu-alpha linux-user breaks python3.6

Bug #1872847 reported by Barnabas Viragh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned
Gentoo Linux
Fix Released
Undecided
Unassigned

Bug Description

Running on Gentoo Linux in a chroot environment:
# python3 -c 'import selectors; selectors.DefaultSelector()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  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

Revision history for this message
Laurent Vivier (laurent-vivier) wrote :

Hi,

do you know if it works with previous version of qemu?
Do you know if it works with qemu built from git repo?

Revision history for this message
Barnabas Viragh (cyborgyn) wrote :

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...

Revision history for this message
Barnabas Viragh (cyborgyn) wrote :

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

Revision history for this message
Barnabas Viragh (cyborgyn) wrote :

Related Gentoo bug: https://bugs.gentoo.org/717548

Revision history for this message
Sergei Trofimovich (trofi) wrote :
Revision history for this message
Barnabas Viragh (cyborgyn) wrote :

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!

Changed in gentoo:
status: New → Fix Committed
Changed in gentoo:
status: Fix Committed → Fix Released
Revision history for this message
Laurent Vivier (laurent-vivier) wrote :

386d38656889 ("linux-user/syscall.c: add target-to-host mapping for epoll_create1()")

Changed in qemu:
status: New → Fix Committed
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.