mmtk / mmtk-core

Memory Management ToolKit
https://www.mmtk.io
Other
379 stars 69 forks source link

Only map with executable permissions when using code space #1176

Closed k-sareen closed 3 months ago

k-sareen commented 4 months ago

This PR closes https://github.com/mmtk/mmtk-core/issues/7. This PR

qinsoon commented 4 months ago

I pushed some changes. It refactors MmapStrategy and allows spaces to pass what protection flags they need for mmap. With the change, only code spaces are mmapped with exec.

k-sareen commented 4 months ago

Thank you for the refactoring. It looks much better now. Jikes is broken for some reason. Does it depend on exec permissions on non-codespaces perhaps...?

qinsoon commented 4 months ago

Thank you for the refactoring. It looks much better now. Jikes is broken for some reason. Does it depend on exec permissions on non-codespaces perhaps...?

I am not sure. MMTK in JikesRVM does mmap all the spaces with exec. Our Julia binding currently allocates code into normal spaces.

I added a feature exec_permission_on_all_spaces which allows exec for all the spaces. I can try turn on the feature for those two bindings.

qinsoon commented 4 months ago

binding-refs JIKESRVM_BINDING_REPO=qinsoon/mmtk-jikesrvm JIKESRVM_BINDING_REF=update-mmtk-core-pr-1176 V8_BINDING_REPO=qinsoon/mmtk-v8 V8_BINDING_REF=update-mmtk-core-pr-1176

qinsoon commented 4 months ago

It seems Julia does not need exec permission for normal spaces, but V8 (NoGC has no code space) and JikesRVM need.