l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2003 Oct 28 00:47

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] stdout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] stdout

On Tue, 28 Oct 2003, Julie Russell wrote:

> Hi Everyone,
> I am writing a C++ application using x11 developing on SuSE 8.2 and suddenly
> my stdout (cout and cerr) are not outputting to the console, or piping to a
> file. Has anyone ever experienced this before? I am baffled!

Standard C streams (STDIN/STDOUT/STDERR) and C++ iostreams (cin/cout/cerr)
involve the use of in-process data structures that your program can
demolish if pointers get loose.  Demolished data structures can cause a
wide variety of symptoms... failure to send any data to the system calls
seems like a pretty believable result of corruption of cout and cerr.

As Mark suggests, writing binary data to stdout can activate odd behavior
in terminal emulation code.  However, it sounds like you can't even get
anything through redirection, so this seems less likely in this case.

Finding these kinds of bugs can be frustrating, particularly if your
program frequently changes the data structures (writes data to cout/cerr).
Sometimes you can use watchpoints on the data in gdb, sometimes you just
have to sprinkle code with output statements (be sure to use the
"endl" object to force buffer flushes).

Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!