Skip to content

Commit 10236e7

Browse files
committed
8263242: serviceability/sa/ClhsdbFindPC.java cannot find MaxJNILocalCapacity with ASLR
Reviewed-by: kevinw, ysuenaga
1 parent e6705c0 commit 10236e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ static bool fill_addr_info(lib_info* lib) {
187187
lib->exec_end = (uintptr_t)-1L;
188188
for (ph = phbuf, cnt = 0; cnt < ehdr.e_phnum; cnt++, ph++) {
189189
if (ph->p_type == PT_LOAD) {
190-
uintptr_t aligned_start = align_down(lib->base + ph->p_vaddr, ph->p_align);
191-
uintptr_t aligned_end = align_up(aligned_start + ph->p_filesz, ph->p_align);
190+
uintptr_t unaligned_start = lib->base + ph->p_vaddr;
191+
uintptr_t aligned_start = align_down(unaligned_start, ph->p_align);
192+
uintptr_t aligned_end = align_up(unaligned_start + ph->p_memsz, ph->p_align);
192193
if ((lib->end == (uintptr_t)-1L) || (lib->end < aligned_end)) {
193194
lib->end = aligned_end;
194195
}
@@ -540,4 +541,3 @@ ps_lgetregs(struct ps_prochandle *ph, lwpid_t lid, prgregset_t gregset) {
540541
print_debug("ps_lgetfpregs not implemented\n");
541542
return PS_OK;
542543
}
543-

0 commit comments

Comments
 (0)