Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-05 Thread Larry Baker
On 4 Oct 2012, at 1:05 PM, Larry Baker wrote: > I am still puzzled, though, why uClinux is silent when a program is aborted > when it receives an unhandled fatal signal. Mainline Linux (really the > shell?) prints out a message like > >> [root@atompc sdk]# ./SIGILL >> Illegal instruction > >

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-04 Thread Larry Baker
Enabling kernel parameter print-fatal-signals worked out nicely: > / # echo 1 >/proc/sys/kernel/print-fatal-signals > / # trap > trap/82: potentially unexpected fatal signal 4. > > > Format 04 Vector: 009c PC: 4052812e Status: Not tainted > ORIG_D0: D0: 405285c8 A2: 40529f6

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-03 Thread Larry Baker
Geert, On Oct 3, 2012, at 10:00 PM, Geert Uytterhoeven wrote: >> I'm still looking for the conditions it takes to have something like >> show_registers() in arch/m68k/kernel/traps.c called when the trap occurs. > > The registers are only printed for exceptions caused in kernel mode. The print-f

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-03 Thread Geert Uytterhoeven
Hi Larry, On Thu, Oct 4, 2012 at 7:15 AM, Larry Baker wrote: > On Oct 3, 2012, at 10:00 PM, Geert Uytterhoeven wrote: > >>> I'm still looking for the conditions it takes to have something like >>> show_registers() in arch/m68k/kernel/traps.c called when the trap occurs. >> >> The registers are on

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-03 Thread Larry Baker
Geert, On Oct 3, 2012, at 10:00 PM, Geert Uytterhoeven wrote: >> I'm still looking for the conditions it takes to have something like >> show_registers() in arch/m68k/kernel/traps.c called when the trap occurs. > > The registers are only printed for exceptions caused in kernel mode. Is this a d

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-03 Thread Geert Uytterhoeven
On Wed, Oct 3, 2012 at 11:38 PM, Larry Baker wrote: > > It would be pretty easy to just add a whole bunch of debug trace in > > the kernel when you get this - just for debugging purposes of course. > > Probably makes no sense for a user space process to catch the SIGILL > > in this case. You are o

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-03 Thread Greg Ungerer
Hi Larry, On 10/04/2012 11:16 AM, Larry Baker wrote: On 3 Oct 2012, at 3:06 PM, Larry Baker wrote: In the mean time, I'll try using _end instead of __stack_start for the stack limit symbol. gcc -fstack-limit-symbol=_end works. I don't know the ld scripting language. I will try to figure

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-03 Thread Larry Baker
Greg, On 3 Oct 2012, at 3:06 PM, Larry Baker wrote: > In the mean time, I'll try using _end instead of __stack_start for the stack > limit symbol. gcc -fstack-limit-symbol=_end works. > I don't know the ld scripting language. I will try to figure out how to > define __start_stack to have the

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-03 Thread Larry Baker
Greg, As far as my task 2) to properly detect stack overflow, I think the source of my problem is that the __stack_start symbol is not correctly defined. I found the flthdr -k option to enable the FLAT_FLAG_KTRACE flag for printing the executable layout. > # toolchains/freescale-coldfire-2011

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-03 Thread Larry Baker
Greg, On 3 Oct 2012, at 12:00 AM, Greg Ungerer wrote: For stack checking to be useful, I need two things: 1) it has to detect the (preferably impending) occurrence of a stack overflow, and 2) it has to give notice that it has occurred. For task 2), I'm trying to figure out how to enable the ty

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-02 Thread Greg Ungerer
Hi Larry, On 03/10/12 10:45, Larry Baker wrote: I don't recall off-hand what you will see by forcing a trap 7. But it is easy to check, try a strait trap 7 call in a test program. I hacked the .s file to force a trap #7. That looked like a normal program exit -- no messages on the console, n

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-10-02 Thread Larry Baker
Greg, > I don't recall off-hand what you will see by forcing a trap 7. > But it is easy to check, try a strait trap 7 call in a test program. I hacked the .s file to force a trap #7. That looked like a normal program exit -- no messages on the console, nothing in dmesg or /var/log/messages. I

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-09-27 Thread Greg Ungerer
Hi Larry, On 09/27/2012 10:08 AM, Larry Baker wrote: I hacked the .s file for my stack check test program. I haven't had a minute to look over the code yet. Will get back to you on that. [snip] There must be code between __stack_start and the initial stack pointer. Yes? No code in that r

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-09-26 Thread Greg Ungerer
Hi Larry, On 27/09/12 06:25, Larry Baker wrote: On 09/26/2012 12:49 PM, Larry Baker wrote: I have been chasing what I suspect are stack overflows in NTP. I spotted mention of that there was a gcc option, -fstack-check-symbol=__stack_start, for run-time stack checking on uClinux. I tried tha

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-09-26 Thread Larry Baker
Greg, I hacked the .s file for my stack check test program. The C code: > # cat stack-overflow.c#include > > void overflow( int i ) { > > /* Allocate automatic array j[256] so stack limit checking works. */ > >int j[256]; > > /* Stack limit checking tests only whether the stack is large

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-09-26 Thread Larry Baker
Greg, > Hi Larry, > > On 09/26/2012 12:49 PM, Larry Baker wrote: >> I have been chasing what I suspect are stack overflows in NTP. I spotted >> mention of that there was a gcc option, -fstack-check-symbol=__stack_start, >> for run-time stack checking on uClinux. I tried that, but it caused an

Re: [uClinux-dev] __stack_start for ColdFire uClinux

2012-09-26 Thread Greg Ungerer
Hi Larry, On 09/26/2012 12:49 PM, Larry Baker wrote: I have been chasing what I suspect are stack overflows in NTP. I spotted mention of that there was a gcc option, -fstack-check-symbol=__stack_start, for run-time stack checking on uClinux. I tried that, but it caused an internal compiler