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: "Neundorf, Alexander" <Alexander dot Neundorf at jenoptik dot com>, <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 8 Apr 2005 16:29:01 +0200
- Subject: AW: [ECOS] probably simple problem: ASSERT in Cyg_StdIostream
Hi,
...
> > 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);
I got some more information: the assert hits because neither the magic_code of stdin nor of stdout are set correctly. They aren't set because for both buffer_size==-1 and WANT_BUFFERED_IO is true in Cyg_StdioStream::initialize(). CYG_LIBC_STDIO_BUFSIZE has the default value of 256.
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