This is the mail archive of the ecos-discuss@sourceware.org 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: using threads causes exceptions


Hi,

Gary Thomas <gary@mlbassoc.com> writes:

On Wed, 2005-08-03 at 19:03 +0200, Stefan Sommerfeld wrote:

> >> >> >> Program received signal SIGTRAP, Trace/breakpoint trap.
> >> >> >> [Switching to Thread 2]
> >> >> >> 0xa008c72c in main_stack ()

main_stack[] is defined in the POSIX compatibility package. This package executes main() in a thread, so that it behaves compatibly with other POSIX implementations.

In fact in most configurations where main() can be used, it is
executed in a thread. So, calling cyg_scheduler_start() again is
likely to corrupt the scheduler.

If you need control over when cyg_scheduler_start() is called, then do
your startup in cyg_start(). Alternatively use cyg_user_start() to
have the scheduler started automatically.


Big thanks to you Nick, that's it. I enabled POSIX compatiblity to use my C++ exceptions, but using eCos kernel threading seems to conflict with it. Now i use posix threads and i have no exceptions anymore, no MMU and no crashes with gdb output.


But this had one good thing :)... I added some MMU error output in the exception dump for ARM. I will release the patch soon.

Once again, thank you all for your quick help.

Bye...


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


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