8306006: strace001.java fails due to unknown methods on stack
Reviewed-by: rehn, alanb, dholmes
This commit is contained in:
parent
ddb86469e0
commit
a31a11f44a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, 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
|
||||
@ -141,10 +141,13 @@ public class strace001 {
|
||||
expectedSystemTrace = new String[]{
|
||||
"java.lang.Thread.sleep",
|
||||
"java.lang.Thread.sleep0",
|
||||
"java.lang.Thread.beforeSleep",
|
||||
"java.lang.Thread.afterSleep",
|
||||
"java.lang.Thread.yield",
|
||||
"java.lang.Thread.yield0",
|
||||
"java.lang.Thread.currentCarrierThread",
|
||||
"java.lang.Thread.currentThread",
|
||||
"java.util.concurrent.TimeUnit.toNanos",
|
||||
"jdk.internal.event.ThreadSleepEvent.<clinit>",
|
||||
"jdk.internal.event.ThreadSleepEvent.isTurnedOn",
|
||||
"jdk.internal.event.ThreadSleepEvent.isEnabled"
|
||||
@ -201,13 +204,15 @@ public class strace001 {
|
||||
// The method performs checks of the stack trace
|
||||
private static boolean checkTrace(StackTraceElement[] elements) {
|
||||
int length = elements.length;
|
||||
int expectedLength = depth + 5;
|
||||
// The length of the trace must not be greater than
|
||||
// expectedLength. Number of recursionJava() or
|
||||
// recursionNative() methods must not be greater than depth,
|
||||
// also one run() and one waitForSign(), plus whatever can be
|
||||
// reached from Thread.yield or Thread.sleep.
|
||||
int expectedLength = depth + 6;
|
||||
boolean result = true;
|
||||
|
||||
// Check the length of the trace. It must not be greater than
|
||||
// expectedLength. Number of recursionJava() or recursionNative()
|
||||
// methods must not ne greater than depth, also one Object.wait() or
|
||||
// Thread.yield() method, one run( ) and one waitForSign().
|
||||
// Check the length of the trace
|
||||
if (length > expectedLength) {
|
||||
log.complain("Length of the stack trace is " + length + ", but "
|
||||
+ "expected to be not greater than " + expectedLength);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -42,10 +42,9 @@
|
||||
* Main thread makes a snapshot of stack trace for all threads and checks it:
|
||||
* 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must
|
||||
* return not null ThreadInfo.
|
||||
* 2. The length of a trace must not be greater than (depth + 3). Number
|
||||
* of recursionJava() or recursionNative() methods must not be greater
|
||||
* than depth, also one Object.wait() or Thread.yield() method, one
|
||||
* run(), and one waitForSign().
|
||||
* 2. Number of recursionJava() or recursionNative() methods must not be
|
||||
* greater than depth + X, where X is implementation dependent.
|
||||
* See strace001.java for more info.
|
||||
* 3. The latest method of the stack trace must be RunningThread.run().
|
||||
* 4. getClassName() and getMethodName() methods must return expected
|
||||
* values for each element of the stack trace.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -42,10 +42,9 @@
|
||||
* Main thread makes a snapshot of stack trace for all threads and checks it:
|
||||
* 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must
|
||||
* return not null ThreadInfo.
|
||||
* 2. The length of a trace must not be greater than (depth + 3). Number
|
||||
* of recursionJava() or recursionNative() methods must not be greater
|
||||
* than depth, also one Object.wait() or Thread.yield() method, one
|
||||
* run(), and one waitForSign().
|
||||
* 2. Number of recursionJava() or recursionNative() methods must not be
|
||||
* greater than depth + X, where X is implementation dependent.
|
||||
* See strace001.java for more info.
|
||||
* 3. The latest method of the stack trace must be RunningThread.run().
|
||||
* 4. getClassName() and getMethodName() methods must return expected
|
||||
* values for each element of the stack trace.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -42,10 +42,9 @@
|
||||
* Main thread makes a snapshot of stack trace for all threads and checks it:
|
||||
* 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must
|
||||
* return not null ThreadInfo.
|
||||
* 2. The length of a trace must not be greater than (depth + 3). Number
|
||||
* of recursionJava() or recursionNative() methods must not be greater
|
||||
* than depth, also one Object.wait() or Thread.yield() method, one
|
||||
* run(), and one waitForSign().
|
||||
* 2. Number of recursionJava() or recursionNative() methods must not be
|
||||
* greater than depth + X, where X is implementation dependent.
|
||||
* See strace001.java for more info.
|
||||
* 3. The latest method of the stack trace must be RunningThread.run().
|
||||
* 4. getClassName() and getMethodName() methods must return expected
|
||||
* values for each element of the stack trace.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -42,10 +42,9 @@
|
||||
* Main thread makes a snapshot of stack trace for all threads and checks it:
|
||||
* 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must
|
||||
* return not null ThreadInfo.
|
||||
* 2. The length of a trace must not be greater than (depth + 3). Number
|
||||
* of recursionJava() or recursionNative() methods must not be greater
|
||||
* than depth, also one Object.wait() or Thread.yield() method, one
|
||||
* run(), and one waitForSign().
|
||||
* 2. Number of recursionJava() or recursionNative() methods must not be
|
||||
* greater than depth + X, where X is implementation dependent.
|
||||
* See strace001.java for more info.
|
||||
* 3. The latest method of the stack trace must be RunningThread.run().
|
||||
* 4. getClassName() and getMethodName() methods must return expected
|
||||
* values for each element of the stack trace.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -42,10 +42,9 @@
|
||||
* Main thread makes a snapshot of stack trace for all threads and checks it:
|
||||
* 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must
|
||||
* return not null ThreadInfo.
|
||||
* 2. The length of a trace must not be greater than (depth + 3). Number
|
||||
* of recursionJava() or recursionNative() methods must not be greater
|
||||
* than depth, also one Object.wait() or Thread.yield() method, one
|
||||
* run(), and one waitForSign().
|
||||
* 2. Number of recursionJava() or recursionNative() methods must not be
|
||||
* greater than depth + X, where X is implementation dependent.
|
||||
* See strace001.java for more info.
|
||||
* 3. The latest method of the stack trace must be RunningThread.run().
|
||||
* 4. getClassName() and getMethodName() methods must return expected
|
||||
* values for each element of the stack trace.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -42,10 +42,9 @@
|
||||
* Main thread makes a snapshot of stack trace for all threads and checks it:
|
||||
* 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must
|
||||
* return not null ThreadInfo.
|
||||
* 2. The length of a trace must not be greater than (depth + 3). Number
|
||||
* of recursionJava() or recursionNative() methods must not be greater
|
||||
* than depth, also one Object.wait() or Thread.yield() method, one
|
||||
* run(), and one waitForSign().
|
||||
* 2. Number of recursionJava() or recursionNative() methods must not be
|
||||
* greater than depth + X, where X is implementation dependent.
|
||||
* See strace001.java for more info.
|
||||
* 3. The latest method of the stack trace must be RunningThread.run().
|
||||
* 4. getClassName() and getMethodName() methods must return expected
|
||||
* values for each element of the stack trace.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -42,10 +42,9 @@
|
||||
* Main thread makes a snapshot of stack trace for all threads and checks it:
|
||||
* 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must
|
||||
* return not null ThreadInfo.
|
||||
* 2. The length of a trace must not be greater than (depth + 3). Number
|
||||
* of recursionJava() or recursionNative() methods must not be greater
|
||||
* than depth, also one Object.wait() or Thread.yield() method, one
|
||||
* run(), and one waitForSign().
|
||||
* 2. Number of recursionJava() or recursionNative() methods must not be
|
||||
* greater than depth + X, where X is implementation dependent.
|
||||
* See strace001.java for more info.
|
||||
* 3. The latest method of the stack trace must be RunningThread.run().
|
||||
* 4. getClassName() and getMethodName() methods must return expected
|
||||
* values for each element of the stack trace.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -42,10 +42,9 @@
|
||||
* Main thread makes a snapshot of stack trace for all threads and checks it:
|
||||
* 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must
|
||||
* return not null ThreadInfo.
|
||||
* 2. The length of a trace must not be greater than (depth + 3). Number
|
||||
* of recursionJava() or recursionNative() methods must not be greater
|
||||
* than depth, also one Object.wait() or Thread.yield() method, one
|
||||
* run(), and one waitForSign().
|
||||
* 2. Number of recursionJava() or recursionNative() methods must not be
|
||||
* greater than depth + X, where X is implementation dependent.
|
||||
* See strace001.java for more info.
|
||||
* 3. The latest method of the stack trace must be RunningThread.run().
|
||||
* 4. getClassName() and getMethodName() methods must return expected
|
||||
* values for each element of the stack trace.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -42,10 +42,9 @@
|
||||
* Main thread makes a snapshot of stack trace for all threads and checks it:
|
||||
* 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must
|
||||
* return not null ThreadInfo.
|
||||
* 2. The length of a trace must not be greater than (depth + 3). Number
|
||||
* of recursionJava() or recursionNative() methods must not be greater
|
||||
* than depth, also one Object.wait() or Thread.yield() method, one
|
||||
* run(), and one waitForSign().
|
||||
* 2. Number of recursionJava() or recursionNative() methods must not be
|
||||
* greater than depth + X, where X is implementation dependent.
|
||||
* See strace001.java for more info.
|
||||
* 3. The latest method of the stack trace must be RunningThread.run().
|
||||
* 4. getClassName() and getMethodName() methods must return expected
|
||||
* values for each element of the stack trace.
|
||||
|
Loading…
Reference in New Issue
Block a user