multiarch / qemu-user-static

:earth_africa: `/usr/bin/qemu-*-static`
https://hub.docker.com/r/multiarch/qemu-user-static/
MIT License
2.48k stars 230 forks source link

ppc64le Unknown privilege violation qemu fatal Tried to call a TRAP #128

Open Mengkzhaoyun opened 3 years ago

Mengkzhaoyun commented 3 years ago

Is this a bug report, feature (enhancement) request or question? (leave only one on its own line)

/kind bug

Description:

Steps to reproduce the issue:

  1. run guest(ppc64le) bazel build on host(x86)

  2. Unknown privilege violation

  3. qemu fatal Tried to call a TRAP

Describe the results you received:

the bazel build crash and exit

Describe the results you expected:

bazel build run success

Environment:

Output of docker version, podman version or singularity version

Client: Docker Engine - Community
 Cloud integration: 1.0.2
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:02:36 2020
 OS/Arch:           linux/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Additional information optionally:

When i build ppc64le envoyproxy/envoy on my x86 hosts , the bazel run error with qemu , if the is a solution to run like ppc64le bazel on my x86 host

here is the output with openjdk-8-jdk

root@aace7aa7190c:/source# ./ci/do_ci.sh bazel.release.server_only
No remote cache is set, skipping setup remote cache.
ENVOY_SRCDIR=/source
ENVOY_BUILD_TARGET=//source/exe:envoy-static
ENVOY_BUILD_ARCH=ppc64le
$TEST_TMPDIR defined: output root default is '/build/tmp' and max_idle_secs default is '15'.
Starting local Bazel server and connecting to it...
INFO: Reading 'startup' options from /source/.bazelrc: --host_jvm_args=-Xmx2g
Server crashed during startup. Now printing /build/tmp/_bazel_root/b570b5ccd0454dc9af9f65ab1833764d/server/jvm.out
Unknown privilege violation (03)
NIP 000000400b0f32b0   LR 0000004002813634 CTR 000000400b0f3280 XER 0000000000000000 CPU#1
MSR 9000000102806901 HID0 0000000000000000  HF 9000000002806001 iidx 6 didx 6
TB 00013542 58165702496664
GPR00 ffffffbffd097fa0 0000004002f67e70 0000004002917e00 0000004002f69060
GPR04 0000000000000000 0000000000002000 0000000000000010 0000000000000001
GPR08 0000000000000030 0000000000000001 0000004002967e00 0000000000000000
GPR12 000000400b0f3280 0000004002f728e0 0000000000000000 0000004002d6b000
GPR16 0000004001872000 0000004001b7c410 0000004001b7c420 0000004002f69060
GPR20 000000400b0f32c0 000000400b0f32c8 00000000000003d8 000000400400c7c0
GPR24 000000400400cb98 0000004002941400 0000004002f67ed0 000000400400c7b0
GPR28 000000400400c770 000000400b0f3280 0000004002969120 0000004002f67e70
CR 24004400  [ E  G  -  -  G  G  -  -  ]             RES ffffffffffffffff
qemu: fatal: Tried to call a TRAP

NIP 000000400b18c830   LR 000000400b0fc648 CTR 000000400b18c810 XER 0000000000000000 CPU#1
MSR 9000000102806901 HID0 0000000000000000  HF 9000000002806001 iidx 6 didx 6
TB 00013545 58175392763197
GPR00 0000004002f68290 0000004002f68180 0000004002917e00 00000000d61a46b8
GPR04 000000400b0fc648 0000000020000001 00000000d61a46b8 0000000000000001
GPR08 000000400b01a000 0000000000000000 0000000000000000 000000400b0f3280
GPR12 000000400b18c810 0000004002f728e0 00000000d61a46d0 0000000000000012
GPR16 000000400400c000 00000000d61a46b8 0000000000000012 0000004061552bb8
GPR20 000000400b0fc648 0000004002f681c0 000000000000002c 0000000044000001
GPR24 000000400b118e80 0000004002959d30 0000004002f68230 00000040615549f0
GPR28 0000000000000000 000000400b0f3000 0000000000000000 0000004061552bb8
CR 28f44242  [ E  L  LO G  G  E  G  E  ]             RES ffffffffffffffff
FPR00 0000000000000000 006100760061006a 0062004f002e0067 3fc7466496cb03de
FPR04 3fcc71c51d8e78af 3fd2492494229359 3fd999999997fa04 3fe5555555555593
FPR08 3f6c5894d10d4986 0000000000000000 0000000000000000 0000000000000000
FPR12 00000001170a3c74 0001000000000000 0000000000000000 0000000000000018
FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPSCR 000000008a024000
$TEST_TMPDIR defined: output root default is '/build/tmp' and max_idle_secs default is '15'.
Starting local Bazel server and connecting to it...
INFO: Reading 'startup' options from /source/.bazelrc: --host_jvm_args=-Xmx2g
Server crashed during startup. Now printing /build/tmp/_bazel_root/b570b5ccd0454dc9af9f65ab1833764d/server/jvm.out
Unknown privilege violation (03)
NIP 000000400b0f32b0   LR 0000004002813634 CTR 000000400b0f3280 XER 0000000000000000 CPU#1
MSR 9000000102806901 HID0 0000000000000000  HF 9000000002806001 iidx 6 didx 6
TB 00013545 58178420492645
GPR00 ffffffbffd097fa0 0000004002f67e70 0000004002917e00 0000004002f69060
GPR04 0000000000000000 0000000000002000 0000000000000010 0000000000000001
GPR08 0000000000000030 0000000000000001 0000004002967e00 0000000000000000
GPR12 000000400b0f3280 0000004002f728e0 0000000000000000 0000004002d6b000
GPR16 0000004001872000 0000004001b7c410 0000004001b7c420 0000004002f69060
GPR20 000000400b0f32c0 000000400b0f32c8 00000000000003d8 000000400400c7c0
GPR24 000000400400cb98 0000004002941400 0000004002f67ed0 000000400400c7b0
GPR28 000000400400c770 000000400b0f3280 0000004002969120 0000004002f67e70
CR 24004400  [ E  G  -  -  G  G  -  -  ]             RES ffffffffffffffff
qemu: fatal: Tried to call a TRAP

