RFR(M): 8206977: Minor improvements of runtime code.
lois.foltan at oracle.com
Tue Jul 10 19:10:49 UTC 2018
Just a couple of comments based on Coleen's review, see below.
On 7/10/2018 9:03 AM, coleen.phillimore at oracle.com wrote:
> + name ? name->as_C_string() : "<unnamed>");
Instead of "<unnamed>" please use the UNNAMED_MODULE macro from
> Can you change to:
> + name != NULL ? name->as_C_string() : "<unnamed>");
> This looks a lot nicer! Similar code is in linkResolver.cpp, can you
> look at changing it too?
I have an RFR out currently for JDK-8205611, (see
which needs one more reviewer's okay. It contains changes to reword the
error messages for loader constraint violations in order to follow the
new proposed format for module and class loader information. So our two
changes will conflict in this area.
> If name is null here, what would this do? Should there be an 'else'
> to print something?
> I think this looks fine. It doesn't look major to me. The asserts
> turned to guarantees don't appear to be anywhere performance sensitive.
> On 7/10/18 6:53 AM, Lindenmaier, Goetz wrote:
>> I ran coverity on the jdk11 hotspot sources and want to propose the
>> following fixes to the runtime code. I scanned the linux x86_64 build.
>> Some issues are similar to previous parfait fixes (check for NULL, add
>> guarantees etc.) I also identified some issues I consider real problems.
>> In detail:
>> Real issues:
>> || should be &&.
>> Attention, this is the only change that really will change behaviour.
>> But if thr == NULL we will see a crash below.
>> Wrong buffer length used.
>> Move code dereferencing ik under if (ik != NULL).
>> Initialization is missing. Moved constructor up to the other
>> Useful code improvements:
>> Assure buffer is not accessed at offset -1.
>> Numa_max_node returns int, and a -1 in some cases.
>> name might be NULL. Just a fix for tracing.
>> clearify code.
>> It would be wrong if only entry == NULL would hold, one
>> would hit the assertion below.
>> Fix tracing.
>> Illegal opcode is -1 and should not be passed to name array.
>> If n_selections == 0, best_selection would be NULL.
>> Move up the assertion and turn into a guarantee.
>> Either base can be NULL, or parts of the code before are dead.
>> We now an exception is pending.
>> Coverity does not like the format in a variable.
>> Anyways this is quite rough coding, transformed to use stringStream
>> as with other similar exceptions.
>> match might be NULL.
>> name might be NULL.
>> If ftell returns error code -1, we need not continue.
>> Especially we should not fseek(-1).
>> ftell returns -1.
>> wrong datatype.
More information about the hotspot-runtime-dev