setlocale and nl_langinfo

Perry Smith pedz at
Fri Jul 16 14:53:23 EDT 2004

Progress so far:

When gnucash starts up, it calls setlocale nine times from various 
places.  setlocale takes two arguments.  The two arguments are:

1)  0  ""  (r4 is a pointer to an empty string)
2)  0 ""
3) 2  0  (r4 is 0 -- FYI, r3 is the first arg, r4 is the second arg on 
a PPC)
4) 0 ""
5) 0  0
6) 2 0
7) 4 0
8) 4 "C"
9 4 "C"

My LANG is set to C.  From gdb, I called nl_langinfo(0) after each of 
these calls finished.  In the first three, I got a reasonable US-ASCII 
reply.  After call #4, nl_langinfo(0) returns a pointer to an empty 

Here is the stack trace at the entry of the fourth call to setlocal:
(gdb) where
#0  0x90021164 in setlocale ()
#1  0x0101a25c in gdk_set_locale () at gdkim.c:110
#2  0x013b82b0 in gnome_init_cb ()
#3  0x00112c28 in invokeCallbacks ()
#4  0x0011272c in poptGetContext ()
#5  0x004734bc in gnomelib_parse_args ()
#6  0x013b7e70 in gnome_init_with_popt_table ()
#7  0x02f28c84 in gnc_gnome_init (arg0=0x0, progname=0x0, 
version=0x47a568 "", command_line=0x1) at gnc-gnome-utils.c:88
#8  0x031b2928 in gnc_gui_init_splash (command_line=0x0) at 
#9  0x000c7354 in gw__tmp803_gnc_gui_init_splash_wrapper 
(gw__scm_arg0=0x0) at gw-gnc.c:382
#10 0x0017439c in scm_ceval (x=0x2974, env=0x7fe48) at eval.c:2736
#11 0x001737b8 in scm_ceval (x=0x2974, env=0x7fe48) at eval.c:2437
#12 0x00172568 in scm_ceval (x=0x2974, env=0x7fe48) at eval.c:2017
#13 0x001724ec in scm_ceval (x=0x2974, env=0x7fe48) at eval.c:1987
#14 0x0016aa34 in scm_internal_dynamic_wind (before=0x9c9c8, inner=0, 
after=0x2974 <_dyld_init_check+4>, inner_data=0x7fe48, 
guard_data=0x2974) at dynwind.c:168
#15 0x001ab898 in scm_shell (argc=641480, argv=0x2974) at script.c:676
#16 0x0018dc68 in invoke_main_func (body_data=0x24002422) at init.c:636
#17 0x0018dc1c in scm_boot_guile_1 (base=0x0, closure=0xbfffe3e0) at 
#18 0x0018d958 in scm_boot_guile (argc=0, argv=0x102c310, 
main_func=0x1f0, closure=0x1) at init.c:440
#19 0x00002d84 in main (argc=276736, argv=0xbfffe510) at guile.c:94

My current thoughts are that I have stumbled into a more general 
problem than getting the back end to work.  I would appear to me that 
by the time gnucash displays the account ledgers, the local has been 
trashed -- at least on a Mac (or perhaps I should say -- at least on My 
Mac :-)

I know very little about locale stuff.  I plan to look at gdkim.c a bit 
but any help and advice would be appreciated.


More information about the gnucash-devel mailing list