Stack Checker in rtems-4.8.0 - is it broken?
Joel Sherrill
joel.sherrill at OARcorp.com
Wed Mar 5 12:22:19 UTC 2008
Robert S. Grimes wrote:
> Joel Sherrill wrote:
>
>> Robert S. Grimes wrote:
>>
>>> Hi,
>>>
>>> Does the stack checker still work? My app using powerpc/virtex BSP
>>> seems to fail on startup when the stack checker task is created in
>>> taskinitusers.c/_RTEMS_tasks_Initialize_user_tasks_body(). I get an
>>> exception 7 - here is the dump:
>>>
>>>
>>>
>> There is no stack checker task. It is a user extension.
>>
> That makes infinitely more sense! ;-) I was misled by the context -
> silly me.
>
>
>> It works in 4.8 as far as the test program stackchk.exe goes.
>>
> I figured you'd say that...
>
>> You are on the "BSP initialization stack" at this point in the program
>> initialization. I suspect you have blown your initialization stack
>> or the RTEMS workspace and the BSP initialization stack overlap.
>> Thus when the stack checker writes the pattern for the first
>> created task, it destroys the stack you are running on.
>>
>> Does this make sense?
>>
> Sure, if that is indeed what is going on. I'm not sure where to look on
> this, and I won't be able to check on it until Friday (FWIW - the only
> truly frustrating thing about my project is I only work 18-20 hours
> during two days a week, and I always seem to be finding problems at the
> end of one day, and I can't get back to it until several days later!)
> Anyway, I'll look into it then, and report back - until then, assume it
> is in my BSP...
>
My standard recommendation in this case is to carefully
draw a memory map which includes the starting and ending
address of the following:
+ Initialization stack
+ C Program Heap
+ RTEMS Workspace
+ Your code data and bss sections
+ any interrupt vector areas
+ any memory reserved for rom monitor or loader
This information should be documented with the BSP anyway. but
usually isn't.
In your case, I am almost certain the initialization stack and the
RTEMS Workspace overlap.
--joel
> Thanks!
> -Bob
>
>>> Exception handling initialization done
>>> opb_intc_init: mexception handler called for exception 7
>>> Next PC or Address of fault = A5A5A5A4
>>> Saved MSR = 0
>>> R0 = A5A5A5A5
>>> R1 = 4A7EB4
>>> R2 = 4853A8
>>> R3 = 1
>>> R4 = A5
>>> R5 = 0
>>> R6 = FEFFFFFF
>>> R7 = 490000
>>> R8 = 490AAC
>>> R9 = 4A9C78
>>> R10 = 1
>>> R11 = 4A9C78
>>> R12 = 0
>>> R13 = FFFEAAFC
>>> R14 = FFFFFFFF
>>> R15 = FFFFFFFF
>>> R16 = FFFFFFFF
>>> R17 = FFFFFFFF
>>> R18 = FFFFFFFF
>>> R19 = FFFFFFFF
>>> R20 = FFFFFFFF
>>> R21 = FFFE2E6C
>>> R22 = FFFE0000
>>> R23 = FFFE0000
>>> R24 = 0
>>> R25 = 490984
>>> R26 = 1
>>> R27 = 0
>>> R28 = 490000
>>> R29 = 490C2C
>>> R30 = 4A0F38
>>> R31 = A5A5A5A5
>>> CR = 28008022
>>> CTR = 0
>>> XER = 20000000
>>> LR = A5A5A5A5
>>> MSR = 0
>>> DAR = 0
>>> Stack Trace:
>>> IP: 0xA5A5A5A4, LR: 0xA5A5A5A5
>>> --^ 0x00000000
>>> unrecoverable exception!!! Push reset button
>>>
>>> Turning off the stack checker allows my application to proceed
>>> normally...
>>>
>>> Any ideas? Thanks!
>>> -Bob
>>>
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.com
>>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>>
>>>
>>
>
>
>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list