Re: sigbus vs sigsegv on mprotect() exeception?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Brad, davez On Oct 27, 2008, at 8:46 AM, Brad Parker wrote: 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. I believe I am mmaping pages and still seeing SIGBUS. specifically, I if mprotect with r+x and then try to write, I get SIGBUS when I expect SIGSEGV. -brad _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/zarzycki%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This is arguably a bug, but probably not worth fixing at this point. In practice, the difference between these two signals is mostly, if not totally historic. Please consider changing the code to catch both signals and handle them identically. Terry Lambert wrote: This email sent to zarzycki@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Dave Zarzycki