Bug 1045384

Summary: chroot - Illegal instruction
Product: [Fedora] Fedora Reporter: František Dvořák <valtri>
Component: qemuAssignee: Fedora Virtualization Maintainers <virt-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: admiller, amit.shah, berrange, cfergeau, dan, dwmw2, itamar, karsten, kdudka, kzak, ooprala, ovasik, pbonzini, p, rjones, scottt.tw, twaugh, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-23 11:36:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description František Dvořák 2013-12-20 10:03:26 UTC
Description of problem:

Doing 'chroot /mnt/sysimage' in rescue mode under qemu-system-ppc64 leads to "Illegal instruction" error.


Version-Release number of selected component (if applicable):

chroot (GNU coreutils) 8.21

Linux version 3.11.10-301.fc20.ppc64


How reproducible:
Always.


Steps to Reproduce:
1. boot in qemu-system-ppc64 using installation DVD

qemu-system-ppc64 -m 2048 -net nic -net user,net=192.168.167.0/24 -hdb swap.img root.img -cdrom Fedora-20-ppc64-DVD.iso

2. try "chroot /mnt/sysimage"

Actual results:

Illegal instruction


Expected results:


Additional info:

Running 'strace chroot /mnt/sysimage' ends with:

chroot("/mnt/sysimage") = 0
chdir("/") = 0
execve("/bin/bash", ["/bin/bash", "-i"], [/* 19 vars */]) = 0
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x1ffffffb7bc4}
+++ killed by SIGILL +++
Illegal instruction

Comment 1 Ondrej Vasik 2013-12-22 23:44:48 UTC
Adding Karsten/Dan to cc, as they take care of secondary arches. Any idea? I don't see anything strange in code - just execvp() and then exit.

Comment 2 Dan Horák 2013-12-23 08:12:44 UTC
What's on the root.img? It sounds like either a QEMU bug (or rather being incomplete with ppc64 emulation) or the bash from the root.img isn't a ppc64 binary.

Comment 3 Richard W.M. Jones 2013-12-23 08:31:57 UTC
Could be VSX?  (bug 887978)

Note that upstream qemu has seen patches posted to add VSX support
earlier this month.  Not sure if they went upstream yet or not.

Comment 4 František Dvořák 2013-12-23 14:56:59 UTC
1) content on the root.img:

/tmp/mnt/usr/bin/bash: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0x26685a161df8985d7281ced4e89d323ce73be86c, stripped

2) 'objdump -d' shows lxvd2x and stxvd2x instructions in libc.so.6 and ld64.so.1 libraries (not sure if it is VSX?).

Tested on qemu 1.6.1 and Fedora's qemu 1.7.0-1, SIGILL is returned in both.

Comment 5 Karsten Hopp 2014-01-07 14:53:53 UTC
Does it work when you add the parameters '-cpu POWER7 -machine pseries' ?

Comment 6 František Dvořák 2014-01-11 02:23:43 UTC
It is the same with -cpu/-machine arguments.


I've tried also following commands in rescue shell:

/bin/bash
# -> OK

/mnt/sysimage/bin/bash
# -> OK

LD_LIBRARY_PATH=/mnt/sysimage/lib64 /mnt/sysimage/bin/bash
# -> Illegal instruction


(some libraries between /lib64 and /mnt/sysimage/lib64 differs, but the bash binaries are identical)

Comment 7 Paolo Bonzini 2014-01-23 11:36:08 UTC

*** This bug has been marked as a duplicate of bug 1002077 ***