review for 7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer

Tom Rodriguez tom.rodriguez at oracle.com
Fri Nov 4 13:08:29 PDT 2011


On Nov 4, 2011, at 10:54 AM, Tom Rodriguez wrote:

> 
> On Nov 3, 2011, at 10:49 PM, John Rose wrote:
> 
>> That's good.
>> 
>> The xtty output should delimit the attribute values with single quotes:
>> 
>>  - xtty->print_cr("<sect index=%d used=" ...
>>  + xtty->print_cr("<sect index='%d' used='" …
> 
> Yep.  I'll fix that.

I also wasn't terminating one of the elements correctly.  I ran an xml parser over the output to confirm that was syntactically well formed.

> 
>> 
>> Perhaps the xml-spewing code should be a method on CodeBuffer itself, so we can log other such bits (stub routines, interpreter, adapters) when we feel like it.
> 
> That's a good idea.  I may add a few others if it's easy.

I added log_sections_sizes.  It would be nice if this were all a lot more automatic but we'd have to rearrange CodeBuffer and friends to do it.

tom

> 
> tom
> 
>> 
>> -- John
>> 
>> On Nov 3, 2011, at 4:51 PM, Tom Rodriguez wrote:
>> 
>>> http://cr.openjdk.java.net/~never/7104960
>>> 73 lines changed: 42 ins; 6 del; 25 mod; 14873 unchg
>>> 
>>> 7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
>>> Reviewed-by:
>>> 
>>> The code buffers on limits on sparc didn't properly account for space
>>> required then the code cache and libjvm.so were farther apart than an
>>> int so it would slightly overflow it's buffer.  It would crash because
>>> the CodeCache became corrupted instead of reporting that it
>>> overflowed.  I modified the overflow detection logic to work even in
>>> product.  It doesn't check on every operation as it does in debug
>>> mode, it just vierifies at the end that it hasn't overflowed.  I also
>>> extended the ForceUnreachable logic to work on sparc and turned it
>>> into a diagnostic so it can be tested in product.  I added logging
>>> code to report buffer usage and reset the values on sparc and x86.  If
>>> left about 4k of buffer in product mode and 20k in debug mode.
>>> 
>> 
> 



More information about the hotspot-compiler-dev mailing list