Hi,
On Tue, Jan 31, 2017 at 04:48:37PM +0000, Scott Bonds wrote:
> New submission from Scott Bonds <scott@ggr.com>:
>
> 1. Summarise the issue (what were doing, what went wrong?)
>
> I was trying to commit a change but I got an error message instead:
>
> ~/bin (master|✚10…) ❯❯❯ darcs record -m "next commit"
> addfile ./.gitignore
> fish: Job 2, 'darcs record -m "next commit"' terminated by signal
> SIGABRT (Abort)
>
> I tailed dmesg and saw this line:
>
> darcs(67403): mprotect W^X violation
>
> Here's some background on why this is a problem on OpenBSD specifically:
>
> http://undeadly.org/cgi?action=article&sid=20160527203200
>
> The workaround is installing darcs on an OpenBSD partition that allows
> W^X violations
Indeed. When installing darcs from the official OpenBSD package
collection, the binary will end up in /usr/local/bin, and since
there are still some other programs with W^X violations (such as
chromium for example) it's probably ok to mount /usr/local with the
wxallowed option.
But when you're building darcs yourself (as seems to be the case
here, because the OpenBSD darcs package is still at 2.10): yes,
you'll have to install it on a separate filesystem with the wxallowed
option.
And please be aware that this isn't a problem of darcs itself, but
of ghc's runtime system. I tried to patch that last year, but failed
badly :-(
At the moment, I try to update the Haskell ports for OpenBSD to use
at least ghc-8.0.1, but that's an annoying work, because many of
the libraries we have in the OpenBSD ports tree (including those
darcs depends on) need updates, too (and sometimes patches), so
I've no idea when I'm ready to commit this update. And only after
that I'll start to look at the W^X violations in ghc again, because
there are too many changes in ghc's RTS between 7.10 and 8.0.
> or use a different OS that's less picky about these sort
> of things.
On the long term, every OS should (and hopefully will) be even more
picky and disable W|X completely. Even if there are still some knobs
to turn W^X enforcement off or *some* programs, doing so for a tool
like darcs which is typically exposed to the network (when working
with remote repositories) isn't a wise decision, IMHO.
Ciao,
Kili
|