diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace007.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace007.java index 61fbc146b60..e4115432c64 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace007.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace007.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,6 +125,11 @@ static boolean makeSnapshot() { StackTraceElement[] all; for (int i = 1; i < THRD_COUNT; i++) { all = traces.get(threads[i]); + if (all == null) { + complain("No stacktrace for thread " + threads[i].getName() + + " was found in the set of all traces"); + return false; + } int k = all.length; if (count - k > 2) { complain("wrong lengths of stack traces:\n\t" diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace008.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace008.java index 24b421ae99d..f237daaf049 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace008.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace008.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -129,6 +129,11 @@ static boolean makeSnapshot() { StackTraceElement[] all; for (int i = 1; i < THRD_COUNT; i++) { all = traces.get(threads[i]); + if (all == null) { + complain("No stacktrace for thread " + threads[i].getName() + + " was found in the set of all traces"); + return false; + } int k = all.length; if (count - k > 4) { complain("wrong lengths of stack traces:\n\t" diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace009.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace009.java index 0f8ee03f700..ad9f77f0c58 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace009.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace009.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -129,6 +129,11 @@ static boolean makeSnapshot() { StackTraceElement[] all; for (int i = 1; i < THRD_COUNT; i++) { all = traces.get(threads[i]); + if (all == null) { + complain("No stacktrace for thread " + threads[i].getName() + + " was found in the set of all traces"); + return false; + } int k = all.length; if (count - k > 2) { complain("wrong lengths of stack traces:\n\t" diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace010.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace010.java index 3595ae3735f..ee07292ed01 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace010.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace010.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -145,6 +145,11 @@ boolean makeSnapshot() { StackTraceElement[] all; for (int i = 1; i < THRD_COUNT; i++) { all = traces.get(threads[i]); + if (all == null) { + complain("No stacktrace for thread " + threads[i].getName() + + " was found in the set of all traces"); + return false; + } int k = all.length; if (count - k > 2) { complain("wrong lengths of stack traces:\n\t" diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace011.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace011.java index eb48601b2a2..185bcbc316b 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace011.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace011.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -149,6 +149,11 @@ boolean makeSnapshot() { StackTraceElement[] all; for (int i = 1; i < THRD_COUNT; i++) { all = traces.get(threads[i]); + if (all == null) { + complain("No stacktrace for thread " + threads[i].getName() + + " was found in the set of all traces"); + return false; + } int k = all.length; if (count - k > 2) { complain("wrong lengths of stack traces:\n\t" diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace012.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace012.java index 4ebc3de7395..89451c97732 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace012.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace012.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -151,6 +151,11 @@ boolean makeSnapshot() { StackTraceElement[] all; for (int i = 1; i < THRD_COUNT; i++) { all = traces.get(threads[i]); + if (all == null) { + complain("No stacktrace for thread " + threads[i].getName() + + " was found in the set of all traces"); + return false; + } int k = all.length; if (count - k > 2) { complain("wrong lengths of stack traces:\n\t" diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace013.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace013.java index 87de7d112f8..6bff7354393 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace013.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace013.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -130,6 +130,11 @@ boolean makeSnapshot() { StackTraceElement[] all; for (int i = 1; i < THRD_COUNT; i++) { all = traces.get(threads[i]); + if (all == null) { + complain("No stacktrace for thread " + threads[i].getName() + + " was found in the set of all traces"); + return false; + } int k = all.length; if (count - k > 3) { complain("wrong lengths of stack traces:\n\t" diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace014.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace014.java index bc760f1722a..0ef900b35df 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace014.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace014.java @@ -140,6 +140,11 @@ boolean makeSnapshot() { StackTraceElement[] all; for (int i = 1; i < THRD_COUNT; i++) { all = traces.get(threads[i]); + if (all == null) { + complain("No stacktrace for thread " + threads[i].getName() + + " was found in the set of all traces"); + return false; + } int k = all.length; if (count - k > 4) { complain("wrong lengths of stack traces:\n\t" diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace015.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace015.java index 437e4f9e21c..940628cff09 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace015.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace015.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -138,6 +138,11 @@ boolean makeSnapshot() { StackTraceElement[] all; for (int i = 1; i < THRD_COUNT; i++) { all = traces.get(threads[i]); + if (all == null) { + complain("No stacktrace for thread " + threads[i].getName() + + " was found in the set of all traces"); + return false; + } int k = all.length; if (count - k > 3) { complain("wrong lengths of stack traces:\n\t"