RFR (S) 8042660: vm/mlvm/anonloader/stress/byteMutation failed with: assert(index >=0 && index < _length) failed: symbol index overflow

harold seigel harold.seigel at oracle.com
Tue Dec 22 01:57:57 UTC 2015


Hi,

Please review this updated webrev that includes the check for zero 
length suggested below.   The only change from the previous webrev is at 
line 625 of classFileParser.cpp.

New webrev: http://cr.openjdk.java.net/~hseigel/bug_8042660.2/

The new change was retested with the hotspot jtreg tests and the JCK vm 
tests.

Thanks! Harold

On 12/21/2015 4:00 PM, Karen Kinnear wrote:
> Harold,
>
> Looks good for the assertion you hit.
> Thank you for the fix and the extensive testing!
>
> And thank you for walking me privately through -
> spec reference to requiring at least one code point which means “” is not a valid name or signature
> and having the logic under the >= JAVA_7_VERSION since that is where we added verification that this
> was the right type of signature.
>
> And thank you for adding the test for the empty method name - if I understand correctly, that is testing
> existing code in verify_legal_method_name.
>
> I believe if you were to turn off verification you could
> run into the assertion under JVM_CONSTANT_Methodref “bad method name”. Perhaps instead
> of an assertion there you could check if name length == 0 or something so we do the init check
> properly but don’t assert/crash.
>
> thanks,
> Karen
>
>> On Dec 21, 2015, at 1:35 PM, harold seigel <harold.seigel at oracle.com> wrote:
>>
>> Hi,
>>
>> Please review this small change to fix bug 8042660 <https://bugs.openjdk.java.net/browse/JDK-8042660>.
>>
>> The code in ClassFileParser::parse_constant_pool() that handles CONSTANT_NameAndType and CONSTANT_*Ref assumes that the constant pool strings they reference are valid names and signatures because they are valid Utf8 strings.  But, "" is a valid Utf8 string but not a valid name or signature.  Assuming that the strings were of non-zero length caused crashes when test byteMutation specified zero length strings.  This fix adds checks for strings of zero length and throws ClassFormatError exceptions, preventing the JVM crashes.
>>
>> Open webrev: http://cr.openjdk.java.net/~hseigel/bug_8042660/
>>
>> JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8042660
>>
>> The fix was tested with JCK Lang, VM, and API java_lang tests, the UTE quick and split verifier tests, and the hotspot, JDK vm, java/io, java/lang, and java/util JTreg tests, and the tests included in this RFR.
>>
>> Thanks, Harold



More information about the hotspot-runtime-dev mailing list