Skip to content

Commit

Permalink
8346717: serviceability/dcmd/vm/SystemDumpMapTest.java failing on Win…
Browse files Browse the repository at this point in the history
…dows with "Stack base not yet set for thread id"

Reviewed-by: lmesnik, dholmes
  • Loading branch information
Simon Tooke authored and David Holmes committed Jan 12, 2025
1 parent 3145278 commit f04a642
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/nmt/memMapPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
17 changes: 15 additions & 2 deletions test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,29 @@
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");
Expand Down

0 comments on commit f04a642

Please sign in to comment.