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

runtime: Crash in golang 1.4.2 on HardenedBSD 11-CURRENT/amd64 w/o COMPAT_FREEBSD32 #12123

Closed
lattera opened this issue Aug 12, 2015 · 11 comments
Milestone

Comments

@lattera
Copy link

lattera commented Aug 12, 2015

Go is broken on HardenedBSD currently. It appears to be from the hand-written assembly code in src/runtime/sys_freebsd_amd64.s. The bug can be triggered simply by attempting to compile go on HardenedBSD 11-CURRENT/amd64.

uname -a:

laptop-dev-01[shawn]:/home/shawn/tmp/go (1) $ uname -a
FreeBSD laptop-dev-01 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD #44 264a80e(hardened/current/master): Wed Aug 12 16:42:41 EDT 2015     shawn@laptop-dev-01:/usr/obj/usr/src/sys/LATT-SEC  amd64

gdb backtrace:

laptop-dev-01[shawn]:/usr/ports/lang/go $ sudo gdb ./work/go/pkg/tool/freebsd_amd64/go_bootstrap
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) run
Starting program: /usr/ports/lang/go/work/go/pkg/tool/freebsd_amd64/go_bootstrap 

Program received signal SIGBUS, Bus error.
0x00000000004a4da0 in runtime.settls () at /usr/local/go/src/runtime/sys_freebsd_amd64.s:286
286     /usr/local/go/src/runtime/sys_freebsd_amd64.s: No such file or directory.
        in /usr/local/go/src/runtime/sys_freebsd_amd64.s
Current language:  auto; currently minimal
(gdb) bt
#0  0x00000000004a4da0 in runtime.settls () at /usr/local/go/src/runtime/sys_freebsd_amd64.s:286
#1  0x00000000008020b0 in runtime.tls0 ()
#2  0x000000000048ce3c in runtime.rt0_go () at /usr/local/go/src/runtime/asm_amd64.s:65
#3  0x0000000000000000 in ?? ()
@davecheney
Copy link
Contributor

@lattera can you please check if this is a regression from Go 1.4.2.

@lattera
Copy link
Author

lattera commented Aug 12, 2015

Sure. Which prior version of golang would you like me to test?

@davecheney
Copy link
Contributor

@lattera i'm really sorry, I thought this report was Go 1.5rc1 did not pass on your system. You can try 1.5rc1 if you like, but I suspect it won't pass either.

@lattera
Copy link
Author

lattera commented Aug 12, 2015

Gotcha. I tried with 1.4 and that didn't seem to work, either.

@lattera
Copy link
Author

lattera commented Aug 12, 2015

Nor did 1.3.2.

@lattera
Copy link
Author

lattera commented Aug 12, 2015

FWIW, vanilla FreeBSD 11-CURRENT/amd64 works fine. I wonder if it's because of our ASLR implementation.

@davecheney
Copy link
Contributor

Almost certainly. To this best of my knowledge nobody has reported running
Go on your BSD variant.

On Thu, 13 Aug 2015 08:11 Shawn Webb notifications@github.com wrote:

FWIW, vanilla FreeBSD 11-CURRENT/amd64 works fine. I wonder if it's
because of our ASLR implementation.


Reply to this email directly or view it on GitHub
#12123 (comment).

@lattera
Copy link
Author

lattera commented Aug 12, 2015

This provides some interesting insight: https://code.google.com/p/go/issues/detail?id=7056

@lattera
Copy link
Author

lattera commented Aug 12, 2015

Rebuilding kernel with COMPAT_FREEBSD32 and retesting. Will have results soon.

@davecheney
Copy link
Contributor

I believe that issue is fixed on 1.5,
#7813

Please try the 1.5rc1 release and see if it improves the situation.

Thanks

Dave

On Thu, 13 Aug 2015 08:14 Shawn Webb notifications@github.com wrote:

This provides some interesting insight:
https://code.google.com/p/go/issues/detail?id=7056


Reply to this email directly or view it on GitHub
#12123 (comment).

@lattera
Copy link
Author

lattera commented Aug 12, 2015

Confirmed. Adding COMPAT_FREEBSD32 to my kernel config solves this issue. Sorry for the duplicate bug and the line noise. I'm glad to see 1.5 will switch golang over to SYSCALL.

@lattera lattera closed this as completed Aug 12, 2015
@mikioh mikioh changed the title Crash in golang 1.4.2 on HardenedBSD 11-CURRENT/amd64 runtime: Crash in golang 1.4.2 on HardenedBSD 11-CURRENT/amd64 w/o COMPAT_FREEBSD32 Aug 13, 2015
@mikioh mikioh added this to the Go1.5 milestone Aug 13, 2015
@golang golang locked and limited conversation to collaborators Aug 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants