RFR: 8167333: Invalid source path info might be used when creating ClassFileStream after CFLH transforms a shared classes in some cases

Jiangli Zhou jiangli.zhou at oracle.com
Fri Oct 7 22:35:19 UTC 2016


Hi Dmitry,

Thanks for the review.

> On Oct 7, 2016, at 1:36 AM, Dmitry Samersoff <dmitry.samersoff at oracle.com> wrote:
> 
> Jiangli,
> 
> I see couple of places in hotspot where result of
> FileMapInfo::shared_classpath() is de-referenced without additional null
> check.
> 
> Could you insert check/assert/comments as appropriate to these places?

That’s a very good point. I double-checked all other places that call FileMapInfo::shared_classpath(). They all have valid non-NULL shared class path entry when the entry field is accessed. Just being cautious, I added some asserts to make sure the shared class path entry is not NULL. Here is updated webrev:

http://cr.openjdk.java.net/~jiangli/8167333/webrev.01/ <http://cr.openjdk.java.net/~jiangli/8167333/webrev.01/>

I’ve rerun all related tests.

Thanks,
Jiangli

> 
> -Dmitry
> 
> On 2016-10-07 07:39, Jiangli Zhou wrote:
>> Hi,
>> 
>> Please review the following fix for JDK-8167333
>> <https://bugs.openjdk.java.net/browse/JDK-8167333>:
>> 
>> webrev: http://cr.openjdk.java.net/~jiangli/8167333/webrev.00/
>> <http://cr.openjdk.java.net/~jiangli/8167333/webrev.00/>
>> 
>> When a shared class is transformed by a JVMTI agent during initial
>> loading (via CFLH), the VM creates a new ClassFileStream using the
>> transformed class data. The source path info from the class’
>> associated SharedClassPathEntry is passed as the ‘source’ argument to
>> ClassFileStream. However, some shared classes may not have an
>> associated SharedClassPathEntry and the class_path_index is -1. The
>> VM needs to detect such case and not passing an invalid source path
>> info.
>> 
>> Tested with all existing class data sharing tests.
>> 
>> Thanks, Jiangli
>> 
> 
> 
> -- 
> Dmitry Samersoff
> Oracle Java development team, Saint Petersburg, Russia
> * I would love to change the world, but they won't give me the sources.



More information about the hotspot-runtime-dev mailing list