NetBSD-Bugs archive

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

port-sparc64/54221: sparc64: ddb trace not working as expected



>Number:         54221
>Category:       port-sparc64
>Synopsis:       sparc64: ddb trace not working as expected
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 21 17:20:00 +0000 2019
>Originator:     Tobias Ulmer
>Release:        NetBSD 8.99.41
>Organization:
>Environment:
NetBSD u60.tmux.org 8.99.41 NetBSD 8.99.41 (GENERIC.DEBUG) #2: Tue May 21 18:17:19 CEST 2019
>Description:
When in ddb, trace reports only one line of information.

Example (64):
db{0}> trace/t 0t655
trace: pid 655 lid 1 at 0x178e370f1
db{0}>

This is due to an excessive check on stack frame location in 64 bit mode.

It's possible to work around this by specifying /u, but that
only became obvious after inspecting the source.
>How-To-Repeat:

>Fix:
VM_MAX_KERNEL_ADDRESS seems most appropriate for 32 and 64 bit configurations.
Tested on both, works as expected.

diff --git a/sys/arch/sparc64/sparc64/db_trace.c b/sys/arch/sparc64/sparc64/db_trace.c
index 174dec39bd5c..84262b712688 100644
--- a/sys/arch/sparc64/sparc64/db_trace.c
+++ b/sys/arch/sparc64/sparc64/db_trace.c
@@ -163,7 +163,7 @@ db_stack_trace_print(db_expr_t addr, bool have_addr, db_expr_t count,
 		if (kernel_only) {
 			if (pc < KERNBASE || pc >= KERNEND)
 				break;
-			if (frame < KERNBASE || frame >= EINTSTACK)
+			if (frame < KERNBASE || frame > VM_MAX_KERNEL_ADDRESS)
 				break;
 		} else {
 			if (frame == 0 || frame == (vaddr_t)-1)



Home | Main Index | Thread Index | Old Index