-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 (core dumped) on FreeBSD ARM64 #37345
Comments
Can you run the program under gdb to find out exactly what the illegal instruction is? |
See also #35851 ( |
@ianlancetaylor when running in gdb here is the output.
|
Thanks. Please use |
Ok I think this is what you're looking for.
Sorry my first time using gdb. |
Thanks. Does anybody know why that instruction would trigger an illegal instruction interrupt? As far as I can tell it should be supported on any ARMv8 processor. Is it a privileged instruction? |
Reading the manual, it looks to me the register id_aa64isar0_el1 is privileged. It seems accessing the register in user mode is "UNDEFINED". Maybe @zhangfannie can confirm. |
yes, id_aa64isar0_el1 is privileged. The FreeBSD kernel traps the exception and returns correct values to userland (at least on "recent" version of FreeBSD, I think it appears in FreeBSD 12.0, not sure it works in 11.x) |
Yes, it appears in 12.0. 12.0 also introduced the 64-bit-inodes ABI, and IIRC go uses it, not the legacy one. So forget about 11.x and older. |
@cherrymui yes, id_aa64isar0_el1 is not accessible in user mode. |
could the 'features' of /proc/cpuinfo be shared? Thanks. |
What's /proc/cpuinfo? |
|
Thanks a lot, I've no idea of the difference. Out of curiosity, does FreeBSD kernel have the same feature of 'mrs emulation' as linux's, a similar issue could be reproduced on an arm64 machine with linux kernel before 4.10 where the feature is not present, a higher version works fine. |
@shawn-xdji yes! @MikaelUrankar mentioned this above!!! This is why the register is read.
And for FreeBSD that version is 12.0. Which as I already mentioned is the minimum version for other reasons too. |
@artooro What version of FreeBSD are you using? |
Would somebody who understands the details like to update https://golang.org/wiki/MinimumRequirements? Thanks. |
Change https://golang.org/cl/220426 mentions this issue: |
Change https://golang.org/cl/220427 mentions this issue: |
Updates #24715 Updates #37345 Change-Id: I787a9b2ab1c68e1d379aac0a31bdf6217f04f911 Reviewed-on: https://go-review.googlesource.com/c/go/+/220426 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
…res FreeBSD 12.0 or later Updates #24715 Updates #37345 Change-Id: I787a9b2ab1c68e1d379aac0a31bdf6217f04f911 Reviewed-on: https://go-review.googlesource.com/c/go/+/220426 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> (cherry picked from commit 28c501b) Reviewed-on: https://go-review.googlesource.com/c/go/+/220427
@ianlancetaylor yeah I'm using 11.3 so yeah if it requires FreeBSD 12.0+ that would explain things. |
Given that the originally reported problem occurs on FreeBSD 11.3 and we now explicitly document that |
What version of Go are you using? 1.14rc1
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
This can be reproduced by a very basic program, for example:
Compile with the following environment variables.
Tried to run it on a Marvell Armada 3720LP (88F3720) dual core ARM Cortex A53.
What did you expect to see?
For the program to print "Hello World"
What did you see instead?
I get the following output:
Illegal instruction (core dumped)
Here is the core dump file of that test program.
testfreebsdarm64.core.zip
The text was updated successfully, but these errors were encountered: