Request for review: 8012695: Assertion message displays %u and %s text instead of actual values

Coleen Phillimore coleen.phillimore at oracle.com
Mon Apr 22 11:21:35 PDT 2013


This sounds like a nice cleanup actually.  I don't know how you (Harold) 
feel about growing this change to do the cleanup, as well as fixing the 
problem.

One thing that I think would be safe is to test that _class_name != NULL 
first.  It should never be null but you never know.

Thanks,
Coleen


On 04/22/2013 01:52 PM, Ioi Lam wrote:
> It seems tedious that all callers of check_property have to pass in 
> "...  in class file %s".
>
> Also, if the "%s" is placed at the wrong place we could potentially 
> crash inside printf().
>
> How about this?
>
> check_property(
>     ...
>       "outer_class_info_index %u has bad constant type in class file 
> %s", outer_class_info_index ...)
>
> ->
>
> check_property(
>     ...
>       "outer_class_info_index",  outer_class_info_index, "has bad 
> constant type", ...)
>
> This way the passed-in strings are treated as plain strings instead of 
> printf formatters.
>
> Thanks
> - Ioi
>
> On 04/22/2013 06:49 AM, harold seigel wrote:
>> Hi,
>>
>> Please review this small fix for bug 8012695.
>>
>> Summary:   The fix uses err_msg() to create an assertion message 
>> containing actual text instead of printf formatters.
>>
>> Open webrev at http://cr.openjdk.java.net/~hseigel/bug_8012695/ 
>> <http://cr.openjdk.java.net/%7Ehseigel/bug_8012695/>
>>
>> Bug link at http://bugs.sun.com/view_bug.do?bug_id=8012695
>>
>> Regression testing was done using JCK Lang and VM tests and ute 
>> vm.quick.testlist tests.  Also, assertion messages were generated to 
>> ensure that the fix works:
>>
>> Old message:   # fatal error: Invalid field attribute index %u in 
>> class file %s
>>
>> New message:  #  fatal error: Invalid code attribute name index 92 in 
>> class file vm/mlvm/anonloader/share/AnonkTestee01
>>
>> Thank you!
>> Harold
>



More information about the hotspot-runtime-dev mailing list