Subject: Re: strange setlocale() issue
To: Markus Illenseer <>
From: Dave Huang <>
List: tech-userlevel
Date: 10/13/2003 17:27:43
On Mon, Oct 13, 2003 at 10:46:56PM +0200, Markus Illenseer wrote:
> This small programm does not work as expected:

>  It does print "Start" and then exits (!) with no error, coredump or
> whatsoever. The other printf() commands are completely ignored, which
> makes me believe, that the setlocale() in the if-clause crashes. A ktrace,
> ktruss and gdb trace did not reveal anything, though.

It seems that the call to setlocale() breaks stdio somehow. If you
replace the printf()s with write(STDOUT_FILENO, ...), and/or put a
"return 1234;" at the bottom, you'll see that the program actually
runs all the way through. The printf()s just don't output anything
after that first call to setlocale().
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 27 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++