Subject: Re: strange setlocale() issue
To: None <tech-userlevel@NetBSD.org>
From: Markus Illenseer <markus@core.de>
List: tech-userlevel
Date: 10/14/2003 06:35:39
> Surely ktrace shows _something_.  For example, does the process die
> from exit(), or from a signal (and if the latter, which signal)?

 Stops from exit() and no signal.

> I'm with greywolf: I'd run it under gdb.  "break main", "run", then
> when it breaks at the beginning of main, repeatedly "step" and see what
> happens.  (I'd try it myself, but I have nothing even vaguely current
> to try it on.)

 here is what I get:

(gdb) break main
Breakpoint 1 at 0x804894a: file test_locale.c, line 6.
(gdb) run
Starting program: /home/markus/src/./test_locale

Breakpoint 1, main () at test_locale.c:6
6               const char *foo = "bar";
(gdb) step
7               printf("Start\n");
(gdb) step
Start
8               if( NULL == setlocale(LC_ALL, "zh_TW.eucTW") )
(gdb) step
15              printf("Start2\n");
(gdb) step
16                      printf("OK %s\n", foo);
(gdb) step
18              printf("End\n");
(gdb) step
19      }
(gdb) step
0x8048750 in ___start ()
(gdb) step
Single stepping until exit from function ___start,
which has no line number information.

Program exited normally.


 Seems to go into the "else"-clause but then does nothing. "Start2" is
not printed, nor is "OK". Is that because there is no locale found for
this? Where is that __start() function hidden?

Markus Illenseer