public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "Hans dot Boehm at hp dot com" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug libgcj/19823] java fails with non-executable memory
Date: Tue, 15 Feb 2005 00:45:00 -0000	[thread overview]
Message-ID: <20050214193826.7587.qmail@sourceware.org> (raw)
In-Reply-To: <20050208143717.19823.matz@suse.de>


------- Additional Comments From Hans dot Boehm at hp dot com  2005-02-14 19:38 -------
I'd like to see USE_MMAP set in boehm-gc/configure.ac instead of gcconfig.h.  
There's already a comment there that we're not setting NO_EXECUTE_PERMISSION 
for this reason, where the upstream version does set it.  I also think we've 
been trying to keep gcconfig.h shared, with gcj-specific adjustments in 
configure.ac.

It seems to me that, with this minor adjustment, this is clearly the right 
short term fix.

I'm not sure that we should be turning on execute permission on all platforms, 
though.  I'm pretty sure it's unnecessary on IA64.  I think it should be 
unnecessary on all platforms on which function pointers point to an (ip, GOT) 
pair.  IIRC, that includes PowerPC?  At least IA64 does not put trampoline code 
in the closure.

Having said that, I'm not sure that having the Java heap be executable is a 
major security risk.

There can occasionally be a large performance down side to making the heap 
executable on some platforms, at least in the presence of incremental GC.  I 
know that some old Un*x versions ensured d-cache and i-cache coherency whenever 
you made an mprotect call with the execute bit set.  And this could take a 
substantial amount of time. 

Having the collector allocate both executable and non-executable memory sounds 
non-trivial.  Probably it would be easiest to add a new "kind" of pointer-free, 
executable memory, and have the GC adjust permissions when a new block was 
moced between kinds.  But that may not be cheap (see above).  And there are 
issues if the physical page size is larger than the heap block size.

The alternative is to essentially keep a separate heap, which would require a 
major code reorganization, and introduces a new and different kind of 
fragmentation.  I suspect it would be far easier to have the interpreter 
allocate closures outside the Java heap.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19823


  parent reply	other threads:[~2005-02-14 19:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-08 19:25 [Bug java/19823] New: " matz at suse dot de
2005-02-09  3:20 ` [Bug libgcj/19823] " pinskia at gcc dot gnu dot org
2005-02-09  5:38 ` aph at gcc dot gnu dot org
2005-02-09  9:19 ` mckinlay at redhat dot com
2005-02-09  9:20 ` Hans dot Boehm at hp dot com
2005-02-09 13:51 ` aph at gcc dot gnu dot org
2005-02-09 17:40 ` aj at gcc dot gnu dot org
2005-02-10  0:20 ` tromey at gcc dot gnu dot org
2005-02-10  0:20 ` aj at gcc dot gnu dot org
2005-02-10 10:58 ` Hans dot Boehm at hp dot com
2005-02-10 18:50 ` aj at gcc dot gnu dot org
2005-02-10 19:05 ` aj at gcc dot gnu dot org
2005-02-10 20:48 ` aph at gcc dot gnu dot org
2005-02-14 15:03 ` aph at gcc dot gnu dot org
2005-02-14 15:18 ` jakub at gcc dot gnu dot org
2005-02-14 20:05 ` aph at gcc dot gnu dot org
2005-02-15  0:45 ` Hans dot Boehm at hp dot com [this message]
2005-02-16  7:31 ` cvs-commit at gcc dot gnu dot org
2005-02-16 18:23 ` mckinlay at redhat dot com
2005-02-22 21:57 ` cvs-commit at gcc dot gnu dot org
2005-02-22 22:04 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050214193826.7587.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).