8294316: SA core file support is broken on macosx-x64 starting with macOS 12.x

Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
Tom Rodriguez 2023-06-27 19:57:06 +00:00
parent 4bce38c6d7
commit 269852b906
2 changed files with 17 additions and 12 deletions

View File

@ -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.
*
@ -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) {

View File

@ -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