Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Feb 2006 15:15:02 +1100
From:      Sam Lawrance <boris@brooknet.com.au>
To:        Jason Evans <jasone@freebsd.org>
Cc:        davidxu@freebsd.org, current@freebsd.org, Kris Kennaway <kris@obsecurity.org>
Subject:   Re: Which signal occurs due to a page protection violation?
Message-ID:  <ADC5EE4E-2304-4F95-A32F-8BB37F2A9A7E@brooknet.com.au>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
[ 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.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ADC5EE4E-2304-4F95-A32F-8BB37F2A9A7E>