Skip to content

Commit

Permalink
8321818: vmTestbase/nsk/stress/strace/strace015.java failed with 'Can…
Browse files Browse the repository at this point in the history
…not read the array length because "<local4>" is null'

Reviewed-by: lmesnik
Backport-of: ea50c54
  • Loading branch information
David Holmes committed Dec 19, 2024
1 parent 4aec2d4 commit 2c33629
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 2c33629

Please sign in to comment.