Skip to content

Commit 8be1616

Browse files
fandreuzkevinjwalls
authored andcommitted
8367609: serviceability/sa/ClhsdbPmap.java fails when built with Clang
Reviewed-by: kevinw, cjplummer
1 parent dfd3832 commit 8be1616

File tree

1 file changed

+7
-1
lines changed
  • src/jdk.hotspot.agent/linux/native/libsaproc

1 file changed

+7
-1
lines changed

src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,15 @@ static bool read_lib_segments(struct ps_prochandle* ph, int lib_fd, ELF_EHDR* li
420420
// Coredump stores value of p_memsz elf field
421421
// rounded up to page boundary.
422422

423+
// Account for the PH being at some vaddr offset from mapping in core file.
424+
uint64_t lib_memsz = lib_php->p_memsz;
425+
if (target_vaddr > existing_map->vaddr) {
426+
lib_memsz += target_vaddr - existing_map->vaddr;
427+
}
428+
423429
if ((existing_map->memsz != page_size) &&
424430
(existing_map->fd != lib_fd) &&
425-
(ROUNDUP(existing_map->memsz, page_size) != ROUNDUP(lib_php->p_memsz, page_size))) {
431+
(ROUNDUP(existing_map->memsz, page_size) != ROUNDUP(lib_memsz, page_size))) {
426432

427433
print_error("address conflict @ 0x%lx (existing map size = %ld, size = %ld, flags = %d)\n",
428434
target_vaddr, existing_map->memsz, lib_php->p_memsz, lib_php->p_flags);

0 commit comments

Comments
 (0)