Skip to contentSkip to conversation

2.6.14-rc3-rt10 crashes on boot

DISCUSSION Steven Rostedt 2 participants 2 messages Oct 7, 2005 – Oct 11, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

John, Please don't strip the CC list. Ingo may want to see what's happening, and besides, it's not proper netiquette for LKML.

Quoted 25 lines · John Rigg
Quoted 4 lines · On Friday, October 7 Steve Rostedt wrote:

Add this patch and it will add the option for you in x86_64 (I forgot that you were using that). I even set it to be default on. I didn't add a test in do_IRQ, but I believe that the tests in latency.c should be good enough.

Hi Steve,

Thanks for the patch. I applied it to 2.6.14-rc3-rt12, looked in arch/x86_64/Kconfig.debug just to be sure it applied OK to -rt12, then ran make. It failed to compile, with the following message:

CC kernel/rt.o
CC kernel/latency.o
kernel/latency.c: In function '__print_worst_stack':
kernel/latency.c:336: warning: format '%d' expects type 'int', but argument 5 has type 'long unsigned int' kernel/latency.c:384:3: error: #error Poke the author of above asm code line ! kernel/latency.c: In function 'debug_stackoverflow':
kernel/latency.c:386: error: 'STACK_WARN' undeclared (first use in this function) kernel/latency.c:386: error: (Each undeclared identifier is reported only once kernel/latency.c:386: error: for each function it appears in.)
make[1]: *** [kernel/latency.o] Error 1
make: *** [kernel] Error 2

Quoted 2 lines

I wonder if DEBUG_STACKOVERFLOW was left out of x86_64 for this reason.

Here's an addon patch to my last one. I don't know x86_64 very well, but I believe the the asm is pretty much the same, so this patch removes the check for __i386__ and also defines STACK_WARN.

I'm leaving for the weekend, so you are now on your own. Unless you get help from others. ;-)

-- Steve

include/asm-x86_64/page.h +2 -0
Index: linux-rt-quilt/include/asm-x86_64/page.h
===================================================================
@@ -21,6 +21,8 @@
 #endif
 #define CURRENT_MASK (~(THREAD_SIZE-1))
 
+#define STACK_WARN             (THREAD_SIZE/8)
+
 #define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1))
 #define LARGE_PAGE_SIZE (1UL << PMD_SHIFT)
 
kernel/latency.c +2 -1
Index: linux-rt-quilt/kernel/latency.c
===================================================================
@@ -377,7 +377,8 @@
 	atomic_inc(&tr->disabled);
 
 	/* Debugging check for stack overflow: is there less than 1KB free? */
-#ifdef __i386__
+#if 1 // def __i386__
+	/* Hopefully this works on x86_64!  */
 	__asm__ __volatile__("andl %%esp,%0" :
 				"=r" (stack_left) : "0" (THREAD_SIZE - 1));
 #else
#2 lore raw
Quoted 5 lines · Steven Rostedt
Quoted 1 line

I wonder if DEBUG_STACKOVERFLOW was left out of x86_64 for this reason.

Here's an addon patch to my last one. I don't know x86_64 very well, but I believe the the asm is pretty much the same, so this patch removes the check for __i386__ and also defines STACK_WARN.

this wont work on x64 - but i've now implemented this in my tree and it should work fine in -rc4-rt1.

Ingo