initialization-order-fiasco

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 2 August 2021 15:09 UTC

...after a943936eeff04b60ebd0b2552bc18b42606f3321 "rtl::Static -> static local" (and the relevant static isn't even local), when building e.g. Gallery/backgrounds, see :

> ==26993==ERROR: AddressSanitizer: on address 0x2b52e50be408 at pc 0x2b52e4d32753 bp 0x7fff5670f090 sp 0x7fff5670f088 > READ of size 8 at 0x2b52e50be408 thread T0 > #0 0x2b52e4d32752 in std::_Rb_tree >, std::_Select1st > >, (anonymous namespace)::compareIgnoreAsciiCaseLess, std::allocator > > >::_M_begin() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_tree.h:737:64 > #1 0x2b52e4d355f3 in std::_Rb_tree >, std::_Select1st > >, (anonymous namespace)::compareIgnoreAsciiCaseLess, std::allocator > > >::find(rtl::OUString const&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_tree.h:2523:37 > #2 0x2b52e4d3507d in std::__cxx1998::map, (anonymous namespace)::compareIgnoreAsciiCaseLess, std::allocator > > >::find(rtl::OUString const&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_map.h:1164:21 > #3 0x2b52e4cf116c in std::__debug::map, (anonymous namespace)::compareIgnoreAsciiCaseLess, std::allocator > > >::find(rtl::OUString const&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/debug/map.h:561:32 > #4 0x2b52e4d00dcd in LanguageTag::registerImpl() const /i18nlangtag/source/languagetag/languagetag.cxx:888:50 > #5 0x2b52e4cdf693 in LanguageTag::getImpl() /i18nlangtag/source/languagetag/languagetag.cxx:1004:18 > #6 0x2b52e4cdf3fd in LanguageTag::LanguageTag(rtl::OUString const&, bool) /i18nlangtag/source/languagetag/languagetag.cxx:489:9 > #7 0x2b52b9aed628 in __cxx_global_var_init.2 /sfx2/source/view/lokhelper.cxx:77:13 > #8 0x2b52b9aed75e in _GLOBAL__sub_I_lokhelper.cxx /sfx2/source/view/lokhelper.cxx > #9 0x2b52b4f069c2 in _dl_init_internal (/lib64/ld-linux-x86-64.so.2+0xf9c2) > #10 0x2b52b4ef8179 (/lib64/ld-linux-x86-64.so.2+0x1179) > > 0x2b52e50be408 is located 40 bytes inside of global variable '(anonymous namespace)::theMapBcp47' defined in '/home/tdf/lode/jenkins/workspace/lo_ubsan/i18nlangtag/source/languagetag/languagetag.cxx:93:10' (0x2b52e50be3e0) of size 72 > registered at: > #0 0x43f4c8 in __asan_register_globals.part.13 /home/tdf/lode/packages/llvm-llvmorg-9.0.1.src/compiler-rt/lib/asan/asan_globals.cc:362 > #1 0x2b52e4d4031b in asan.module_ctor (/instdir/program/libi18nlangtag.so+0x16831b) > LLVMSymbolizer: error reading file: No such file or directory > #2 0x7fff567143b7 ([stack]+0x203b7)

This is a partial revert of a943936eeff04b60ebd0b2552bc18b42606f3321 "rtl::Static -> static local".

Change-Id: I5d6803d217d4e8927b5864b2392f3ddd18310a5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119882

71d0c43fb4cf initialization-order-fiasco
i18nlangtag/source/languagetag/languagetag.cxx | 89 ++++++++++++++------------
1 file changed, 48 insertions(+), 41 deletions(-)

Upstream: cgit.freedesktop.org


  • Share