NIP 000000400b18b7b0   LR 000000400b0fc648 CTR 000000400b18b790 XER 0000000000000000 CPU#1
MSR 9000000102806901 HID0 0000000000000000  HF 9000000002806001 iidx 6 didx 6
TB 00013548 58189763461791
GPR00 0000004002f68290 0000004002f68180 0000004002917e00 00000000d61a46b8
GPR04 000000400b0fc648 0000000020000001 00000000d61a46b8 0000000000000001
GPR08 000000400b01a000 0000000000000000 0000000000000000 000000400b0f3280
GPR12 000000400b18b790 0000004002f728e0 00000000d61a46d0 0000000000000012
GPR16 000000400400c000 00000000d61a46b8 0000000000000012 0000004061552bb8
GPR20 000000400b0fc648 0000004002f681c0 000000000000002c 0000000044000001
GPR24 000000400b118e80 0000004002959d30 0000004002f68230 00000040615549f0
GPR28 0000000000000000 000000400b0f3000 0000000000000000 0000004061552bb8
CR 28a44242  [ E  L  L  G  G  E  G  E  ]             RES ffffffffffffffff
FPR00 0000000000000000 006100760061006a 0062004f002e0067 3fc7466496cb03de
FPR04 3fcc71c51d8e78af 3fd2492494229359 3fd999999997fa04 3fe5555555555593
FPR08 3f6c5894d10d4986 0000000000000000 0000000000000000 0000000000000000
FPR12 000000014536c900 0001000000000000 0000000000000000 0000000000000018
FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPSCR 000000008a024000
Skip setting up Envoy Filter Example.
building using 8 CPUs
building for ppc64le
clang toolchain with libc++ configured
bazel release build...
Building...
$TEST_TMPDIR defined: output root default is '/build/tmp' and max_idle_secs default is '15'.
Starting local Bazel server and connecting to it...
INFO: Reading 'startup' options from /source/.bazelrc: --host_jvm_args=-Xmx2g
Server crashed during startup. Now printing /build/tmp/_bazel_root/b570b5ccd0454dc9af9f65ab1833764d/server/jvm.out
Unknown privilege violation (03)
NIP 000000400b0f32b0   LR 0000004002813634 CTR 000000400b0f3280 XER 0000000000000000 CPU#1
MSR 9000000102806901 HID0 0000000000000000  HF 9000000002806001 iidx 6 didx 6
TB 00013548 58191921019751
GPR00 ffffffbffd097fa0 0000004002f67e70 0000004002917e00 0000004002f69060
GPR04 0000000000000000 0000000000002000 0000000000000010 0000000000000001
GPR08 0000000000000030 0000000000000001 0000004002967e00 0000000000000000
GPR12 000000400b0f3280 0000004002f728e0 0000000000000000 0000004002d6b000
GPR16 0000004001872000 0000004001b7c410 0000004001b7c420 0000004002f69060
GPR20 000000400b0f32c0 000000400b0f32c8 00000000000003d8 000000400400c7c0
GPR24 000000400400cb98 0000004002941400 0000004002f67ed0 000000400400c7b0
GPR28 000000400400c770 000000400b0f3280 0000004002969120 0000004002f67e70
CR 24004400  [ E  G  -  -  G  G  -  -  ]             RES ffffffffffffffff
qemu: fatal: Tried to call a TRAP

NIP 000000400b18b5b0   LR 000000400b0fc648 CTR 000000400b18b590 XER 0000000000000000 CPU#1
MSR 9000000102806901 HID0 0000000000000000  HF 9000000002806001 iidx 6 didx 6
TB 00013551 58201279750038
GPR00 0000004002f68290 0000004002f68180 0000004002917e00 00000000d61a46b8
GPR04 000000400b0fc648 0000000020000001 00000000d61a46b8 0000000000000001
GPR08 000000400b01a000 0000000000000000 0000000000000000 000000400b0f3280
GPR12 000000400b18b590 0000004002f728e0 00000000d61a46d0 0000000000000012
GPR16 000000400400c000 00000000d61a46b8 0000000000000012 0000004061552bb8
GPR20 000000400b0fc648 0000004002f681c0 000000000000002c 0000000044000001
GPR24 000000400b118e80 0000004002959d30 0000004002f68230 00000040615549f0
GPR28 0000000000000000 000000400b0f3000 0000000000000000 0000004061552bb8
CR 28944242  [ E  L  LO G  G  E  G  E  ]             RES ffffffffffffffff
FPR00 0000000000000000 006100760061006a 0062004f002e0067 3fc7466496cb03de
FPR04 3fcc71c51d8e78af 3fd2492494229359 3fd999999997fa04 3fe5555555555593
FPR08 3f6c5894d10d4986 0000000000000000 0000000000000000 0000000000000000
FPR12 000000010ecb72bc 0001000000000000 0000000000000000 0000000000000018
FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPSCR 000000008a024000
Mengkzhaoyun commented 3 years ago

when run java version command on openjdk8~11 or other version, target ppc64le , host x86 the same error

