AW: [ECOS] probably simple problem: ASSERT in Cyg_StdIostream

Neundorf, Alexander
Thu Apr 7 09:22:00 GMT 2005


> 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:

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 ?


Before posting, please read the FAQ:
and search the list archive:

More information about the Ecos-discuss mailing list