Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2014 16:22:59 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Peter Jeremy <peter@rulingia.com>, freebsd-amd64@freebsd.org
Subject:   Re: i386 Go programs crash on amd64
Message-ID:  <537FD853.3000505@wemm.org>
In-Reply-To: <20140523225300.GA14433@server.rulingia.com>
References:  <20140523225300.GA14433@server.rulingia.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/23/14, 3:53 PM, Peter Jeremy wrote:
> I've been playing with Go (lang/go) and found that i386 Go binaries
> segfault when run on amd64 (9.x, 10.x or HEAD).  I've narrowed it down
> to the LDT handling but am not sure whether it's on the FreeBSD or Go
> side.
>
> As far as I can see, the i386 binary is correctly calling i386_set_ldt()
> and the i386_set_ldt() emulation in the amd64 kernel matches the i386
> kernel - but the net result doesn't work.
>
> Can anyone offer any suggestions as to how to resolve this?
>
We don't emulate i386_set_ldt().

The 32 bit version of libc on amd64 has a different implementation that 
calls sysarch(I386_SET_FSBASE, ..) and friends.  Normally this is 
handled transparently by static linking, but obviously that's an issue 
for Go.

-Peter




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?537FD853.3000505>