After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687334 - workaround OpenBSD mmap() bug
workaround OpenBSD mmap() bug
Status: RESOLVED FIXED
Product: dconf
Classification: Core
Component: dconf
git master
Other OpenBSD
: Normal major
: ---
Assigned To: dconf-maint
dconf-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-01 11:19 UTC by Antoine Jacoutot
Modified: 2012-11-05 13:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
specify PROT_READ as well (846 bytes, application/octet-stream)
2012-11-01 11:19 UTC, Antoine Jacoutot
Details

Description Antoine Jacoutot 2012-11-01 11:19:31 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.
Comment 1 Allison Karlitskaya (desrt) 2012-11-01 12:30:00 UTC
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...
Comment 2 Antoine Jacoutot 2012-11-01 14:11:59 UTC
(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?
Comment 3 Allison Karlitskaya (desrt) 2012-11-03 12:17:40 UTC
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...
Comment 4 Antoine Jacoutot 2012-11-04 08:24:55 UTC
(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...
Comment 5 Allison Karlitskaya (desrt) 2012-11-05 13:42:23 UTC
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.