Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   x86_64: Trace RBP chain on kernel stack only if unwind() fails (http://www.linux-archive.org/crash-utility/486488-x86_64-trace-rbp-chain-kernel-stack-only-if-unwind-fails.html)

HATAYAMA Daisuke 01-01-1970 01:00 AM

x86_64: Trace RBP chain on kernel stack only if unwind() fails
 
- unwind() logic attempts to collect all the callee-saved registers including
RBP. So, RBP chain tracing is necessary only if this unwind() logic doesn't
succeed.

- Also, verify whether a given task is not active. This is because for active
tasks, RBP saved on the corresponding kernel stacks could be modified.

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
---
src/libgcore/gcore_x86.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/libgcore/gcore_x86.c b/src/libgcore/gcore_x86.c
index 8c129d3..871a9db 100644
--- a/src/libgcore/gcore_x86.c
+++ b/src/libgcore/gcore_x86.c
@@ -1258,7 +1258,7 @@ static inline void restore_rest(ulong task, struct pt_regs *regs,
* could trace the value of bp until its value became a
* user-space address. See comments of restore_frame_pointer.
*/
- if (machdep->flags & FRAMEPOINTER) {
+ else if ((machdep->flags & FRAMEPOINTER) && !is_task_active(task)) {
regs->rbp = restore_frame_pointer(task);
}
}
--
1.7.4


--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility


All times are GMT. The time now is 11:38 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.