tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

erlang -> asmjit -> mremap questions/bugs


Erlang comes with a JIT: asmjit.

The current version doesn't work with PaX MPROTECT. I filed a bug
report and asmjit added code using mremap().

The asmjit self-tests work, but in erlang with the new version there
are segfaults.

An Erlang developer helped debugging and found weird behaviour:

It seems the problem is that mmap() in the mremap(2) man page example
(which was used to implement the asmjit version) is not using

- I'd like to add MAP_SHARED in the mmap() call in the mremap(2) man
  page example. Is that fine?

- Reading mmap(2) it seems that one of MAP_SHARED or MAP_PRIVATE is
  required, but there is no error if none is provided. Should we change
  mmap() to return an error in that case?

- Why does MAP_PRIVATE (instead of MAP_SHARED) not work?

- Does anyone have an idea why the old asmjit code (shm_open() instead
  of mremap()) might still be working on NetBSD 9 but not on NetBSD
  10.99.2? Both have PaX MPROTECT enabled by default, and the mremap()


Home | Main Index | Thread Index | Old Index