8051349: nsk/jvmti/scenarios/sampling/SP06/sp06t003 fails in nightly

Reviewed-by: dholmes, sspitsyn, cjplummer, jcbeyler
This commit is contained in:
Gary Adams 2018-12-18 07:33:07 -05:00
parent 888057a89f
commit cc65367331
4 changed files with 20 additions and 9 deletions

View File

@ -187,7 +187,6 @@ vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003/TestDescription.java 6606
vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted004/TestDescription.java 7013634,6606767 generic-all
vmTestbase/nsk/jvmti/ThreadStart/threadstart001/TestDescription.java 8016181 generic-all
vmTestbase/nsk/jvmti/scenarios/extension/EX03/ex03t001/TestDescription.java 8173658 generic-all
vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t003/TestDescription.java 8051349 generic-all
vmTestbase/nsk/jvmti/AttachOnDemand/attach034/TestDescription.java 8042145 generic-all
vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 generic-all
vmTestbase/nsk/jvmti/unit/heap/HeapWalkTests/TestDescription.java 8016181 generic-all

View File

@ -310,7 +310,8 @@ static int checkThreads(int suspended, const char* kind) {
(long)frameStack[j].location);
/* query frame location */
if (!NSK_JVMTI_VERIFY(
jvmti->GetFrameLocation(threadsDesc[i].thread, j, &qMethod, &qLocation))) {
jvmti->GetFrameLocation(threadsDesc[i].thread, j, &qMethod, &qLocation))
&& (suspended == NSK_TRUE)) {
nsk_jvmti_setFailStatus();
continue;
}
@ -318,8 +319,8 @@ static int checkThreads(int suspended, const char* kind) {
NSK_DISPLAY2(" queried: method: %p, location: %ld\n",
(void*)qMethod, (long)qLocation);
/* check frame equalaty */
if (frameStack[j].method != qMethod) {
/* check frame equality */
if ((suspended == NSK_TRUE) && (frameStack[j].method != qMethod)) {
NSK_COMPLAIN6("Different method in stack frame #%d for %s thread #%d (%s):\n"
"# GetStackTrace(): %p\n"
"# GetFrameLocation(): %p\n",

View File

@ -268,6 +268,7 @@ class sp06t001ThreadSleeping extends sp06t001Thread {
class sp06t001ThreadRunningInterrupted extends sp06t001Thread {
private Object waitingMonitor = new Object();
volatile boolean interruptReady = false;
public sp06t001ThreadRunningInterrupted(String name, Log log) {
super(name, log);
@ -275,8 +276,9 @@ class sp06t001ThreadRunningInterrupted extends sp06t001Thread {
public void testedMethod(boolean simulate, int i) {
if (!simulate) {
interruptReady = true;
synchronized (waitingMonitor) {
// wait on watingMonitor until interrupted
// wait on waitingMonitor until interrupted
try {
waitingMonitor.wait();
} catch (InterruptedException ignore) {
@ -303,6 +305,14 @@ class sp06t001ThreadRunningInterrupted extends sp06t001Thread {
public boolean checkReady() {
// interrupt thread on wait()
// delay until testMethod is ready
while (!interruptReady) {
try {
sleep(1000);
} catch (InterruptedException ie) {
// ignored
}
}
synchronized (waitingMonitor) {
interrupt();
}

View File

@ -333,7 +333,8 @@ static int checkThreads(int suspended, const char* kind0) {
(long)frameStack[j].location);
/* query frame location */
if (!NSK_JVMTI_VERIFY(
jvmti->GetFrameLocation(threadsDesc[i].thread, j, &qMethod, &qLocation))) {
jvmti->GetFrameLocation(threadsDesc[i].thread, j, &qMethod, &qLocation))
&& (suspended == NSK_TRUE)) {
nsk_jvmti_setFailStatus();
continue;
}
@ -341,8 +342,8 @@ static int checkThreads(int suspended, const char* kind0) {
NSK_DISPLAY2(" queried: method: 0x%p, location: %ld\n",
(void*)qMethod, (long)qLocation);
/* check frame equalaty */
if (frameStack[j].method != qMethod) {
/* check frame equality */
if ((suspended == NSK_TRUE) && (frameStack[j].method != qMethod)) {
NSK_COMPLAIN6("Different method in stack frame #%d for %s thread #%d (%s):\n"
"# GetStackTrace(): 0x%p\n"
"# GetFrameLocation(): 0x%p\n",
@ -350,7 +351,7 @@ static int checkThreads(int suspended, const char* kind0) {
(void*)frameStack[j].method, (void*)qMethod);
nsk_jvmti_setFailStatus();
}
if (frameStack[j].location != qLocation) {
if ((suspended == NSK_TRUE) && (frameStack[j].location != qLocation)) {
NSK_COMPLAIN6("Different location in stack frame #%d for %s thread #%d (%s):\n"
"# GetStackTrace(): %ld\n"
"# GetFrameLocation(): %ld\n",