LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] kdb: Fix btc (backtrace on each cpu) crash
@ 2018-10-30 20:53 Douglas Anderson
  2018-10-31 11:59 ` Daniel Thompson
  0 siblings, 1 reply; 3+ messages in thread
From: Douglas Anderson @ 2018-10-30 20:53 UTC (permalink / raw)
  To: Jason Wessel, Daniel Thompson
  Cc: Tobin C . Harding, joe, Douglas Anderson, stable, kgdb-bugreport,
	linux-kernel

Typing 'btc' on kdb doing all sorts of fail.  Sometimes it would
crash, sometimes display nothing, and sometimes hang.

Bisect tracked this down to the commit ad67b74d2469 ("printk: hash
addresses printed with %p"), suggesting an obvious fix.  The pointer
used internally in kdb shouldn't be hashed, so switch it to %px.

Fixes: ad67b74d2469 ("printk: hash addresses printed with %p")
Cc: stable@vger.kernel.org
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 kernel/debug/kdb/kdb_bt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/debug/kdb/kdb_bt.c b/kernel/debug/kdb/kdb_bt.c
index 6ad4a9fcbd6f..7921ae4fca8d 100644
--- a/kernel/debug/kdb/kdb_bt.c
+++ b/kernel/debug/kdb/kdb_bt.c
@@ -179,14 +179,14 @@ kdb_bt(int argc, const char **argv)
 				kdb_printf("no process for cpu %ld\n", cpu);
 				return 0;
 			}
-			sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu));
+			sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu));
 			kdb_parse(buf);
 			return 0;
 		}
 		kdb_printf("btc: cpu status: ");
 		kdb_parse("cpu\n");
 		for_each_online_cpu(cpu) {
-			sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu));
+			sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu));
 			kdb_parse(buf);
 			touch_nmi_watchdog();
 		}
-- 
2.19.1.568.g152ad8e336-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kdb: Fix btc (backtrace on each cpu) crash
  2018-10-30 20:53 [PATCH] kdb: Fix btc (backtrace on each cpu) crash Douglas Anderson
@ 2018-10-31 11:59 ` Daniel Thompson
  2018-10-31 15:05   ` Doug Anderson
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Thompson @ 2018-10-31 11:59 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Jason Wessel, Tobin C . Harding, joe, stable, kgdb-bugreport,
	linux-kernel

On Tue, Oct 30, 2018 at 01:53:34PM -0700, Douglas Anderson wrote:
> Typing 'btc' on kdb doing all sorts of fail.  Sometimes it would
> crash, sometimes display nothing, and sometimes hang.
> 
> Bisect tracked this down to the commit ad67b74d2469 ("printk: hash
> addresses printed with %p"), suggesting an obvious fix.  The pointer
> used internally in kdb shouldn't be hashed, so switch it to %px.
> 
> Fixes: ad67b74d2469 ("printk: hash addresses printed with %p")
> Cc: stable@vger.kernel.org
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

I think we've already got a fix for this:
https://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb.git/commit/?h=kgdb-next&id=a0ca72c2d1ac83d0853a23ffde8f3624648b1ee8


Daniel.

> ---
> 
>  kernel/debug/kdb/kdb_bt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/debug/kdb/kdb_bt.c b/kernel/debug/kdb/kdb_bt.c
> index 6ad4a9fcbd6f..7921ae4fca8d 100644
> --- a/kernel/debug/kdb/kdb_bt.c
> +++ b/kernel/debug/kdb/kdb_bt.c
> @@ -179,14 +179,14 @@ kdb_bt(int argc, const char **argv)
>  				kdb_printf("no process for cpu %ld\n", cpu);
>  				return 0;
>  			}
> -			sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu));
> +			sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu));
>  			kdb_parse(buf);
>  			return 0;
>  		}
>  		kdb_printf("btc: cpu status: ");
>  		kdb_parse("cpu\n");
>  		for_each_online_cpu(cpu) {
> -			sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu));
> +			sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu));
>  			kdb_parse(buf);
>  			touch_nmi_watchdog();
>  		}
> -- 
> 2.19.1.568.g152ad8e336-goog
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kdb: Fix btc (backtrace on each cpu) crash
  2018-10-31 11:59 ` Daniel Thompson
@ 2018-10-31 15:05   ` Doug Anderson
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Anderson @ 2018-10-31 15:05 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: Jason Wessel, me, Joe Perches, stable, kgdb-bugreport, LKML

Hi,

On Wed, Oct 31, 2018 at 4:59 AM Daniel Thompson
<daniel.thompson@linaro.org> wrote:
>
> On Tue, Oct 30, 2018 at 01:53:34PM -0700, Douglas Anderson wrote:
> > Typing 'btc' on kdb doing all sorts of fail.  Sometimes it would
> > crash, sometimes display nothing, and sometimes hang.
> >
> > Bisect tracked this down to the commit ad67b74d2469 ("printk: hash
> > addresses printed with %p"), suggesting an obvious fix.  The pointer
> > used internally in kdb shouldn't be hashed, so switch it to %px.
> >
> > Fixes: ad67b74d2469 ("printk: hash addresses printed with %p")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Douglas Anderson <dianders@chromium.org>
>
> I think we've already got a fix for this:
> https://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb.git/commit/?h=kgdb-next&id=a0ca72c2d1ac83d0853a23ffde8f3624648b1ee8

Ah ha.  Nice!  Sorry for not noticing this.  The newest I tested was 4.19.

-Doug

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-31 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 20:53 [PATCH] kdb: Fix btc (backtrace on each cpu) crash Douglas Anderson
2018-10-31 11:59 ` Daniel Thompson
2018-10-31 15:05   ` Doug Anderson

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 NNTP newsgroup(s).