Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gettext: UB when game is launched #3999

Open
matthiaskrgr opened this issue Mar 23, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@matthiaskrgr
Copy link
Contributor

commented Mar 23, 2019

while the game is starting:

UBSAN_OPTIONS=print_stacktrace=1 ./build/wesnoth

Battle for Wesnoth v1.15.0-dev
Started on Sat Mar 23 22:51:07 2019

Automatically found a possible data directory at /home/USER/vcs/github/wesnoth/build/..

Data directory:               /home/USER/vcs/github/wesnoth/build/..
User configuration directory: /home/USER/.config/wesnoth
User data directory:          /home/USER/.local/share/wesnoth/1.15
Cache directory:              /home/USER/.cache/wesnoth

../src/gettext.cpp:196:16: runtime error: member call on address 0x611000086f00 which does not point to an object of type 'boost::locale::message_format<char>'
0x611000086f00: note: object is of type 'boost::locale::gnu_gettext::mo_message<char>'
 1f 00 80 37  d8 2e 75 5d 29 7f 00 00  01 00 00 00 be be be be  a0 8a 01 00 80 60 00 00  00 8b 01 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::locale::gnu_gettext::mo_message<char>'
    #0 0x55df9388494b in (anonymous namespace)::wesnoth_message_format::domain(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /home/matthias/vcs/github/wesnoth/build/../src/gettext.cpp:196:16
    #1 0x55df93d978b7 in boost::locale::basic_message<char>::str(std::locale const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /usr/include/boost/locale/message.hpp:381:59
    #2 0x55df9388a433 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > boost::locale::dgettext<char>(char const*, char const*, std::locale const&) /usr/include/boost/locale/message.hpp:648:48
    #3 0x55df93871589 in translation::dgettext[abi:cxx11](char const*, char const*) /home/matthias/vcs/github/wesnoth/build/../src/gettext.cpp:396:9
    #4 0x55df93871ee6 in translation::dsgettext[abi:cxx11](char const*, char const*) /home/matthias/vcs/github/wesnoth/build/../src/gettext.cpp:406:23
    #5 0x55df94017574 in t_string_base::str[abi:cxx11]() const /home/matthias/vcs/github/wesnoth/build/../src/tstring.cpp:583:6
    #6 0x55df8faae35e in t_string::str[abi:cxx11]() const /home/matthias/vcs/github/wesnoth/build/../src/tstring.hpp:186:48
    #7 0x55df93787d5c in config_attribute_value::string_visitor::operator()[abi:cxx11](t_string const&) const /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.cpp:324:64
    #8 0x55df93787cb8 in boost::disable_if_c<(false) && (is_same<t_string const&, t_string const&>::value), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::type boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::internal_visit<t_string const&>(t_string const&, int) /usr/include/boost/variant/variant.hpp:1058:16
    #9 0x55df93787b9b in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::detail::variant::visitation_impl_invoke_impl<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*, t_string>(int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*, t_string*, mpl_::bool_<true>) /usr/include/boost/variant/detail/visitation_impl.hpp:112:20
    #10 0x55df93785fca in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::detail::variant::visitation_impl_invoke<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*, t_string, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_>(int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*, t_string*, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_, int) /usr/include/boost/variant/detail/visitation_impl.hpp:154:12
    #11 0x55df937853c7 in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::detail::variant::visitation_impl<mpl_::int_<0>, boost::detail::variant::visitation_impl_step<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<8l>, boost::blank, boost::mpl::l_item<mpl_::long_<7l>, config_attribute_value::true_false, boost::mpl::l_item<mpl_::long_<6l>, config_attribute_value::yes_no, boost::mpl::l_item<mpl_::long_<5l>, int, boost::mpl::l_item<mpl_::long_<4l>, unsigned long long, boost::mpl::l_item<mpl_::long_<3l>, double, boost::mpl::l_item<mpl_::long_<2l>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::mpl::l_item<mpl_::long_<1l>, t_string, boost::mpl::l_end> > > > > > > > >, boost::mpl::l_iter<boost::mpl::l_end> >, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_>(int, int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*, mpl_::bool_<false>, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_, mpl_::int_<0>*, boost::detail::variant::visitation_impl_step<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<8l>, boost::blank, boost::mpl::l_item<mpl_::long_<7l>, config_attribute_value::true_false, boost::mpl::l_item<mpl_::long_<6l>, config_attribute_value::yes_no, boost::mpl::l_item<mpl_::long_<5l>, int, boost::mpl::l_item<mpl_::long_<4l>, unsigned long long, boost::mpl::l_item<mpl_::long_<3l>, double, boost::mpl::l_item<mpl_::long_<2l>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::mpl::l_item<mpl_::long_<1l>, t_string, boost::mpl::l_end> > > > > > > > >, boost::mpl::l_iter<boost::mpl::l_end> >*) /usr/include/boost/variant/detail/visitation_impl.hpp:238:5
    #12 0x55df93784dd7 in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::internal_apply_visitor_impl<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*>(int, int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*) /usr/include/boost/variant/variant.hpp:2452:16
    #13 0x55df93784d34 in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::internal_apply_visitor<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false> >(boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&) const /usr/include/boost/variant/variant.hpp:2477:16
    #14 0x55df93784ab4 in config_attribute_value::string_visitor const::result_type boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::apply_visitor<config_attribute_value::string_visitor const>(config_attribute_value::string_visitor const&) const & /usr/include/boost/variant/variant.hpp:2531:22
    #15 0x55df9378490d in config_attribute_value::string_visitor::result_type boost::apply_visitor<config_attribute_value::string_visitor, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string> const&>(config_attribute_value::string_visitor const&, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string> const&) /usr/include/boost/variant/detail/apply_visitor_unary.hpp:97:51
    #16 0x55df937552c9 in config_attribute_value::string_visitor::result_type config_attribute_value::apply_visitor<config_attribute_value::string_visitor>(config_attribute_value::string_visitor const&) const /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.hpp:253:10
    #17 0x55df937432fd in config_attribute_value::str(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.cpp:329:9
    #18 0x55df8f9140c2 in _ZNK22config_attribute_valuecvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEv /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.hpp:193:40
    #19 0x55df941b9093 in font::load_font_config() /home/matthias/vcs/github/wesnoth/build/../src/font/font_config.cpp:185:31
    #20 0x55df8f792cbc in do_gameloop(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /home/matthias/vcs/github/wesnoth/build/../src/wesnoth.cpp:691:8
    #21 0x55df8f790074 in main /home/matthias/vcs/github/wesnoth/build/../src/wesnoth.cpp:1124:19
    #22 0x7f295a291222 in __libc_start_main (/usr/lib/libc.so.6+0x24222)
    #23 0x55df8f6ad02d in _start (/home/matthias/vcs/github/wesnoth/build/wesnoth+0x945202d)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/gettext.cpp:196:16 in
