summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-02-28 03:48:55 +0600
committerMike Kaganski <mike.kaganski@collabora.com>2024-02-28 04:57:11 +0100
commit072a25e1ef4815bbef4f18f59f025862a0d8e876 (patch)
tree591dc8d16b98cabf0766a4bf541a15bdd424ad86 /external
parent0c643e8afdf8b0b929b603340979e771eeb9fc0b (diff)
tdf#157135 workaround: restore and update windows-no-utf8-locales.patch.0
This partially reverts commit ed259e5efe432386b54c553cbc644b3b64976852 (Upgrade external/boost to latest Boost 1.81.0, 2023-01-05), which had dropped the patch previously introduced with commit f046fed2782f0d4244aff719ba70a56399a2583a (Don't ever attempt to initialise a std::locale with a UTF-8 locale on Windows, 2018-05-17). It seems that there is a nightmare going on in MSVCRT, and tdf#157135 is caused by dome MS bug. The problem happens in a deeply nested call to mbstowcs_s (several levels deep from std::locale constructor with name of "en_US.UTF-8"), which gets a non-null wcstr and sizeInWords equal to zero, which generates an invalid argument handler, resulting in a failed assertion "(pwcs == nullptr && sizeInWords == 0) || (pwcs != nullptr && sizeInWords > 0)" in _mbstowcs_internal from minkernel\crts\ucrt\src\appcrt\convert\mbstowcs.cpp:245, and a crash. The crashreporter initiates, but since it tries to use CRT itself, which is in fastfail mode, it hangs. The patch that is restored here was intended for something different; but it happily workarounds the nightmare. Until the proper fix found, let it be. Change-Id: Ic978f87e2e7b81fc2e1cd182a4247084ad016a9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164068 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'external')
-rw-r--r--external/boost/UnpackedTarball_boost.mk1
-rw-r--r--external/boost/windows-no-utf8-locales.patch.023
2 files changed, 24 insertions, 0 deletions
diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk
index d8bd131ac8df..8ab4d7949901 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -26,6 +26,7 @@ boost_patches += boost_1_59_0.property_tree.wreturn-type.patch
boost_patches += clang-cl.patch.0
boost_patches += boost_1_63_0.undef.warning.patch.1
+boost_patches += windows-no-utf8-locales.patch.0
boost_patches += msvc2017.patch.0
diff --git a/external/boost/windows-no-utf8-locales.patch.0 b/external/boost/windows-no-utf8-locales.patch.0
new file mode 100644
index 000000000000..519d8bde2fe6
--- /dev/null
+++ b/external/boost/windows-no-utf8-locales.patch.0
@@ -0,0 +1,23 @@
+Don't ever attempt to initialise a std::locale with a UTF-8 locale on Windows -*- Mode: Diff -*-
+
+--- libs/locale/src/boost/locale/std/std_backend.cpp
++++ libs/locale/src/boost/locale/std/std_backend.cpp
+@@ -86,6 +86,7 @@
+ #endif
+ utf_mode_ = utf8_support::none;
+ } else {
++ #if !defined(BOOST_WINDOWS)
+ if(loadable(lid)) {
+ name_ = lid;
+ utf_mode_ = utf8_support::native_with_wide;
+@@ -98,8 +99,8 @@
+ utf_mode_ = utf8_support::from_wide;
+ #endif
+ }
+-#if defined(BOOST_WINDOWS)
+- else if(loadable(win_name))
++ #else
++ if(loadable(win_name))
+ {
+ name_ = win_name;
+ utf_mode_ = utf8_support::from_wide;