This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Global variables get corrupted


"Ravi Joshi" <ravijoshi@operamail.com> writes:

> Hi All,
> 
> 
> The global variables defined in the downstream thread get corrupted
> as soon as the control comes to the callback function or the
> upstream thread hence no global variables can be used after that,
> but the local variable values defined in the downstream thread are
> fine.
> 

> Can anybody please suggest some solution for this issue.
> 

In my experience, the most common cause of global variables being
corrupted is stack overflow. So check that the stacks you are
allocating for your threads are large enough for the Bluetooth stack's
needs.

The easisest way to see whether this is the problem is to increase the
size of your stacks by a large amount: double or quadruple the size,
or add 10k or more. You can also turn on the stack overflow checking
and see if it triggers.

Once you have made your stacks big enough you can then look at how
much is actually used and trim them to fit more closely.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]