Skip to content

Commit 3bf0964

Browse files
jbachorikapangin
andauthored
Fix unsafe access to CodeCache (#175)
Co-authored-by: Andrei Pangin <noreply@pangin.pro>
1 parent bf74bf8 commit 3bf0964

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ddprof-lib/src/main/cpp/stackWalker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ int StackWalker::walkDwarf(void *ucontext, const void **callchain,
158158
}
159159
if (CodeHeap::contains(pc) && !(depth == 0 && frame.unwindAtomicStub(pc))) {
160160
const void* page_start = (const void*)((uintptr_t)pc & ~0xfffUL);
161-
frame.adjustSP(page_start, pc, sp);
161+
// Don't dereference pc as it may point to unreadable memory
162+
// frame.adjustSP(page_start, pc, sp);
162163
java_ctx->set(pc, sp, fp);
163164
break;
164165
}

0 commit comments

Comments
 (0)