[Crash-utility] [PATCH v7 11/15] Conditionally output gdb stack unwinding stop reasons

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When gdb stack unwinding is enabled, gdb will output the stack trace
along with a unwinding stop reason. This is often seen at the end of
kernel stack unwinding where a userspace stack/context-switch is reached,
gdb fails to recongnize it and output the stop reason indicating the
error.

Though the stack unwinding is correct, but the error message might
confuse users. So we will output the message conditionally instead of
filter it out, since the message might be useful to experienced users.

To view the unwind stopping info:

crash> gdb bt
#0  0xc0000000002bde04 in crash_setup_regs ... 
...
#12 0xc00000000000d05c in system_call_vectored_common () ...
crash> set debug 1
debug: 1
crash> gdb bt
#0  0xc0000000002bde04 in crash_setup_regs ...
...
#12 0xc00000000000d05c in system_call_vectored_common () ...
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Cc: Sourabh Jain <sourabhjain@xxxxxxxxxxxxx>
Cc: Hari Bathini <hbathini@xxxxxxxxxxxxx>
Cc: Mahesh J Salgaonkar <mahesh@xxxxxxxxxxxxx>
Cc: Naveen N. Rao <naveen.n.rao@xxxxxxxxxxxxxxxxxx>
Cc: Lianbo Jiang <lijiang@xxxxxxxxxx>
Cc: HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@xxxxxxx>
Cc: Tao Liu <ltao@xxxxxxxxxx>
Cc: Alexey Makhalov <alexey.makhalov@xxxxxxxxxxxx>
Cc: Aditya Gupta <adityag@xxxxxxxxxxxxx>
Signed-off-by: Tao Liu <ltao@xxxxxxxxxx>
---
 gdb-10.2.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gdb-10.2.patch b/gdb-10.2.patch
index 7f66e5c..54716dc 100644
--- a/gdb-10.2.patch
+++ b/gdb-10.2.patch
@@ -16203,3 +16203,14 @@ exit 0
  	  print_frame_info (fp_opts, fi, 1, LOCATION, 1, 0);
  	  if ((flags & PRINT_LOCALS) != 0)
  	    {
+--- gdb-10.2/gdb/stack.c.orig
++++ gdb-10.2/gdb/stack.c
+@@ -2127,7 +2127,7 @@
+ 	  enum unwind_stop_reason reason;
+ 
+ 	  reason = get_frame_unwind_stop_reason (trailing);
+-	  if (reason >= UNWIND_FIRST_ERROR)
++	  if (reason >= UNWIND_FIRST_ERROR && gdb_CRASHDEBUG(1))
+ 	    printf_filtered (_("Backtrace stopped: %s\n"),
+ 			     frame_stop_reason_string (trailing));
+ 	}
-- 
2.40.1
--
Crash-utility mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxxxxxx
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux