GNOME Bugzilla – Bug 687334
workaround OpenBSD mmap() bug
Last modified: 2012-11-05 13:42:23 UTC
Created attachment 227791 [details] specify PROT_READ as well Hi. From OpenBSD mmap(2) manual page: BUGS Due to a limitation of the current vm system (see uvm(9)), mapping descriptors PROT_WRITE without also specifying PROT_READ is useless (results in a segmentation fault when first accessing the mapping). This means that such descriptors must be opened with O_RDWR, which requires both read and write permissions on the underlying object. Ryan, this fixes the segfault I mentioned to you by mail some weeks ago. If preferred, I can ifdef OpenBSD, but I don't think there is any drawback in adding PROT_READ globally.
Interesting. This presumably comes from the fact that x86 pagetables are incapable of expressing a write-only memory page (from what I recall). Other operating systems, when faced with this situation, create a read-write page. OpenBSD seems to prefer to take the conservative approach and create a page with no access at all...
(In reply to comment #1) > Interesting. > > This presumably comes from the fact that x86 pagetables are incapable of > expressing a write-only memory page (from what I recall). Other operating > systems, when faced with this situation, create a read-write page. OpenBSD > seems to prefer to take the conservative approach and create a page with no > access at all... Yes this is exactly how it looks like. Would it be alright to push?
Is there some bug on an OpenBSD bug tracker that I could link/subscribe to? The manpage says that it's a"BUG", so it might be nice to remove the workaround at some time...
(In reply to comment #3) > Is there some bug on an OpenBSD bug tracker that I could link/subscribe to? > The manpage says that it's a"BUG", so it might be nice to remove the workaround > at some time... Hi Ryan. There is no real "bug tracker" in OpenBSD. That said, you can trust me to follow this kind of things, i.e. if the situation changes in a near future, I'll let you know. But it is unlikely this bug will be fixed anytime soon since the issue is deep in the virtual memory system...
Okay. Fixed on 'master' and 'dconf-0.14' branches. I've added a comment to the code linking back here. Please let me know if you discover this issue to be fixed.