Request for reviews (M): 6947341: JVM Crash running Oracle ATG CRMDemo

John Coomes John.Coomes at oracle.com
Tue Jun 22 12:06:16 PDT 2010


Vladimir Kozlov (vladimir.kozlov at oracle.com) wrote:
> http://cr.openjdk.java.net/~kvn/6947341/webrev
> 
> Fixed 6947341: JVM Crash running Oracle ATG CRMDemo
> 
> Missing protected page below heap with compressed oops
> which use narrow_oop_base and implicit null check.
> It is caused by ReservedSpace code misses checks that OS
> reserved heap at requested address.
> 
> Before 6951686 fix Linux will reserve heap memory at address
> which is not requested for compressed oops VM (usually above
> 32Gb virtual address: 0x00002aaaae200000). But VM thinks
> it did reserve at requested address and it does not need
> protected page below heap, so the code in protect_noaccess_prefix()
> is not executed.
> 
> Solution:
> Add missing checks. I also added few asserts and prints
> to make sure memory reservation done correctly for
> compressed oops.
> 
> Verified with CRMDemo.

Looks good; have one suggestion.  There are 3 copies of code very
similar to this:

 162     addr = os::attempt_reserve_memory_at(size, requested_address);
 163     if (addr != NULL && addr != requested_address) {
 164       // Different reserve address may be acceptable in other cases
 165       // but for compressed oops heap should be at requested address.
 166       assert(UseCompressedOops, "currently requested address used only for compressed oops");
 167       if (PrintCompressedOopsMode) {
 168         tty->cr();
 169         tty->print_cr("Reserved memory at not requested address: " PTR_FORMAT " vs " PTR_FORMAT, addr, requested_address);
 170       }
 171       // OS ignored requested address. Try different address.
 172       if (!os::release_memory(addr, size)) {
 173         fatal("os::release_memory failed");
 174       }
 175       addr = NULL;
 176     }

There are minor differences, but it would be nice if they could be
combined into a check_allocation_address(...) function, e.g.,

   addr = os::attempt_reserve_memory_at(size, requested_address);
   if (!check_allocation_address(size, requested_address, special, addr)) {
     addr = NULL;
   }

-John



More information about the hotspot-compiler-dev mailing list