summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/118/all/1829459
blob: f42ca0dedef9613598e031e6a035f392cdec3f2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
permissions: 0.970
virtual: 0.964
register: 0.963
architecture: 0.959
device: 0.949
x86: 0.947
peripherals: 0.947
performance: 0.945
arm: 0.945
PID: 0.942
assembly: 0.940
graphic: 0.938
risc-v: 0.937
debug: 0.935
kernel: 0.934
socket: 0.931
user-level: 0.930
hypervisor: 0.923
network: 0.913
ppc: 0.908
vnc: 0.905
semantic: 0.904
files: 0.899
KVM: 0.885
VMM: 0.879
TCG: 0.872
mistranslation: 0.872
boot: 0.845
i386: 0.724

qemu seems to lack support for pid namespace.

# Version

qemu-4.0.0

# commands used to launch qemu-aarch64 in user mode.

printf '%s\n' ':qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64:'"${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register

> sudo cp /usr/bin/qemu-aarch64 $RPI/usr/bin
> sudo chroot $RPI /bin/ksh -l

# host

Gentoo Linux amd64

# Guest

Gentoo Linux aarch64

# The problem that I have

"emerge" program fails due to the error, "qemu: qemu_thread_create: Invalid argument".
"emerge" is Gentoo's package manager that compiles and installs packages.

# How to reproduce the issue

Execute

unshare --pid -- echo hello world

or

python -c "import portage.process; portage.process.spawn(['echo', 'hello', 'world'], unshare_pid=True)"

PID namespace prevents to execute some syscalls, even if you use --map-root-user. This is managed at kernel level by the capabilities.

Could you try to do the exact same thing with the native architecture binaries in the chroot to see if the problem really comes from qemu-user?

Could you try to use the latest unshare version (util-linux package) that adds a "--keep-caps" parameter (v2.35-rc1) to preserve the capabilities?

In a native chroot, `sudo unshare --pid -- echo hello world` works without a problem.

In a qemu-aarch64 chroot, `sudo unshare --keep-caps --pid -- echo hello world` fails with the same error described in this issue.

`qemu: qemu_thread_create: Invalid argument`

According to `man unshare`, --keep-caps seems to apply only to user namespace.

I think you should investigate

`qemu: qemu_thread_create: Invalid argument`

The same issue persists in qemu-5.2.0.

-----------------------------------------
# qemu-aarch64 --version
qemu-aarch64 version 5.2.0
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
-----------------------------------------

Symptoms when running inside the aarch64 chroot, with both aarch64 and x86_64 binaries:
-----------------------------------------
# which unshare bash
/usr/bin/unshare
/bin/bash
# file $(!!)
file $(which unshare bash)
/usr/bin/unshare: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, stripped
/bin/bash:        ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, stripped
# unshare --pid -- bash -c 'echo hello world'
qemu: qemu_thread_create: Invalid argument
Aborted (core dumped)
# # --- switch to an x86_64 shell _inside_ the chroot
# LD_LIBRARY_PATH=/x86_64/lib64 PATH=/x86_64/bin:$PATH bash 
# which unshare bash
/x86_64/bin/unshare
/x86_64/bin/bash
# file $(!!)
file $(which unshare bash)
/x86_64/bin/unshare: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
/x86_64/bin/bash:    ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
# unshare --pid -- bash -c 'echo hello world' 
hello world
# 
-----------------------------------------

I can share the core dump, in case that's useful.

On this system, the qemu-aarch64 binary on the host is statically built
and binfmt_misc is configured as follows:
-----------------------------------------
:aarch64:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64:CF
-----------------------------------------


This is an automated cleanup. This bug report has been moved to QEMU's
new bug tracker on gitlab.com and thus gets marked as 'expired' now.
Please continue with the discussion here:

 https://gitlab.com/qemu-project/qemu/-/issues/172