From owner-freebsd-current@FreeBSD.ORG Thu Jun 16 00:49:45 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F65D106567F for ; Thu, 16 Jun 2011 00:49:45 +0000 (UTC) (envelope-from eric@shadowsun.net) Received: from mail.atlantawebhost.com (dns1.atlantawebhost.com [66.223.40.39]) by mx1.freebsd.org (Postfix) with ESMTP id 441218FC0A for ; Thu, 16 Jun 2011 00:49:44 +0000 (UTC) Received: (qmail 26168 invoked from network); 15 Jun 2011 20:49:44 -0400 Received: from ool-6039c07a.static.optonline.net (HELO Macintosh-21.local) (96.57.192.122) by mail.atlantawebhost.com with SMTP; 15 Jun 2011 20:49:44 -0400 Message-ID: <4DF95328.1060209@shadowsun.net> Date: Wed, 15 Jun 2011 20:49:44 -0400 From: Eric McCorkle User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <814C9E9472FDCC40AAC3FC95A2D67E3B0BD8F752@msx3.exchange.alogis.com> <4DF8C0AE.4090501@shadowsun.net> <20110615145847.GN48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110615145847.GN48734@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: problems with cvsup on FreeBSD 9 snapshot 201101 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 00:49:45 -0000 On 6/15/11 10:58 AM, Kostik Belousov wrote: > On Wed, Jun 15, 2011 at 10:24:46AM -0400, Eric McCorkle wrote: >> On 6/15/11 8:23 AM, Holger Kipp wrote: >>> Dear all, >>> >>> I had installed FreeBSD 9 amd64 from snapshot (ISO-image) located here: >>> ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201101/FreeBSD-9.0-CURRENT-201101-amd64-dvd1.iso >>> >>> >>> Today I wanted to cvsup to a later date to upgrade to ZFS v28 >>> and compiled port /usr/ports/net/cvsup-without-gui without problems. >>> >>> Starting freshly compiled cvsup then gives me >>> >>> "Illegal Instruction" >>> >>> This error seems to be identical to >>> http://lists.freebsd.org/pipermail/freebsd-current/2010-September/020083.html >>> >> >> I've gotten the same problem, and managed to diagnose it. The problem >> actually isn't an illegal instruction, but a stack misalignment. If you >> load it in gdb, it will die with SIGSEGV somewhere in libc.so.7, on a >> callq instruction. This is because callq needs the stack to be 16-byte >> aligned, and it's not for some reason. > Stack alignment requirement is an ABI convention, and it is not enforced > by CPU, except several special cases. In particular, either EFLAGS.AC > bit should be set, that usually is not, or SSE instruction explicitely > disallowing non-aligned access executed. Anyway, you will not get > Illegal instruction fault for unaligned access. I took a closer look this afternoon, and you're right. callq with an unaligned stack pointer does *not* cause a fault. If anyone does a movaps, however, you will get a fault (SIGBUS, I believe), and if the ABI says stacks are 16-byte aligned, then libraries may assume it's safe to load from the stack with movaps, and you'll get a fault. This is what happened to mlton on Mac OS, so I thought it might be something similar going on here. Anyways, I'll look into it more.