From owner-freebsd-amd64@FreeBSD.ORG Fri May 23 23:23:03 2014 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F7EF3F5 for ; Fri, 23 May 2014 23:23:03 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 454E42078 for ; Fri, 23 May 2014 23:23:03 +0000 (UTC) Received: from [172.16.21.76] (50-204-120-225-static.hfc.comcastbusiness.net [50.204.120.225]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) (Authenticated sender: peter) by smtp2.wemm.org (Postfix) with ESMTPSA id 34D5B2B4; Fri, 23 May 2014 16:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1400887382; bh=C2+EdP2ZzJ+85J9OCkNx9BgjGX13JFckoWzzA/Nmlyo=; h=Date:From:To:Subject:References:In-Reply-To; b=Whq2hIHEjN6GKkgnFehKu8npJE4HxHHs7WPL1fJ3KnI3m/m10u2JMGKVA8YFNEraP ZdHBV+joe1mA/KsDtkKurDqKuYbVNaMXk+1iWDewdddqjuG+ixMt9fZLjhrWpXWAGl WhQAWdUcvXUfK/ie6nrjbypFZK8EXMSO7ws/Uf7I= Message-ID: <537FD853.3000505@wemm.org> Date: Fri, 23 May 2014 16:22:59 -0700 From: Peter Wemm User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Peter Jeremy , freebsd-amd64@freebsd.org Subject: Re: i386 Go programs crash on amd64 References: <20140523225300.GA14433@server.rulingia.com> In-Reply-To: <20140523225300.GA14433@server.rulingia.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 23:23:03 -0000 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