RFR: 8269523: runtime/Safepoint/TestAbortOnVMOperationTimeout.java failed when expecting 'VM operation took too long'

Aleksey Shipilev shade at openjdk.java.net
Mon Jul 26 07:37:03 UTC 2021


On Mon, 26 Jul 2021 00:23:43 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Please review this simple test adjustment:
>  - dropped 5ms timeout as we have seen execution as low as 2ms
>  - enabled GC logging
>  - report output in all cases to allow ease of analysis
> 
> Testing: ran 10x on macos/linux/Windows x64 and macos Aarch64 to check execution times and adjusted test accordingly
> 
> Thanks,
> David

I believe there are two slippery cases in the test, both stemming from the implicit reliancs on Serial GC to traverse the entire array. I can think of two failure modes:
 a) Serial invokes young GCs during the loop iteration, so that we traverse only the younger parts of the array;
 b) A compiler comes and eliminates `arr` altogether, as it is not globally reachable.

I wonder if errors would go away if we do:


static Object[] arr;

public static void main(String[] args) throws Exception {
    if (args.length > 0) {
        arr = new Object[10_000_000];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = new Object();
        }
        System.gc();
        return;
    }

-------------

PR: https://git.openjdk.java.net/jdk/pull/4901


More information about the hotspot-runtime-dev mailing list