[Bug libgcj/19823] java fails with non-executable memory

Hans dot Boehm at hp dot com gcc-bugzilla@gcc.gnu.org
Wed Feb 9 10:08:00 GMT 2005

------- Additional Comments From Hans dot Boehm at hp dot com  2005-02-09 05:38 -------
I believe that the GC alters permissions on the heap only if either
- It is running in incremental mode, or
- It is built with USE_MMAP, and thus uses mmap to allocate the heap.
I think we talked about always doing the latter, but we don't.  Thus I think the
heap is allocated with sbrk.  If the kernel no longer gives execute permission
for sbrk memory, then that would propagate through to the Java heap.  That would
presunably break libffi.  It should be possible to confirm a lot of this with

I think the collector is configured to disable execute permission whenever it
resets permissions.  Thus if we used mmap, libffi would presumably break
consistently everywhere it tries to put trampolines in the heap.  (It doesn't
need trampolines on all platforms.)

If all of this is correct, then building the collector with USE_MMAP, and
telling it to enable execute permission, might be a work-around.



More information about the Gcc-bugs mailing list