Re: (reiserfs hang at boot) where is the kernel debugger?

From: Keith Owens (kaos@ocs.com.au)
Date: Tue Oct 03 2000 - 10:28:30 EST


On Sun, 1 Oct 2000 23:50:17 -0300 (BRST),
Rik van Riel <riel@conectiva.com.br> wrote:
>On Sun, 1 Oct 2000, David Ford wrote:
>> During normal operation of the machine, -T shows processes
>> having PCs of 0x00000000 and 0x7f000000 which strikes me as a
>> bit odd.
>>
>> For e.g. the following:
>>
>> sshd S 7FFFFFFF 0 247 88 248 (NOTLB)
>> 121
>> sig: 0 0000000000000000 0000000000000000 : X
>> bash S 00000000 0 248 247 263 (NOTLB)
>> sig: 0 0000000000000000 0000000000010000 : X
>
>Sysrq-T is broken on x86 ;((((((((
>
>(very much to my dismay ... this is one of the best
>debugging helps we have^Whad and I could have used
>it quite well)

show_task() calls thread_saved_pc() which is giving bad results.
Getting the correct PC for blocked threads is easy,

Index: 0-test9-pre9.3/include/asm-i386/processor.h
--- 0-test9-pre9.3/include/asm-i386/processor.h Tue, 08 Aug 2000 16:14:08 +1000 kaos (linux-2.4/P/18_processor. 1.1.1.5 644)
+++ 0-test9-pre9.3(w)/include/asm-i386/processor.h Wed, 04 Oct 2000 01:48:32 +1100 kaos (linux-2.4/P/18_processor. 1.1.1.5 644)
@@ -411,7 +411,7 @@ extern void forget_segments(void);
  * Return saved PC of a blocked thread.
  */
 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
 {
- return ((unsigned long *)t->esp)[3];
+ return (t->eip);
 }

But it does not give you much. Thread esp and eip are only saved
during switch_to(), at which point eip always points to schedule+0x42c.
If the task is running on a cpu (the interesting case) then neither
t->esp nor t->eip contain useful values so you cannot get the PC for
running tasks.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Oct 07 2000 - 21:00:12 EST