aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Plummer <cjplummer@openjdk.org>2021-05-18 21:26:56 +0000
committerChris Plummer <cjplummer@openjdk.org>2021-05-18 21:26:56 +0000
commit10236e7a52a2dd117c3639d020cfe294797f57af (patch)
tree80ea6795be2ef7d05678c7e4ba16ac99d50b65ba
parente6705c0e4b548a83197c3ea70bdef25ec65d4c00 (diff)
downloadJetBrainsRuntime-10236e7a52a2dd117c3639d020cfe294797f57af.tar.gz
8263242: serviceability/sa/ClhsdbFindPC.java cannot find MaxJNILocalCapacity with ASLR
Reviewed-by: kevinw, ysuenaga
-rw-r--r--src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c
index fcddae9c4ca..5fca59841cf 100644
--- a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c
+++ b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c
@@ -187,8 +187,9 @@ static bool fill_addr_info(lib_info* lib) {
lib->exec_end = (uintptr_t)-1L;
for (ph = phbuf, cnt = 0; cnt < ehdr.e_phnum; cnt++, ph++) {
if (ph->p_type == PT_LOAD) {
- uintptr_t aligned_start = align_down(lib->base + ph->p_vaddr, ph->p_align);
- uintptr_t aligned_end = align_up(aligned_start + ph->p_filesz, ph->p_align);
+ uintptr_t unaligned_start = lib->base + ph->p_vaddr;
+ uintptr_t aligned_start = align_down(unaligned_start, ph->p_align);
+ uintptr_t aligned_end = align_up(unaligned_start + ph->p_memsz, ph->p_align);
if ((lib->end == (uintptr_t)-1L) || (lib->end < aligned_end)) {
lib->end = aligned_end;
}
@@ -540,4 +541,3 @@ ps_lgetregs(struct ps_prochandle *ph, lwpid_t lid, prgregset_t gregset) {
print_debug("ps_lgetfpregs not implemented\n");
return PS_OK;
}
-