root@a2b31c62907c:/# uname -ar
Linux a2b31c62907c 5.10.2-051002-generic #202012210832 SMP Mon Dec 21 13:52:42 UTC 2020 ppc64le GNU/Linux
root@a2b31c62907c:/# /proc/self/exe --version
qemu-ppc64le version 5.2.0 (Debian 1:5.2+dfsg-2)
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
root@a2b31c62907c:/# java version
Unknown privilege violation (03)
NIP 000000401290e2b0   LR 0000004002921660 CTR 000000401290e280 XER 0000000000000000 CPU#1
MSR 9000000102806901 HID0 0000000000000000  HF 9000000002806001 iidx 6 didx 6
TB 00003571 15338721232049
GPR00 ffffffbffd030630 0000004002fcf970 0000004002a63e00 0000004002fd09d0
GPR04 0000000000000000 0000000000002000 0000000000000000 0000000000000000
GPR08 0000000000000000 0000000000000001 0000000000000080 0000000000000000
GPR12 000000401290e280 0000004002fda900 0000000000000000 0000004002dd4000
GPR16 0000004002fd3260 00000040018d1390 0000004001862000 000000401290e2cc
GPR20 000000401290e2d4 0000004002a94ab0 00000000000003d8 0000004004011920
GPR24 0000004004011cf8 0000004002fd19d0 0000004004011910 000000400400e840
GPR28 0000004002ac3ad0 000000401290e280 0000004002ac4c60 0000004002fcf970
CR 24004400  [ E  G  -  -  G  G  -  -  ]             RES 0000004002fd09d0
qemu: fatal: Tried to call a TRAP

NIP 0000004012ea7188   LR 0000004012915b90 CTR 0000004012ea708c XER 0000000000000000 CPU#1
MSR 9000000102806901 HID0 0000000000000000  HF 9000000002806001 iidx 6 didx 6
TB 00003572 15342199401352
GPR00 0000000000000000 0000004002fcfe90 000000000000000b 000000000000000b
GPR04 0000004090cfffd8 0000000000000e3b 0000000000000031 0000000000000005
GPR08 0000004090ae1638 0000000000000000 0000000000000000 0000004002fbfe90
GPR12 0000000000000008 0000004002fda900 0000004090ae1676 0000004002fcfef0
GPR16 0000004004011000 00000000c51e3df8 0000004002fcffd0 0000004090ae01e0
GPR20 0000004012915b90 0000004002fcfe90 0000004012915b90 0000000044400001
GPR24 0000004012935d80 0000004002aa7730 0000004002fcff08 0000004090bdbc00
GPR28 0000000000000000 000000401290e000 0000000000000038 0000004012915b90
CR 42002482  [ G  E  -  -  E  G  L  E  ]             RES ffffffffffffffff
FPR00 0000004002fd0140 3ff0000000000000 0000000000000000 00000040bc00c150
FPR04 0000000000000000 000000000000006c 646a207373616c63 2f6373696d2f6c61
FPR08 0000004090b16208 0000004004011910 000000400400e840 0000004002fd0140
FPR12 0000004012913e90 0000000000000064 0000000000000000 00000000000000c0
FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPSCR 000000008a002000
Aborted (core dumped)
maqeel75 commented 3 years ago

Any update about this issue? We are facing same issue.

thesamesam commented 2 years ago

Found https://gitlab.com/qemu-project/qemu/-/issues/588 which has a patch.

roy20021 commented 1 year ago

Hello, any updates on this? Overall Java-based software is out of the game on ppc64le platform due of this bug.

timja commented 1 year ago

Hello, any updates on this? Overall Java-based software is out of the game on ppc64le platform due of this bug.

The patch for https://gitlab.com/qemu-project/qemu/-/issues/588 fixed my issue.

I would suggest reporting it directly to qemu on GitLab as you may be having a different issue.

roy20021 commented 1 year ago

@timja You are right, that patch fixes the issue. Thank you for your prompt support. Tha patch is available since qemu 7.0.0 and at my hosts (Windows host wsl2, Docker Desktop 4.19.0 or Ubuntu 20.04 Docker version 23.0.4) is not available. By upgrading it explicitly it works.

In this case, should this ticket be closed?