Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 May 2014 02:34:44 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Peter Wemm <peter@wemm.org>
Cc:        freebsd-amd64@freebsd.org
Subject:   Re: i386 Go programs crash on amd64
Message-ID:  <20140523233444.GH74331@kib.kiev.ua>
In-Reply-To: <537FD9A2.2010607@wemm.org>
References:  <20140523225300.GA14433@server.rulingia.com> <537FD853.3000505@wemm.org> <537FD9A2.2010607@wemm.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--kIMHD3Fq2o6qJDUb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, May 23, 2014 at 04:28:34PM -0700, Peter Wemm wrote:
> On 5/23/14, 4:22 PM, Peter Wemm wrote:
> > 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?
Provide the minimal test case.

> >>
> > We don't emulate i386_set_ldt().
> >
> > The 32 bit version of libc on amd64 has a different implementation=20
> > that calls sysarch(I386_SET_FSBASE, ..) and friends.  Normally this is=
=20
> > handled transparently by static linking, but obviously that's an issue=
=20
> > for Go.
>=20
> Actually, that's an even more interesting question. WHY are they using=20
> i386_set_ldt()?  Where is it coming from? As near as I can tell, libc,=20
> libthr etc call I386_SET_GSBASE for tls.

We do support ldt for 32bit binaries on amd64.

--kIMHD3Fq2o6qJDUb
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQIcBAEBAgAGBQJTf9sTAAoJEJDCuSvBvK1BNIcQAJJsgBhDGijLSmX7bcBSs51d
xG7xOUGIDwT4dnzzJODV/FIpy/TrSL3J430hZugIqcU/ebby+fJJG9fwEhz8np3V
sM6WK5gqeQtHpiZ2SbJLXbiKA6Hj5wXgTOqLpLnqz8C3ym5JTqole4NyRa8y/7iS
Qjy1jZgEOS5UIJN1JKtjKiFpeqrU7ZqfQmG667yOKE0WxedfMPETGbLToUGTz6B2
7tI56uG1hakvbU1PChWFz1Y6DBv5/5Zb472p47jtr/7wG9n/A9Wj1UWMfPeH2K5G
GYbXwvqLcsX466XEsFYl7NvujfxK5gz48C3iAmnMYK9q9/fIvuZMqvcHIbX/Qsm0
IGKLLUYlcTSjqgR7TYgqA2iSObKsKfSaBDGRPywl71qcCjxn87KwvaTxqg6nZUl5
THrsA0rAQ9VzifZAI8TrsSINZQteLyVKNcTilB5RhoVGezsIwll1YWMh/5CI1D8p
YI7p1VrFee3DU+Xgd2xtWPY2EwYKaFKmjQfRCa6Rlv80cVJSROW55YTlOXfAskBQ
i92PS20Fn5Rp5+4IjnCod7vilPX6BBuMZfaFd3BUvRy6hkT6l204AA5tGFdKMbQf
8QKvVTxK0h0cExYNviCqFbBvnoqrIKX+Y8ThtCSHfu0nBBjfGBfbOY4L7HUTB6gg
Yhg0AMxsOzZdDAaDHQuZ
=U0QP
-----END PGP SIGNATURE-----

--kIMHD3Fq2o6qJDUb--



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