Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: illegal instruction on s390x #16637

Closed
malinindmitry opened this issue Aug 8, 2016 · 5 comments
Closed

cmd/compile: illegal instruction on s390x #16637

malinindmitry opened this issue Aug 8, 2016 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@malinindmitry
Copy link

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
go version go1.7rc5 linux/amd64
  1. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/root/s390x_1.7rc5/go"
GOTOOLDIR="/root/s390x_1.7rc5/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build390085214=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
  1. What did you do?
export GOROOT=/root/s390x_1.7rc5/go
export GOROOT_BOOTSTRAP=/root/s390x_1.7rc5/go
GOOS=linux GOARCH=s390x ./bootstrap.bash

copy go-linux-s390x-bootstrap.tbz to the s390x server:

linux02:~/s390x_1.7rc5/go-linux-s390x-bootstrap/bin # uname -a
Linux linux02 3.0.101-0.47.71-default #1 SMP Thu Nov 12 12:22:22 UTC 2015 (b5b212e) s390x s390x s390x GNU/Linux
linux02:~/s390x_1.7rc5/go-linux-s390x-bootstrap/bin # lscpu
Architecture:          s390x
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Big Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s) per book:    1
Book(s):               2
Vendor ID:             IBM/S390
BogoMIPS:              3246.00
Hypervisor:            z/VM 6.3.0
Hypervisor vendor:     IBM
Virtualization type:   full
Dispatching mode:      horizontal

extract archive and run go.

  1. What did you expect to see?
Runnable go binary file.
  1. What did you see instead?
linux02:~/s390x_1.7rc5/go-linux-s390x-bootstrap/bin # ./go
Illegal instruction

or with gdb:

linux02:~/s390x_1.7rc5/go-linux-s390x-bootstrap/bin # gdb ./go
GNU gdb (GDB) SUSE (7.5.1-0.7.29)
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "s390x-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/s390x_1.7rc5/go-linux-s390x-bootstrap/bin/go...done.
warning: File "/root/s390x_1.7rc5/go-linux-s390x-bootstrap/src/runtime/runtime-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
    add-auto-load-safe-path /root/s390x_1.7rc5/go-linux-s390x-bootstrap/src/runtime/runtime-gdb.py
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
    set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
    info "(gdb)Auto-loading safe path"
(gdb) run
Starting program: /root/s390x_1.7rc5/go-linux-s390x-bootstrap/bin/go 

Program received signal SIGILL, Illegal instruction.
_rt0_s390x_linux () at /root/s390x_1.7rc5/go-linux-s390x-bootstrap/src/runtime/rt0_linux_s390x.s:16
16      BR main(SB)
(gdb)
@bradfitz
Copy link
Contributor

bradfitz commented Aug 8, 2016

/cc @billotosyr

@bradfitz bradfitz changed the title Illegal instruction with go on the s390x cmd/compile: illegal instruction on s390x Aug 8, 2016
@bradfitz bradfitz added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 8, 2016
@mundaym
Copy link
Member

mundaym commented Aug 8, 2016

Sorry, the minimum machine Go supports is currently the z196. It looks like you're running an older machine although I'm not sure the exact model. cat /proc/cpuinfo should give me the information I need.

It's too late to change this for 1.7. If the machine were a z10 then it may be possible to create a patch to remove uses of the newer instructions. Anything earlier than z10 is a very big task because they don't have the load-relative-long family of instructions (e.g. LARL). The Go compiler makes heavy use of these instructions.

@malinindmitry
Copy link
Author

linux02:~ # cat /proc/cpuinfo 
vendor_id       : IBM/S390
# processors    : 2
bogomips per cpu: 3246.00
features    : esan3 zarch stfle msa ldisp eimm dfp etf3eh highgprs 
processor 0: version = FF,  identification = 0D57CE,  machine = 2098
processor 1: version = FF,  identification = 0D57CE,  machine = 2098

@quentinmit quentinmit added this to the Go1.8Maybe milestone Aug 8, 2016
@quentinmit
Copy link
Contributor

It looks like machine "2098" = a z10. I'll tag this for Go 1.8.

@mundaym
Copy link
Member

mundaym commented Aug 9, 2016

Thanks Quentin. I don't currently plan to add z10 support.

@malinindmitry I'm not sure what your use case is but if you want access to a newer machine you could try taking a look at the LinuxONE community cloud.

@golang golang locked and limited conversation to collaborators Aug 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants