8346717: serviceability/dcmd/vm/SystemDumpMapTest.java failing on Windows with "Stack base not yet set for thread id"

Reviewed-by: lmesnik, dholmes
This commit is contained in:
Simon Tooke 2025-01-12 21:39:43 +00:00 committed by David Holmes
parent 3145278847
commit f04a642246
2 changed files with 16 additions and 3 deletions

View File

@ -173,7 +173,7 @@ static bool vma_touches_thread_stack(const void* from, const void* to, const Thr
// kernel. That can happen, e.g., for non-java threads that don't have guard pages.
// Therefore we go for the simplest way here and check for intersection between VMA and thread stack.
// Note it is possible to encounter a brand new thread that has not yet initialized its stack fields.
return range_intersects(from, to, (const void*)t->stack_end(), (const void*)t->stack_base_or_null());
return t->stack_base_or_null() != nullptr && range_intersects(from, to, (const void*)t->stack_end(), (const void*)t->stack_base());
}
struct GCThreadClosure : public ThreadClosure {

View File

@ -28,16 +28,29 @@ import jdk.test.lib.dcmd.JMXExecutor;
import jdk.test.lib.process.OutputAnalyzer;
/*
* @test
* @test id=normal
* @summary Test of diagnostic command System.map
* @library /test/lib
* @requires (os.family == "linux" | os.family == "windows" | os.family == "mac")
* @requires (vm.gc != "Z") & (os.family == "linux" | os.family == "windows" | os.family == "mac")
* @modules java.base/jdk.internal.misc
* java.compiler
* java.management
* jdk.internal.jvmstat/sun.jvmstat.monitor
* @run testng/othervm -XX:+UsePerfData SystemMapTest
*/
/*
* @test id=zgc
* @bug 8346717
* @summary Test of diagnostic command System.map using ZGC
* @library /test/lib
* @requires vm.gc.Z & (os.family == "linux" | os.family == "windows" | os.family == "mac")
* @modules java.base/jdk.internal.misc
* java.compiler
* java.management
* jdk.internal.jvmstat/sun.jvmstat.monitor
* @run testng/othervm -XX:+UsePerfData -XX:+UseZGC SystemMapTest
*/
public class SystemMapTest extends SystemMapTestBase {
public void run(CommandExecutor executor) {
OutputAnalyzer output = executor.execute("System.map");