../src/gettext.cpp:158:27: runtime error: member call on address 0x611000086f00 which does not point to an object of type 'boost::locale::message_format<char>'
0x611000086f00: note: object is of type 'boost::locale::gnu_gettext::mo_message<char>'
 1f 00 80 37  d8 2e 75 5d 29 7f 00 00  01 00 00 00 be be be be  a0 8a 01 00 80 60 00 00  00 8b 01 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::locale::gnu_gettext::mo_message<char>'
    #0 0x55df93883895 in (anonymous namespace)::wesnoth_message_format::get(int, char const*, char const*) const /home/matthias/vcs/github/wesnoth/build/../src/gettext.cpp:158:27
    #1 0x55df93d9838a in boost::locale::basic_message<char>::write(std::locale const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const /usr/include/boost/locale/message.hpp:466:45
    #2 0x55df93d97f0a in boost::locale::basic_message<char>::str[abi:cxx11](std::locale const&, int) const /usr/include/boost/locale/message.hpp:404:40
    #3 0x55df93d9790b in boost::locale::basic_message<char>::str(std::locale const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /usr/include/boost/locale/message.hpp:382:24
    #4 0x55df9388a433 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > boost::locale::dgettext<char>(char const*, char const*, std::locale const&) /usr/include/boost/locale/message.hpp:648:48
    #5 0x55df93871589 in translation::dgettext[abi:cxx11](char const*, char const*) /home/matthias/vcs/github/wesnoth/build/../src/gettext.cpp:396:9
    #6 0x55df93871ee6 in translation::dsgettext[abi:cxx11](char const*, char const*) /home/matthias/vcs/github/wesnoth/build/../src/gettext.cpp:406:23
    #7 0x55df94017574 in t_string_base::str[abi:cxx11]() const /home/matthias/vcs/github/wesnoth/build/../src/tstring.cpp:583:6
    #8 0x55df8faae35e in t_string::str[abi:cxx11]() const /home/matthias/vcs/github/wesnoth/build/../src/tstring.hpp:186:48
    #9 0x55df93787d5c in config_attribute_value::string_visitor::operator()[abi:cxx11](t_string const&) const /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.cpp:324:64
    #10 0x55df93787cb8 in boost::disable_if_c<(false) && (is_same<t_string const&, t_string const&>::value), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::type boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::internal_visit<t_string const&>(t_string const&, int) /usr/include/boost/variant/variant.hpp:1058:16
    #11 0x55df93787b9b in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::detail::variant::visitation_impl_invoke_impl<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*, t_string>(int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*, t_string*, mpl_::bool_<true>) /usr/include/boost/variant/detail/visitation_impl.hpp:112:20
    #12 0x55df93785fca in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::detail::variant::visitation_impl_invoke<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*, t_string, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_>(int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*, t_string*, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_, int) /usr/include/boost/variant/detail/visitation_impl.hpp:154:12
    #13 0x55df937853c7 in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::detail::variant::visitation_impl<mpl_::int_<0>, boost::detail::variant::visitation_impl_step<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<8l>, boost::blank, boost::mpl::l_item<mpl_::long_<7l>, config_attribute_value::true_false, boost::mpl::l_item<mpl_::long_<6l>, config_attribute_value::yes_no, boost::mpl::l_item<mpl_::long_<5l>, int, boost::mpl::l_item<mpl_::long_<4l>, unsigned long long, boost::mpl::l_item<mpl_::long_<3l>, double, boost::mpl::l_item<mpl_::long_<2l>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::mpl::l_item<mpl_::long_<1l>, t_string, boost::mpl::l_end> > > > > > > > >, boost::mpl::l_iter<boost::mpl::l_end> >, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_>(int, int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*, mpl_::bool_<false>, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_, mpl_::int_<0>*, boost::detail::variant::visitation_impl_step<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<8l>, boost::blank, boost::mpl::l_item<mpl_::long_<7l>, config_attribute_value::true_false, boost::mpl::l_item<mpl_::long_<6l>, config_attribute_value::yes_no, boost::mpl::l_item<mpl_::long_<5l>, int, boost::mpl::l_item<mpl_::long_<4l>, unsigned long long, boost::mpl::l_item<mpl_::long_<3l>, double, boost::mpl::l_item<mpl_::long_<2l>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::mpl::l_item<mpl_::long_<1l>, t_string, boost::mpl::l_end> > > > > > > > >, boost::mpl::l_iter<boost::mpl::l_end> >*) /usr/include/boost/variant/detail/visitation_impl.hpp:238:5
    #14 0x55df93784dd7 in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::internal_apply_visitor_impl<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*>(int, int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*) /usr/include/boost/variant/variant.hpp:2452:16
    #15 0x55df93784d34 in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::internal_apply_visitor<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false> >(boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&) const /usr/include/boost/variant/variant.hpp:2477:16
    #16 0x55df93784ab4 in config_attribute_value::string_visitor const::result_type boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::apply_visitor<config_attribute_value::string_visitor const>(config_attribute_value::string_visitor const&) const & /usr/include/boost/variant/variant.hpp:2531:22
    #17 0x55df9378490d in config_attribute_value::string_visitor::result_type boost::apply_visitor<config_attribute_value::string_visitor, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string> const&>(config_attribute_value::string_visitor const&, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string> const&) /usr/include/boost/variant/detail/apply_visitor_unary.hpp:97:51
    #18 0x55df937552c9 in config_attribute_value::string_visitor::result_type config_attribute_value::apply_visitor<config_attribute_value::string_visitor>(config_attribute_value::string_visitor const&) const /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.hpp:253:10
    #19 0x55df937432fd in config_attribute_value::str(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.cpp:329:9
    #20 0x55df8f9140c2 in _ZNK22config_attribute_valuecvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEv /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.hpp:193:40
    #21 0x55df941b9093 in font::load_font_config() /home/matthias/vcs/github/wesnoth/build/../src/font/font_config.cpp:185:31
    #22 0x55df8f792cbc in do_gameloop(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /home/matthias/vcs/github/wesnoth/build/../src/wesnoth.cpp:691:8
    #23 0x55df8f790074 in main /home/matthias/vcs/github/wesnoth/build/../src/wesnoth.cpp:1124:19
    #24 0x7f295a291222 in __libc_start_main (/usr/lib/libc.so.6+0x24222)
    #25 0x55df8f6ad02d in _start (/home/matthias/vcs/github/wesnoth/build/wesnoth+0x945202d)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/gettext.cpp:158:27 in
../src/gettext.cpp:202:16: runtime error: member call on address 0x611000086f00 which does not point to an object of type 'boost::locale::message_format<char>'
0x611000086f00: note: object is of type 'boost::locale::gnu_gettext::mo_message<char>'
 1f 00 80 37  d8 2e 75 5d 29 7f 00 00  01 00 00 00 be be be be  a0 8a 01 00 80 60 00 00  00 8b 01 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::locale::gnu_gettext::mo_message<char>'
    #0 0x55df93884b9f in (anonymous namespace)::wesnoth_message_format::convert(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const /home/matthias/vcs/github/wesnoth/build/../src/gettext.cpp:202:16
    #1 0x55df93d987ef in boost::locale::basic_message<char>::write(std::locale const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const /usr/include/boost/locale/message.hpp:477:45
    #2 0x55df93d97f0a in boost::locale::basic_message<char>::str[abi:cxx11](std::locale const&, int) const /usr/include/boost/locale/message.hpp:404:40
    #3 0x55df93d9790b in boost::locale::basic_message<char>::str(std::locale const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /usr/include/boost/locale/message.hpp:382:24
    #4 0x55df9388a433 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > boost::locale::dgettext<char>(char const*, char const*, std::locale const&) /usr/include/boost/locale/message.hpp:648:48
    #5 0x55df93871589 in translation::dgettext[abi:cxx11](char const*, char const*) /home/matthias/vcs/github/wesnoth/build/../src/gettext.cpp:396:9
    #6 0x55df93871ee6 in translation::dsgettext[abi:cxx11](char const*, char const*) /home/matthias/vcs/github/wesnoth/build/../src/gettext.cpp:406:23
    #7 0x55df94017574 in t_string_base::str[abi:cxx11]() const /home/matthias/vcs/github/wesnoth/build/../src/tstring.cpp:583:6
    #8 0x55df8faae35e in t_string::str[abi:cxx11]() const /home/matthias/vcs/github/wesnoth/build/../src/tstring.hpp:186:48
    #9 0x55df93787d5c in config_attribute_value::string_visitor::operator()[abi:cxx11](t_string const&) const /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.cpp:324:64
    #10 0x55df93787cb8 in boost::disable_if_c<(false) && (is_same<t_string const&, t_string const&>::value), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::type boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::internal_visit<t_string const&>(t_string const&, int) /usr/include/boost/variant/variant.hpp:1058:16
    #11 0x55df93787b9b in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::detail::variant::visitation_impl_invoke_impl<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*, t_string>(int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*, t_string*, mpl_::bool_<true>) /usr/include/boost/variant/detail/visitation_impl.hpp:112:20
    #12 0x55df93785fca in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::detail::variant::visitation_impl_invoke<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*, t_string, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_>(int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*, t_string*, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_, int) /usr/include/boost/variant/detail/visitation_impl.hpp:154:12
    #13 0x55df937853c7 in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::detail::variant::visitation_impl<mpl_::int_<0>, boost::detail::variant::visitation_impl_step<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<8l>, boost::blank, boost::mpl::l_item<mpl_::long_<7l>, config_attribute_value::true_false, boost::mpl::l_item<mpl_::long_<6l>, config_attribute_value::yes_no, boost::mpl::l_item<mpl_::long_<5l>, int, boost::mpl::l_item<mpl_::long_<4l>, unsigned long long, boost::mpl::l_item<mpl_::long_<3l>, double, boost::mpl::l_item<mpl_::long_<2l>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::mpl::l_item<mpl_::long_<1l>, t_string, boost::mpl::l_end> > > > > > > > >, boost::mpl::l_iter<boost::mpl::l_end> >, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_>(int, int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*, mpl_::bool_<false>, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::has_fallback_type_, mpl_::int_<0>*, boost::detail::variant::visitation_impl_step<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<8l>, boost::blank, boost::mpl::l_item<mpl_::long_<7l>, config_attribute_value::true_false, boost::mpl::l_item<mpl_::long_<6l>, config_attribute_value::yes_no, boost::mpl::l_item<mpl_::long_<5l>, int, boost::mpl::l_item<mpl_::long_<4l>, unsigned long long, boost::mpl::l_item<mpl_::long_<3l>, double, boost::mpl::l_item<mpl_::long_<2l>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::mpl::l_item<mpl_::long_<1l>, t_string, boost::mpl::l_end> > > > > > > > >, boost::mpl::l_iter<boost::mpl::l_end> >*) /usr/include/boost/variant/detail/visitation_impl.hpp:238:5
    #14 0x55df93784dd7 in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::internal_apply_visitor_impl<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>, void const*>(int, int, boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&, void const*) /usr/include/boost/variant/variant.hpp:2452:16
    #15 0x55df93784d34 in boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>::result_type boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::internal_apply_visitor<boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false> >(boost::detail::variant::invoke_visitor<config_attribute_value::string_visitor const, false>&) const /usr/include/boost/variant/variant.hpp:2477:16
    #16 0x55df93784ab4 in config_attribute_value::string_visitor const::result_type boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string>::apply_visitor<config_attribute_value::string_visitor const>(config_attribute_value::string_visitor const&) const & /usr/include/boost/variant/variant.hpp:2531:22
    #17 0x55df9378490d in config_attribute_value::string_visitor::result_type boost::apply_visitor<config_attribute_value::string_visitor, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string> const&>(config_attribute_value::string_visitor const&, boost::variant<boost::blank, config_attribute_value::true_false, config_attribute_value::yes_no, int, unsigned long long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, t_string> const&) /usr/include/boost/variant/detail/apply_visitor_unary.hpp:97:51
    #18 0x55df937552c9 in config_attribute_value::string_visitor::result_type config_attribute_value::apply_visitor<config_attribute_value::string_visitor>(config_attribute_value::string_visitor const&) const /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.hpp:253:10
    #19 0x55df937432fd in config_attribute_value::str(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.cpp:329:9
    #20 0x55df8f9140c2 in _ZNK22config_attribute_valuecvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEv /home/matthias/vcs/github/wesnoth/build/../src/config_attribute_value.hpp:193:40
    #21 0x55df941b9093 in font::load_font_config() /home/matthias/vcs/github/wesnoth/build/../src/font/font_config.cpp:185:31
    #22 0x55df8f792cbc in do_gameloop(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /home/matthias/vcs/github/wesnoth/build/../src/wesnoth.cpp:691:8
    #23 0x55df8f790074 in main /home/matthias/vcs/github/wesnoth/build/../src/wesnoth.cpp:1124:19
    #24 0x7f295a291222 in __libc_start_main (/usr/lib/libc.so.6+0x24222)
    #25 0x55df8f6ad02d in _start (/home/matthias/vcs/github/wesnoth/build/wesnoth+0x945202d)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/gettext.cpp:202:16 in
Setting mode to 800x1040
Checking lua scripts... ok
@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2019

Link to the boost source https://github.com/boostorg/locale/blob/bc9ab436c525a7409f64926b8407e6215660debd/src/shared/message.cpp#L486 mo_message seems to inherit from message_format so the claim

which does not point to an object of type 'boost::locale::message_format'
0x611000086f00: note: object is of type 'boost::locale::gnu_gettext::mo_message'

Looks wrong to me

@CelticMinstrel

This comment has been minimized.

Copy link
Member

commented Mar 24, 2019

I suppose there's no chance of weird situations that might be causing this? For example...

  • Presence of two separate instances of boost::locale::message_format in the linker, so it's calling the member function of one instance on an object constructed through the other instance
  • Attempted virtual call from the constructor (doesn't look like it from the stack trace, though)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.