ghc, OpenBSD and stack pointer checking

Matthias Kilian kili at outback.escape.de
Mon Jan 22 20:52:01 UTC 2018


Hi,

On Thu, Jan 18, 2018 at 01:21:27PM -0500, Ben Gamari wrote:
> > So, if the stack pointer checking diff to OpenBSD is correct, and
> > if I'm not running into a completely unrelated problem: does ghc
> > and/or the runtime library sometimes move the system stack pointer
> > to newly allocated/mapped memory? If so, where in the code?
> >
> As far as I know GHC shouldn't touch x86-64's $rsp at all; we
> specifically avoid using it for the STG stack to ease FFI.

Thanks for the information.

> It would be
> interesting to know what is touching it. Unfortunately, without a tool
> like rr this may be hard to find.

I doubt it's easy to get rr ported to OpenBSD, so all I can think
of at the moment is ktracing every single invocation of ghc during
a build (should be relatively easy by patching the ghc wrapper
script) and -- after an abort happended, look at the trace to see
wether the current stack had been mmapped at all late during the
process.

At the moment, I'm busy updating all the haskell libraries and tools
offically available as OpenBSD packages, but I hope to get back to
debugging/tracing in a few days.

Ciao,
	Kili


More information about the ghc-devs mailing list