diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-05-11 01:38:58 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-05-11 13:45:24 +0200 |
commit | 2ff121f298e64ff204621220622472fe697d599d (patch) | |
tree | 02d0c8efbc99d3899ebdf047e08a4ae3939a6a1e /uitest | |
parent | f619c9b48a414072d35b831c08c393f3611027b6 (diff) |
Avoid gengal hanging in an --enable-dbgutil build on Windows
With a newer C++ debug runtime (in an --enable-dbgutil build), passing
an invalid locale name causes an attempt to display an error
dialog. Which does not even show up, at least for me, but instead the
process (gengal, at least) just hangs. Which is far from ideal.
Passing a POSIX-style locale name to the std::locale constructor on
Windows is a bit odd, but apparently in the normal C++ runtime it
"just" causes an exception to be thrown, that boost catches (see the
loadable(std::string name) in boost's libs\locale\src\std\std_backend.cpp),
and then instead uses the Windows style locale name it knows how to
construct. (Why it even tries the POSIX style name on Windows I can't
understand.)
Actually it isn't just the locale name part "en_US" of a locale like
"en_US.UTF-8" that is problematic, but also the encoding part,
"UTF-8". The Microsoft C/C++ library does not support UTF-8
locales. The error message that our own report hook catches says:
"f:\dd\vctools\crt\crtw32\stdcpp\xmbtowc.c(89) : Assertion failed:
ploc->_Mbcurmax == 1 || ploc->_Mbcurmax == 2". Clearly in a UTF-8
locale (perhaps one that boost internally constructs?) the maximum
bytes per character will be more than 2.
With a debug C++ runtime, we need to avoid the error dialog, and just
ignore the error. So we install an own CRT error report hook that
ignores the error for the duration of the locale construcion.
Change-Id: Ia2ca994f03d1ce94ce7e9d7607f204c320ab8f2d
Reviewed-on: https://gerrit.libreoffice.org/54110
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'uitest')
0 files changed, 0 insertions, 0 deletions