* AW: [ECOS] probably simple problem: ASSERT in Cyg_StdIostream
@ 2005-04-07 9:22 Neundorf, Alexander
0 siblings, 0 replies; 2+ messages in thread
From: Neundorf, Alexander @ 2005-04-07 9:22 UTC (permalink / raw)
To: ecos-discuss
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* AW: [ECOS] probably simple problem: ASSERT in Cyg_StdIostream
@ 2005-04-08 14:29 Neundorf, Alexander
0 siblings, 0 replies; 2+ messages in thread
From: Neundorf, Alexander @ 2005-04-08 14:29 UTC (permalink / raw)
To: Neundorf, Alexander, ecos-discuss
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-04-08 14:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-07 9:22 AW: [ECOS] probably simple problem: ASSERT in Cyg_StdIostream Neundorf, Alexander
2005-04-08 14:29 Neundorf, Alexander
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).