This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Assert due to stack problem
- From: Gary Thomas <gthomas at ecoscentric dot com>
- To: Daniel Lidsten <Daniel dot Lidsten at combitechsystems dot com>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: 19 Nov 2002 02:40:16 -0700
- Subject: Re: [ECOS] Assert due to stack problem
- References: <004B1D7A5257174C9044A1B7BD0E60ED232C54@ratatosk.combitechsystems.com>
On Tue, 2002-11-19 at 02:11, Daniel Lidsten wrote:
> Hi,
>
> I got some strange errors when running my system. Since i am debugging then i have the assert enabled and as i understand then everytime CYG_ASSERT checks a thread then it calls the function "Cyg_Thread::check_this". This function returns false and therefor my system hang. After digging out the real error then it seems like i have some stack problem - which i am a bit sceptical about.
>
> The output from assert is the following:
> [check_this]System stack pointer BELOW STACKBASE (ptr:95134 < base:1720f0)
>
> The code for printing this are:
> Cyg_Thread::check_this( cyg_assert_class_zeal zeal) const
> {
> .....
>
> if( stack_ptr < stack_base )
> {
> diag_printf("\n[%s]System stack pointer BELOW STACKBASE (ptr:%x < base:%x)", __FUNCTION__,stack_ptr , stack_base);
> return false;
> }
> .....
> }
>
> As you can see, the "check" function makes sure that the stack pointer is within legal values. The legal values are defined as the upper and lower walls for the entire stack. However, when i look for what is located and the memory address where my stack pointer is poniting then i found the follwoing:
>
> .bss 0x00093500 0x2020 C:\Amersham\cu901\ecos_configuration\CU_ecos_rel29dalids_install\lib/vectors.o
> 0x00093500 cyg_interrupt_stack_base
> 0x00095500 cyg_interrupt_stack
>
> I think that maybe the assert check that is performed above is not valid and should be removed. Am i missing something here? Why isn't the interrupt stack placed within the region of the rest of the stack?
It looks like you are running on the interrupt stack at this moment.
This will only happen whilst running ISR or DSR functions and I
would guess that you are calling some function (from the ISR/DSR
context) which is then trying to perform some thread operation
which would be illegal from this context.
Can you run this under GDB? If so, set a breakpoint at cyg_assert_fail
and then get a backtrace to determine what caused the assert.
--
------------------------------------------------------------
Gary Thomas |
eCosCentric, Ltd. |
+1 (970) 229-1963 | eCos & RedBoot experts
gthomas@ecoscentric.com |
http://www.ecoscentric.com/ |
------------------------------------------------------------
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss