Skip to content

Commit

Permalink
JDK-8294316: SA core file support is broken on macosx-x64 starting wi…
Browse files Browse the repository at this point in the history
…th macOS 12.x
  • Loading branch information
vieiro committed Dec 10, 2024
1 parent 4d78227 commit a15cab1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 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, 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 @@ -622,11 +622,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) == 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) == 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
12 changes: 6 additions & 6 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,22 +164,22 @@ runtime/jni/terminatedThread/TestTerminatedThread.java 8219652 aix-ppc64

serviceability/dcmd/gc/RunFinalizationTest.java 8227120 generic-all
serviceability/sa/ClhsdbAttach.java 8193639 solaris-all
serviceability/sa/ClhsdbCDSCore.java 8294316,8193639,8267433 solaris-all,macosx-x64
serviceability/sa/ClhsdbCDSCore.java 8193639,8267433 solaris-all,macosx-x64
serviceability/sa/ClhsdbCDSJstackPrintAll.java 8193639 solaris-all
serviceability/sa/CDSJMapClstats.java 8193639 solaris-all
serviceability/sa/ClhsdbField.java 8193639 solaris-all
serviceability/sa/ClhsdbFindPC.java 8294316,8193639,8267433 solaris-all,macosx-x64
serviceability/sa/ClhsdbFindPC.java 8193639,8267433 solaris-all,macosx-x64
serviceability/sa/ClhsdbFlags.java 8193639 solaris-all
serviceability/sa/ClhsdbInspect.java 8193639 solaris-all
serviceability/sa/ClhsdbJdis.java 8193639 solaris-all
serviceability/sa/ClhsdbJhisto.java 8193639 solaris-all
serviceability/sa/ClhsdbJstack.java 8193639 solaris-all
serviceability/sa/ClhsdbLongConstant.java 8193639 solaris-all
serviceability/sa/ClhsdbPmap.java 8294316,8193639,8267433 solaris-all,macosx-x64
serviceability/sa/ClhsdbPmap.java 8193639,8267433 solaris-all,macosx-x64
serviceability/sa/ClhsdbPrintAll.java 8193639 solaris-all
serviceability/sa/ClhsdbPrintAs.java 8193639 solaris-all
serviceability/sa/ClhsdbPrintStatics.java 8193639 solaris-all
serviceability/sa/ClhsdbPstack.java 8294316,8193639,8267433 solaris-all,macosx-x64
serviceability/sa/ClhsdbPstack.java 8193639,8267433 solaris-all,macosx-x64
serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java 8193639 solaris-all
serviceability/sa/ClhsdbScanOops.java 8193639 solaris-all
serviceability/sa/ClhsdbSource.java 8193639 solaris-all
Expand All @@ -203,8 +203,8 @@ serviceability/sa/TestInstanceKlassSize.java 8193639 solaris-all
serviceability/sa/TestInstanceKlassSizeForInterface.java 8193639 solaris-all
serviceability/sa/TestIntConstant.java 8193639 solaris-all
serviceability/sa/TestJhsdbJstackLock.java 8193639 solaris-all
serviceability/sa/TestJmapCore.java 8294316,8193639,8267433 solaris-all,macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8294316,8193639,8267433 solaris-all,macosx-x64
serviceability/sa/TestJmapCore.java 8193639,8267433 solaris-all,macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8193639,8267433 solaris-all,macosx-x64
serviceability/sa/TestPrintMdo.java 8193639 solaris-all
serviceability/sa/TestRevPtrsForInvokeDynamic.java 8191270 generic-all
serviceability/sa/TestType.java 8193639 solaris-all
Expand Down

0 comments on commit a15cab1

Please sign in to comment.