From owner-freebsd-amd64@FreeBSD.ORG Mon May 26 11:36:52 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 E5790EA for ; Mon, 26 May 2014 11:36:51 +0000 (UTC) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "vps.rulingia.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7738B28FA for ; Mon, 26 May 2014 11:36:50 +0000 (UTC) Received: from server.rulingia.com (c220-239-242-83.belrs5.nsw.optusnet.com.au [220.239.242.83]) by vps.rulingia.com (8.14.7/8.14.7) with ESMTP id s4QBaIk6090338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 26 May 2014 21:36:24 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.8/8.14.8) with ESMTP id s4QBaN1P073738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 26 May 2014 21:36:23 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.8/8.14.8/Submit) id s4QBaMVV073737; Mon, 26 May 2014 21:36:22 +1000 (EST) (envelope-from peter) Date: Mon, 26 May 2014 21:36:22 +1000 From: Peter Jeremy To: Konstantin Belousov Subject: Re: i386 Go programs crash on amd64 Message-ID: <20140526113622.GB96083@server.rulingia.com> References: <20140523225300.GA14433@server.rulingia.com> <537FD853.3000505@wemm.org> <537FD9A2.2010607@wemm.org> <20140523233444.GH74331@kib.kiev.ua> <20140524033944.GA96083@server.rulingia.com> <20140524074101.GI74331@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="UHN/qo2QbUvPLonB" Content-Disposition: inline In-Reply-To: <20140524074101.GI74331@kib.kiev.ua> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-amd64@freebsd.org 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: Mon, 26 May 2014 11:36:52 -0000 --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2014-May-24 10:41:01 +0300, Konstantin Belousov wr= ote: >> >Provide the minimal test case. >>=20 >> The following go program, compiled on i386 and run on amd64 will die >> with a segmentation violation or bus error: >> ------- >> package main >>=20 >> import "fmt" >>=20 >> func main() { >> fmt.Println("Hello World") >> } >> ------- >No, this is not consumable. > >I need a self-contained minimal example written in C/asm. Actually, I've found that -------- package main import "syscall" func main() { syscall.Write(1, []byte("Hello World\n")) } -------- also crashes ~66 syscalls after the first sysarch(2) call. That reduces the binary to 520K (go reports this is 50K lines of assembler). >If this is too hard to produce, give the the self-contained >binary, again as small as possible (small by comparing the >number of syscalls before the issue manifests itself). I've uploaded the source, binary and disassembly to freefall:~peterj/write{.go,,.S} (and verified it crashes). If I get time, I'll see if I can strip some of the support code out of Go to shrink it further. --=20 Peter Jeremy --UHN/qo2QbUvPLonB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQJ8BAEBCgBmBQJTgyc2XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIyN0Ux NkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs0nB4P/i3uwwBkS3mae1OJsp1ua7Sn gErRNOqC6ZsbEKjn+Z53etj+BxrtDxzBT3uQuL6XNoz//9e7ReyJVxpF5tvEbLR2 Ba4lAV3pBiB/CuxfZxygCHf4JG4kcjc7rm8WIhseEuLBK5vEKT4mii1xDoubPpvq mwEzjGtplsV7RHwFvwR5/EkthOPyFKTSWdMYxM5wQzgU05SNrvnfzaPBlrgIcT6Y Wb5lzR7FN/VnV7u8vtentu7GX6Iielkg4Ln0NSpmB4hebyhAxXgMxJF5HH/mliRk NHQIgafRvC24XX6eBkJkywsq6RHKiBZXB2czTrNYNJ5pU4xWkhOesQ0v/dHG4W9s d1s0pRLEJfyjdVMGPUjXASaotJkHR/JAERl2hxBcu2uDVKbCwYNkJ2rKc1bHtlsW kF62QsPT48q2NGsbsVzm+38mPdn/UIwiAsR7P7L4HA0lpBj2mkF1FyATpshx635k vrUn4A/x7KSJsvUmSojaysM79PxJKK6heUT/ViSXGvh3acDJ5xZErFwLHeW3D3NI g1JBYOVO01HgrgMeHxlk+ZV6MrHO041+sVN09zeKwqaR4Zu8vE4xypYvK1Blx6oA SeauDMIUpMVaNKbi8xwW6QQHVz2/Ox11hh90mORw7O1hGDQr0yuQFG9J/OJZAV6n XyfqFG89NvjlvSUwxW/D =3g2P -----END PGP SIGNATURE----- --UHN/qo2QbUvPLonB--