Skip to content

Commit

Permalink
8294316: SA core file support is broken on macosx-x64 starting with m…
Browse files Browse the repository at this point in the history
…acOS 12.x

Reviewed-by: cjplummer, sspitsyn
  • Loading branch information
Tom Rodriguez committed Jun 27, 2023
1 parent 4bce38c commit 269852b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
15 changes: 10 additions & 5 deletions src/jdk.hotspot.agent/macosx/native/libsaproc/ps_core.c
Original file line number Diff line number Diff line change
@@ -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.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -297,11 +297,16 @@ static bool read_core_segments(struct ps_prochandle* ph) {
print_debug("failed to read LC_SEGMENT_64 i = %d!\n", i);
goto err;
}
if (add_map_info(ph, fd, segcmd.fileoff, segcmd.vmaddr, segcmd.vmsize, segcmd.flags) == NULL) {
print_debug("Failed to add map_info at i = %d\n", i);
goto err;
// The base of the library is offset by a random amount which ends up as a load command with a
// filesize of 0. This must be ignored otherwise the base address of the library is wrong.
if (segcmd.filesize != 0) {
if (add_map_info(ph, fd, segcmd.fileoff, segcmd.vmaddr, segcmd.vmsize, segcmd.flags) == NULL) {
print_debug("Failed to add map_info at i = %d\n", i);
goto err;
}
}
print_debug("LC_SEGMENT_64 added: nsects=%d fileoff=0x%llx vmaddr=0x%llx vmsize=0x%llx filesize=0x%llx %s\n",
print_debug("LC_SEGMENT_64 %s: nsects=%d fileoff=0x%llx vmaddr=0x%llx vmsize=0x%llx filesize=0x%llx %s\n",
segcmd.filesize == 0 ? "with filesize == 0 ignored" : "added",
segcmd.nsects, segcmd.fileoff, segcmd.vmaddr, segcmd.vmsize,
segcmd.filesize, &segcmd.segname[0]);
} else if (lcmd.cmd == LC_THREAD || lcmd.cmd == LC_UNIXTHREAD) {
Expand Down
14 changes: 7 additions & 7 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 w
serviceability/jvmti/vthread/GetSetLocalTest/GetSetLocalTest.java 8286836 generic-all
serviceability/dcmd/gc/RunFinalizationTest.java 8227120 linux-all,windows-x64

serviceability/sa/ClhsdbCDSCore.java 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#xcomp-core 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#no-xcomp-core 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbPmap.java#core 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbPstack.java#core 8294316,8267433 macosx-x64
serviceability/sa/TestJmapCore.java 8294316,8267433 macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbCDSCore.java 8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#xcomp-core 8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#no-xcomp-core 8267433 macosx-x64
serviceability/sa/ClhsdbPmap.java#core 8267433 macosx-x64
serviceability/sa/ClhsdbPstack.java#core 8267433 macosx-x64
serviceability/sa/TestJmapCore.java 8267433 macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8267433 macosx-x64

serviceability/attach/ConcAttachTest.java 8290043 linux-all

Expand Down

1 comment on commit 269852b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.