public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
* [Bug backtrace/16558] New: GDB Aarch64 signal frame unwinder issue @ 2014-02-12 2:00 teawater at gmail dot com 2014-02-12 2:00 ` [Bug backtrace/16558] " teawater at gmail dot com ` (4 more replies) 0 siblings, 5 replies; 6+ messages in thread From: teawater at gmail dot com @ 2014-02-12 2:00 UTC (permalink / raw) To: gdb-prs https://sourceware.org/bugzilla/show_bug.cgi?id=16558 Bug ID: 16558 Summary: GDB Aarch64 signal frame unwinder issue Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: backtrace Assignee: unassigned at sourceware dot org Reporter: teawater at gmail dot com The signal frame unwinder in GDB on Aarch64 seems to have troubles, e.g. the frame where the signal was triggered is skipped. Seen in: (gdb) PASS: gdb.base/relativedebug.exp: continue bt #0 0x0000007fb7e1d5dc in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x0000007fb7e20aac in __GI_abort () at abort.c:89 #2 0x0000000000400850 in handler (signo=14) at /scratch/macro/aarch64-linux-wrs/src/gdb-7.6-yocto/gdb/testsuite/gdb.base/relativedebug.c:25 #3 <signal handler called> #4 main () at /scratch/macro/aarch64-linux-wrs/src/gdb-7.6-yocto/gdb/testsuite/gdb.base/relativedebug.c:33 FAIL: gdb.base/relativedebug.exp: pause found in backtrace where pause's frame is missing between #3 and #4 and also in other test cases where also other frame data is incorrect. -- You are receiving this mail because: You are on the CC list for the bug. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug backtrace/16558] GDB Aarch64 signal frame unwinder issue 2014-02-12 2:00 [Bug backtrace/16558] New: GDB Aarch64 signal frame unwinder issue teawater at gmail dot com @ 2014-02-12 2:00 ` teawater at gmail dot com 2014-02-12 2:25 ` teawater at gmail dot com ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: teawater at gmail dot com @ 2014-02-12 2:00 UTC (permalink / raw) To: gdb-prs https://sourceware.org/bugzilla/show_bug.cgi?id=16558 teawater <teawater at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at sourceware dot org |teawater at gmail dot com -- You are receiving this mail because: You are on the CC list for the bug. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug backtrace/16558] GDB Aarch64 signal frame unwinder issue 2014-02-12 2:00 [Bug backtrace/16558] New: GDB Aarch64 signal frame unwinder issue teawater at gmail dot com 2014-02-12 2:00 ` [Bug backtrace/16558] " teawater at gmail dot com @ 2014-02-12 2:25 ` teawater at gmail dot com 2014-03-06 8:51 ` teawater at gmail dot com ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: teawater at gmail dot com @ 2014-02-12 2:25 UTC (permalink / raw) To: gdb-prs https://sourceware.org/bugzilla/show_bug.cgi?id=16558 teawater <teawater at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #1 from teawater <teawater at gmail dot com> --- https://sourceware.org/ml/gdb-patches/2014-02/msg00374.html -- You are receiving this mail because: You are on the CC list for the bug. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug backtrace/16558] GDB Aarch64 signal frame unwinder issue 2014-02-12 2:00 [Bug backtrace/16558] New: GDB Aarch64 signal frame unwinder issue teawater at gmail dot com 2014-02-12 2:00 ` [Bug backtrace/16558] " teawater at gmail dot com 2014-02-12 2:25 ` teawater at gmail dot com @ 2014-03-06 8:51 ` teawater at gmail dot com 2014-05-20 5:21 ` cvs-commit at gcc dot gnu.org 2014-05-21 0:54 ` teawater at gmail dot com 4 siblings, 0 replies; 6+ messages in thread From: teawater at gmail dot com @ 2014-03-06 8:51 UTC (permalink / raw) To: gdb-prs https://sourceware.org/bugzilla/show_bug.cgi?id=16558 --- Comment #2 from teawater <teawater at gmail dot com> --- https://sourceware.org/ml/gdb-patches/2014-03/msg00102.html -- You are receiving this mail because: You are on the CC list for the bug. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug backtrace/16558] GDB Aarch64 signal frame unwinder issue 2014-02-12 2:00 [Bug backtrace/16558] New: GDB Aarch64 signal frame unwinder issue teawater at gmail dot com ` (2 preceding siblings ...) 2014-03-06 8:51 ` teawater at gmail dot com @ 2014-05-20 5:21 ` cvs-commit at gcc dot gnu.org 2014-05-21 0:54 ` teawater at gmail dot com 4 siblings, 0 replies; 6+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2014-05-20 5:21 UTC (permalink / raw) To: gdb-prs https://sourceware.org/bugzilla/show_bug.cgi?id=16558 --- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, master has been updated via f2205de0080d999c9b67872c9db471c31b53e378 (commit) from cdf2a8b762199f2fe7b2bd0230bb755296867c69 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f2205de0080d999c9b67872c9db471c31b53e378 commit f2205de0080d999c9b67872c9db471c31b53e378 Author: Hui Zhu <teawater@gmail.com> Date: Tue May 20 13:19:06 2014 +0800 Fix issue #15778: GDB Aarch64 signal frame unwinder issue The root cause of this issue is unwinder of "#3 <signal handler called>" doesn't supply right values of registers. When GDB want to get the previous frame of "#3 <signal handler called>", it will call cache init function of unwinder "aarch64_linux_sigframe_init". The address or the value of the registers is get from this function. So the bug is inside thie function. I check the asm code of "#3 <signal handler called>": (gdb) frame 3 (gdb) p $pc $1 = (void (*)()) 0x7f931fa4d0 (gdb) disassemble $pc, +10 Dump of assembler code from 0x7f931fa4d0 to 0x7f931fa4da: => 0x0000007f931fa4d0: mov x8, #0x8b // #139 0x0000007f931fa4d4: svc #0x0 0x0000007f931fa4d8: nop This is the syscall sys_rt_sigreturn, Linux kernel function "restore_sigframe" will set the frame: for (i = 0; i < 31; i++) __get_user_error(regs->regs[i], &sf->uc.uc_mcontext.regs[i], err); __get_user_error(regs->sp, &sf->uc.uc_mcontext.sp, err); __get_user_error(regs->pc, &sf->uc.uc_mcontext.pc, err); The struct of uc_mcontext is: struct sigcontext { __u64 fault_address; /* AArch64 registers */ __u64 regs[31]; __u64 sp; __u64 pc; __u64 pstate; /* 4K reserved for FP/SIMD state and future expansion */ __u8 __reserved[4096] __attribute__((__aligned__(16))); }; But in GDB function "aarch64_linux_sigframe_init", the code the get address of registers is: for (i = 0; i < 31; i++) { trad_frame_set_reg_addr (this_cache, AARCH64_X0_REGNUM + i, sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET + i * AARCH64_SIGCONTEXT_REG_SIZE); } trad_frame_set_reg_addr (this_cache, AARCH64_FP_REGNUM, fp); trad_frame_set_reg_addr (this_cache, AARCH64_LR_REGNUM, fp + 8); trad_frame_set_reg_addr (this_cache, AARCH64_PC_REGNUM, fp + 8); The code that get pc and sp is not right, so I change the code according to Linux kernel code: trad_frame_set_reg_addr (this_cache, AARCH64_SP_REGNUM, sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET + 31 * AARCH64_SIGCONTEXT_REG_SIZE); trad_frame_set_reg_addr (this_cache, AARCH64_PC_REGNUM, sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET + 32 * AARCH64_SIGCONTEXT_REG_SIZE); The issue was fixed by this change, and I did the regression test. It also fixed a lot of other XFAIL and FAIL. 2014-05-20 Hui Zhu <hui@codesourcery.com> Yao Qi <yao@codesourcery.com> PR backtrace/16558 * aarch64-linux-tdep.c (aarch64_linux_sigframe_init): Update comments and change address of sp and pc. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 7 +++++ gdb/aarch64-linux-tdep.c | 63 ++++++++++++++++++++++++--------------------- 2 files changed, 41 insertions(+), 29 deletions(-) -- You are receiving this mail because: You are on the CC list for the bug. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug backtrace/16558] GDB Aarch64 signal frame unwinder issue 2014-02-12 2:00 [Bug backtrace/16558] New: GDB Aarch64 signal frame unwinder issue teawater at gmail dot com ` (3 preceding siblings ...) 2014-05-20 5:21 ` cvs-commit at gcc dot gnu.org @ 2014-05-21 0:54 ` teawater at gmail dot com 4 siblings, 0 replies; 6+ messages in thread From: teawater at gmail dot com @ 2014-05-21 0:54 UTC (permalink / raw) To: gdb-prs https://sourceware.org/bugzilla/show_bug.cgi?id=16558 teawater <teawater at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #4 from teawater <teawater at gmail dot com> --- Fixed by patch. -- You are receiving this mail because: You are on the CC list for the bug. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-05-21 0:54 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-02-12 2:00 [Bug backtrace/16558] New: GDB Aarch64 signal frame unwinder issue teawater at gmail dot com 2014-02-12 2:00 ` [Bug backtrace/16558] " teawater at gmail dot com 2014-02-12 2:25 ` teawater at gmail dot com 2014-03-06 8:51 ` teawater at gmail dot com 2014-05-20 5:21 ` cvs-commit at gcc dot gnu.org 2014-05-21 0:54 ` teawater at gmail dot com
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).