Subject: strange setlocale() issue
To: None <tech-userlevel@NetBSD.org>
From: Markus Illenseer <email@example.com>
Date: 10/13/2003 22:46:56
This small programm does not work as expected:
const char *foo = "bar";
if( NULL == setlocale(LC_ALL, "zh_TW.eucTW") )
/* yes, I know, the 2nd argument should not be NULL */
printf("error! locale is: %s\n", setlocale(LC_ALL, NULL));
printf("OK %s\n", foo);
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.
Any idea what might happen here?
I am hunting down this bug for several days now, which started as a crash
of my Apache/PHP when using the above setlocale().