This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
AW: probably simple problem: ASSERT in Cyg_StdIostream
- From: "Neundorf, Alexander" <Alexander dot Neundorf at jenoptik dot com>
- To: <ecos-discuss at ecos dot sourceware dot org>
- Date: Thu, 7 Apr 2005 11:22:34 +0200
- Subject: AW: [ECOS] probably simple problem: ASSERT in Cyg_StdIostream
Hi,
> Hi,
>
> probably a simple question, but I already searched on the web
> for an answer but wasn't successful.
> So, I added to my working firmware the File IO package, and
> didn't change anything in the code. Otherwise I don't use the
> POSIX compat. (i.e. no pthreads, no main()).
> Now, when my program starts I get an assert:
>
> ASSERT FAIL: <8>stream.inl[109]cyg_bool
> Cyg_StdioStream::trylock_me() Stream
> object is not a valid stream!
It seems to be the same problem as mentioned here, but there was no reply:
http://sources.redhat.com/ml/ecos-discuss/2003-05/msg00447.html
Here's the code which causes the assert:
void cyg_user_start() {
unsigned int day;
sscanf("1", "%d", &day);
...
and this one doesn't crash:
void cyg_user_start() {
unsigned int day;
sscanf("1 ", "%d", &day); //note the one whitespace after the "1"
It works without problems without the file io package. I have no filesystems mounted. It's ecos cvs from approx. one year ago. The posix compat package isn't included in my ecos configuration, so my application starts from cyg_user_start() as you can see and not from main(). I suspect that there are some missing initialisations in this case somewhere.
Any ideas ?
Bye
Alex
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss