Skip to content

Commit 51de765

Browse files
committed
8283010: serviceability/sa/ClhsdbThread.java failed with "'Base of Stack:' missing from stdout/stderr "
Reviewed-by: amenkov
1 parent 8a48965 commit 51de765

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/hotspot/jtreg/serviceability/sa/ClhsdbThread.java

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
2525
import java.util.List;
2626
import java.util.Map;
2727
import jdk.test.lib.apps.LingeredApp;
28+
import jdk.test.lib.Platform;
2829
import jtreg.SkippedException;
2930

3031
/**
@@ -96,10 +97,17 @@ public static void main(String[] args) throws Exception {
9697
System.out.println("Thread Id obtained is: " + threadIdObtained);
9798

9899
String cmd = "thread " + threadIdObtained;
99-
expStrMap.put(cmd, List.of(
100-
"Base of Stack:",
101-
"State:",
102-
"Last_Java_SP"));
100+
if (Platform.isWindows()) {
101+
// On windows thread IDs are not guaranteed to be the same each time you attach,
102+
// so the ID we gleaned above for the Finalizer thread may not actually be for
103+
// the Finalizer thread when we attach for the following "thread" command, so we
104+
// choose not to check the result on Windows.
105+
} else {
106+
expStrMap.put(cmd, List.of(
107+
"Base of Stack:",
108+
"State:",
109+
"Last_Java_SP"));
110+
}
103111
cmds = List.of(cmd);
104112
test.run(theApp.getPid(), cmds, expStrMap, null);
105113
} catch (SkippedException se) {

0 commit comments

Comments
 (0)