Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, 2021, 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 @@ -115,13 +115,13 @@ serviceability/sa/TestRevPtrsForInvokeDynamic.java 8241235 generic-all
serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 windows-all
serviceability/dcmd/gc/RunFinalizationTest.java 8227120 generic-all

serviceability/sa/ClhsdbCDSCore.java 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#id1 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#id3 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbPmap.java#id1 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbPstack.java#id1 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#id1 8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#id3 8267433 macosx-x64
serviceability/sa/ClhsdbPmap.java#id1 8267433 macosx-x64
serviceability/sa/ClhsdbPstack.java#id1 8267433 macosx-x64
serviceability/sa/TestJmapCore.java 8267433 macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8267433 macosx-x64

#############################################################################

Expand Down