From owner-freebsd-current@FreeBSD.ORG Wed Feb 8 04:15:12 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 12A1C16A420; Wed, 8 Feb 2006 04:15:12 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 618E843D48; Wed, 8 Feb 2006 04:15:10 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k184F3br011948; Wed, 8 Feb 2006 15:15:06 +1100 Received: from [61.8.38.184] (ppp26B8.dyn.pacific.net.au [61.8.38.184]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k184F1nH004185; Wed, 8 Feb 2006 15:15:02 +1100 In-Reply-To: <31986988-9FB7-4EFC-986B-50DB99934E32@freebsd.org> References: <3458D5B9-860C-4185-9359-1F48FC35B048@brooknet.com.au> <31986988-9FB7-4EFC-986B-50DB99934E32@freebsd.org> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Sam Lawrance Date: Wed, 8 Feb 2006 15:15:02 +1100 To: Jason Evans X-Mailer: Apple Mail (2.746.2) Cc: davidxu@freebsd.org, current@freebsd.org, Kris Kennaway Subject: Re: Which signal occurs due to a page protection violation? 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: Wed, 08 Feb 2006 04:15:12 -0000 [ moved to -current ] On 01/02/2006, at 6:41 AM, Jason Evans wrote: > On Jan 31, 2006, at 1:06 AM, Sam Lawrance wrote: >> ElectricFence is failing during its self test on i386 7-current: >> >> Testing Electric Fence. >> After the last test, it should print that the test has PASSED. >> EF_PROTECT_BELOW= && EF_PROTECT_FREE= && EF_ALIGNMENT= && ./eftest >> Segmentation fault (core dumped) >> *** Error code 139 >> >> The program intentionally overruns and underruns buffers in order >> to test the functionality of ElectricFence. >> I think it's failing because: >> 1) the new jemalloc is actually catching the problem and throwing >> SIGSEGV >> 2) ElectricFence is being compiled with - >> DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS on that platform. > > I'm not sure about this, but I think the change of which signal > occurs is unrelated to jemalloc. I think Kris Kennaway at one > point told me that jemalloc broke the efence port, but then later > retracted that claim when efence also failed on a machine that was > still using phkmalloc. This may be due to a signal delivery bugfix > that someone put in, probably in early December 2005. You are right. The change below delivers SIGSEGV instead of SIGBUS (also on amd64). http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/i386/trap.c? annotate=1.282 http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/amd64/amd64/trap.c.diff? r1=1.294&r2=1.295&f=h David, was this an intentional change? It broke ElectricFence, which depended on the old behaviour. The 4.x, 5.x, and 6.x package builds are hosted on machines running -current, so ElectricFence self tests will fail in that environment. I haven't seen any other fallout from this change. However, binaries depending on the old behaviour may have issues with backward compatibility.