[9] RFR(S): 8060479: [TESTBUG] compiler/codecache/CheckSegmentedCodeCache.java test fails with product build

Igor Ignatyev igor.ignatyev at oracle.com
Sun Oct 19 00:08:28 UTC 2014


Tobias,

this is definitely a bug in get*Flag functions. I think it'd be better 
to fix it as a separate issue.

my suggested fix (w/ changes only for bool):

> diff -r 821164b0131a src/share/vm/runtime/globals.cpp
> --- a/src/share/vm/runtime/globals.cpp  Fri Oct 03 12:11:14 2014 -0700
> +++ b/src/share/vm/runtime/globals.cpp  Sun Oct 19 04:05:40 2014 +0400
> @@ -629,8 +629,8 @@
>    e.commit();
>  }
>
> -bool CommandLineFlags::boolAt(const char* name, size_t len, bool* value) {
> -  Flag* result = Flag::find_flag(name, len);
> +bool CommandLineFlags::boolAt(const char* name, size_t len, bool* value, bool allow_locked, bool return_flag) {
> +  Flag* result = Flag::find_flag(name, len, allow_locked, return_flag);
>    if (result == NULL) return false;
>    if (!result->is_bool()) return false;
>    *value = result->get_bool();
> diff -r 821164b0131a src/share/vm/runtime/globals.hpp
> --- a/src/share/vm/runtime/globals.hpp  Fri Oct 03 12:11:14 2014 -0700
> +++ b/src/share/vm/runtime/globals.hpp  Sun Oct 19 04:05:40 2014 +0400
> @@ -377,8 +377,8 @@
>
>  class CommandLineFlags {
>   public:
> -  static bool boolAt(const char* name, size_t len, bool* value);
> -  static bool boolAt(const char* name, bool* value)      { return boolAt(name, strlen(name), value); }
> +  static bool boolAt(const char* name, size_t len, bool* value, bool allow_locked = false, bool return_flag = false);
> +  static bool boolAt(const char* name, bool* value, bool allow_locked = false, bool return_flag = false)      { return boolAt(name, strlen(name), value, allow_locked, return_flag); }
>    static bool boolAtPut(const char* name, size_t len, bool* value, Flag::Flags origin);
>    static bool boolAtPut(const char* name, bool* value, Flag::Flags origin)   { return boolAtPut(name, strlen(name), value, origin); }

> diff -r 821164b0131a src/share/vm/prims/whitebox.cpp
> --- a/src/share/vm/prims/whitebox.cpp   Fri Oct 03 12:11:14 2014 -0700
> +++ b/src/share/vm/prims/whitebox.cpp   Sun Oct 19 04:06:59 2014 +0400
> @@ -543,7 +543,7 @@
>    }
>    ThreadToNativeFromVM ttnfv(thread);   // can't be in VM when we call JNI
>    const char* flag_name = env->GetStringUTFChars(name, NULL);
> -  bool result = (*TAt)(flag_name, value);
> +  bool result = (*TAt)(flag_name, value, true, true);
>    env->ReleaseStringUTFChars(name, flag_name);
>    return result;
>  }

Thanks,
Igor

On 10/18/2014 04:46 AM, Vladimir Kozlov wrote:
> WB get*Flag interface should be fixed! The constant value of develop
> flags are available in product VM. You need to call Flag::find_flag()
> with return_flag = true. WB should not use default CommandLineFlags
> class methods but define its own or extend CommandLineFlags's methods.
>
> Igor I. should comment on this since he is author of "new WB API ::
> get/setVMFlag"
>
> Thanks,
> Vladimir
>
> On 10/17/14 3:18 AM, Tobias Hartmann wrote:
>> Hi Vladimir,
>>
>> On 17.10.2014 10:47, Vladimir Kozlov wrote:
>>> CodeCacheMinimumUseSpace is different for Zero. There is WB API which
>>> returns
>>> options value getUintxVMFlag() you can use to calculate value minSize.
>>
>> Yes, but the flag is only available in debug builds. See
>> 'Flag::find_flag':
>>
>> 525    // Don't report notproduct and develop flags in product builds.
>>
>> Calling getUintxVMFlag() throws a java.lang.NullPointerException with
>> product
>> builds. One solution would be to only perform this check for debug
>> builds where
>> we are able to compute the size. What do you think?
>>
>>> 8046809 changes will change min_code_cache_size value again (removes
>>> CodeCacheMinimumFreeSpace). Let Albert know to modify this test again.
>>
>> I will do so.
>>
>> Thanks,
>> Tobias
>>
>>> Thanks,
>>> Vladimir
>>>
>>> On 10/17/14 12:00 AM, Tobias Hartmann wrote:
>>>> Can I get another review for this?
>>>>
>>>> Thanks,
>>>> Tobias
>>>>
>>>> On 15.10.2014 16:19, Tobias Hartmann wrote:
>>>>> Hi,
>>>>>
>>>>> please review the following patch.
>>>>>
>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8060479
>>>>> Webrev: http://cr.openjdk.java.net/~thartmann/8060479/webrev.00/
>>>>>
>>>>> Problem:
>>>>> The test CheckSegmentedCodeCache assumes that VM startup always
>>>>> fails with a
>>>>> ReservedCodeCacheSize of 1700K. This is not true for product builds
>>>>> (see
>>>>> 'min_code_cache_size' in 'CodeCache::initialize_heaps()').
>>>>>
>>>>> Solution:
>>>>> Check for debug build and adjust minimum code cache size accordingly.
>>>>>
>>>>> Testing:
>>>>> Failing test on JPRT.
>>>>>
>>>>> Thanks,
>>>>> Tobias


More information about the hotspot-compiler-dev mailing list