public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] assertion error in stdio
@ 2000-07-10 14:22 James Kahkoska
  2000-07-11  6:37 ` Bart Veer
  0 siblings, 1 reply; 3+ messages in thread
From: James Kahkoska @ 2000-07-10 14:22 UTC (permalink / raw)
  To: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2254 bytes --]

I am having a problem with eCos when I turn on 
asserts in eCos. I thought everything I/O related was working ok but when I 
turn on assertions, I get the following assertion error:
 
ASSERT FAIL: 
stream.cxx          [  79] 
Cyg_StdioStream::Cyg_StdioStream() Attempt to open invalid 
device!
 
The call stack looks 
like hal_misc.c\cyg_hal_invoke_constructors() Line #92 (0x0001C930)   
stdout.cxx\global constructors keyed to 50000.cyg_libc_stdio_stdout() Line #90 
(0x00020240)     
stdiofiles.inl\__static_initialization_and_destruction_0() Line #83 
(0x000200DC)       
stream.cxx\Cyg_StdioStream::Cyg_StdioStream(void *, Cyg_StdioStream::OpenMode, 
bool, bool, int, unsigned int, unsigned char *)() Line #82 
(0x00020328)         
buffer.cxx\cyg_assert_fail() Line #741 (0x0001DE84)
 
It appears the Cyg_StdioStream::Cyg_StdioStream 
contructor is being passed a NULL for the device and the assertion catches 
that. I went further into the code and this originates in stdout.cxx 
cyg_libc_stdio_stdout() Line #90
 
  // And here's an instance of the class just 
to make the code run   static cyg_libc_dummy_stdout_init_class 
cyg_libc_dummy_stdout_init    
                                       
CYG_INIT_PRIORITY(LIBC)
 
The constructor ends up calling calling  

 
  Cyg_libc_stdio_files::set_file_stream( fd_t 
fd, Cyg_StdioStream *stream )
 
which invokes the 
Cyg_StdioStream::Cyg_StdioStream(cyg_io_handle_t dev, constructor with a null 
device.      CYG_CHECK_DATA_PTR(dev, "Attempt to open 
invalid device!");
 
Without asserts enabled my printf's to stdout seem 
to work fine. I am not sure about this dummy class and single static instance 
that causes the assertion to fail. The comment is my only clue to it's 
existence:
 
// This is a dummy class just so we can execute 
arbitrary code when // stdout is requested
 
Any ideas as to why I need this dummy class or why 
it might be blowing up?
 
Thanks, James
 
 
James Kahkoska jkahkoska@wire-less-inc.com 719-528-8885 
x104

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-07-11  6:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-10 14:22 [ECOS] assertion error in stdio James Kahkoska
2000-07-11  6:37 ` Bart Veer
2000-07-11  6:43   ` Dave Airlie

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).