Re: [Tuxpaint-devel] Locale detection problem on 64bit version for windows.
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: Bill K. <nb...@so...> - 2021-10-26 10:08:23
|
On Mon, Oct 25, 2021 at 01:30:01PM -0400, Mark K. Kim wrote:
> > I found that the crash occurs in mysetenv() in i18n.c when
> > strlen(value) is called.
>
> I'm not sure if it's related, but getenv/putenv are known to be not
> thread-safe, and we do use them liberally and do use threads at
> initialization.
Well here it sounds like `value` is coming back as NULL or garbage,
hence Shin-ichi's `printf("%s", loc);` also crashing.
The place where `_nl_locale_name()` is called is within `i18n.c`'s
`set_current_language()` function, which in turn is called by that
same source file's `setup_i18n()` function.
`setup_i18n` is called, in `tuxpaint.c`, within `setup_config()`.
This gets called in `main()` _before_ our own threading stuff happens
("FORKED_FONTS").
So I don't think that's the issue...
Shin-ichi, I wonder if it'd be sufficient to just check whether
`_nl_locale_name()` returns NULL. If so, we can set `loc` to "C",
like so (maybe? I'm struggling to remember how all this works):
...
#ifdef _WIN32
if (!*loc) {
loc = _nl_locale_name(LC_MESSAGES, "");
if (loc == NULL) {
loc = strdup("C");
}
}
#else
...
-bill!
> On Mon, Oct 25, 2021 at 11:24 AM TOYAMA Shin-ichi <sh...@wm...>
> wrote:
>
> > Hi developpers,
> >
> > At first, please take note that the problem is that 64bit
> > executable for windows crash when it start unless specific locale
> > is set by config/command line option/environment variable.
> >
> > I found that the crash occurs in mysetenv() in i18n.c when
> > strlen(value) is called.
> >
> > The address of the string 'value' is passed from 'loc' which is
> > set by calling _nl_locale_name() in set_current_language().
> >
> > I checked the return value 'loc' from _nl_locale_name() by;
> >
> > printf("%s", loc);
> >
> > It results "ja_JP" on 32bit executable but, crash occurs on 64bit
> > version.
> >
> > I am quite at a loss how I should do so far.
> >
> > Anyway, I think it would be better to stop releasing the 64bit
> > version until this will be fixed.
> >
> > Thanks.
> >
> > Bill Kendrick wrote in <202...@sh...>
> > >On Mon, Oct 25, 2021 at 12:53:48AM +0900, TOYAMA Shin-ichi wrote:
> > >> By the way, workaround for this is to set language to something
> > >> other than (Use system's setting) by tuxpaint-config, so far.
> > >
> > >Very interesting! Thanks, Shin-ichi. I had a person email me
> > >this evening mentioning TP won't start on their new Win11 system,
> > >so I've suggested this work-around. (I'll let you know if they
> > >tell me that it _didn't_ help :) )
> > >
> > >-bill!
> > >
> > >
> > >>
> > >> TOYAMA Shin-ichi wrote in <61758024.4995%sh...@wm...>
> > >> >Well, I may have found a clue.
> > >> >It had nothing to do with the priviledges.
> > >> >
> > >> >The problem is that 64bit version runs on my account and does not
> > >> >run on the other user's account.
> > >> >
> > >> >Difference between two users were environmental variable.
> > >> >I have set 'LANG' environmet variable as ja_JP.UTF-8 and LANG has
> > >> >not been set on the other user's account.
> > >> >
> > >> >Then, I tested 64bit package by unsetting 'LANG' on my account,
> > >> >and found it does not start. (Strangely 32 bit version starts with
> > >> >no problem....)
> > >> >
> > >> >The worse is that this problem has nothing to do with the recent
> > >> >changes in source code, but seems to related with some change in
> > >> >tha latest MinGW/MSYS environment, because now I never be able to
> > >> >build 64bit package which runs on the other account even using
> > >> >original tar-ball of version 0.9.26.
> > >> >
> > >> >You see the first release of 64bit 0.9.26 does not have this
> > >> >problem. (Although it has crash bug regarding osk and label)
> > >> >
> > >> >Bill,
> > >> >
> > >> >Could you test on your son's PC to set LANG to "C" or something in
> > >> >"advanced system properties" dialogue?
> > >> >
> > >> > http://www.tenuser.com/spec/properties.htm
> > >> >
> > >> >(you need to sign out and sign in again after changin system
> > properties)
> > >> >
> > >> >
> > >> >
> > >> >TOYAMA Shin-ichi wrote in <6175505b.4994%sh...@wm...>
> > >> >>Bill Kendrick wrote in <202...@sh...>
> > >> >>>Hum, so I installed 0.9.26-5 via the installer EXE, but when I
> > launch it,
> > >> >>>nothing happens. No window appears at all.
> > >> >>
> > >> >>It reproduced by lounching TuxPaint from anoter user who does not
> > >> >>have administrator priviledge.
> > >> >>
> > >> >>I will have to look into it.
> > >>
> > >> --
> > >> TOYAMA Shin-ichi mailto:sh...@wm...
> > >>
> > >>
> > >> _______________________________________________
> > >> Tuxpaint-devel mailing list
> > >> Tux...@li...
> > >> https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel
> >
> > --
> > TOYAMA Shin-ichi mailto:sh...@wm...
> >
> >
> > _______________________________________________
> > Tuxpaint-devel mailing list
> > Tux...@li...
> > https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel
> >
--
-bill!
Sent from my computer
|