Re: sigbus vs sigsegv on mprotect() exeception?
Re: sigbus vs sigsegv on mprotect() exeception?
- Subject: Re: sigbus vs sigsegv on mprotect() exeception?
- From: Terry Lambert <email@hidden>
- Date: Mon, 27 Oct 2008 06:14:13 -0700
Dereference of null pointers causes SIGBUS because we map an
inaccessible page at page zero to prevent an accessible page being
mapped there instead. For 64 bit programs, we do the same for the low
4G to catch pointer truncations from things like pointer-int-pointer
pig tricks. If you don't like it you can always mmap and munmap a
page on top of it to get an SIGSEGV instead.
-- Terry
On Oct 26, 2008, at 4:05 PM, Brad Parker <email@hidden> wrote:
Hi,
I'm running mac os 10.5.5 on an x86 cpu. I noticed that mprotect()'d
pages throw SIGBUS for violations.
My code (which admittedly started on linux) expects SIGSEGV.
Is there any standard document which covers this behavior? I'm
guessing
that 99.99% of the world would never notice.
any thoughts on this? what does freebsd do? or solaris? just
curious.
-brad
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden