Thu 13 Dec 2012 02:23:09 PM UTC, comment #5:
For future reference, here is what seems to be happening. The crash occurs in escaped_string() when it is called from write_key_val_visitor::operator()(t_string const&). That calling function consists of a loop whose loop control variable is a t_string::walker, and that walker is constructed from a t_string. All looks fine so far.
The first wrinkle is that a walker does not have a constructor from a t_string. The code compiles though, since it does have a constructor from a t_string_base, and t_string is implicitly convertible to t_string_base. The root of the problem is here: t_string is implicitly convertible to a t_string_base object, not to a const reference to a t_string_base. That means that the constructor is actually called with a temporary t_string_base object (which is not guaranteed to exist after the construction is complete).
Things can blow up later because a walker retains a reference to one of the data fields in the object it is initialized from (and that object might no longer exist when the reference is used).
|
Tue 11 Dec 2012 09:33:35 PM UTC, comment #2:
(more info in the forum thread)
jamit: Assigning this to you, since it looks as if your changes to parser.cpp, which also happened in the time range in question, are triggering or causing this. (r55684 ?)
|
Mon 10 Dec 2012 05:20:47 AM UTC, comment #1:
Using bt in gdb showed this result:
#0 0x092a5be4 in (anonymous namespace)::escaped_string(__gnu_cxx::__normal_iterator<char const, std::string> const&, __gnu_cxx::__normal_iterator<char const, std::string> const&) ()
#1 0x092a5ff9 in (anonymous namespace)::write_key_val_visitor::operator()(t_string const&) const ()
#2 0x092a8700 in void boost::detail::variant::invoke_visitor<(anonymous namespace)::write_key_val_visitor const>::internal_visit<t_string const>(t_string const&, int) ()
#3 0x092a85d5 in boost::detail::variant::invoke_visitor<(anonymous namespace)::write_key_val_visitor const>::result_type boost::detail::variant::visitation_impl_invoke_impl<boost::detail::variant::invoke_visitor<(anonymous namespace)::write_key_val_visitor const>, void const, t_string>(int, boost::detail::variant::invoke_visitor<(anonymous namespace)::write_key_val_visitor const>&, void const, t_string*, mpl_::bool_<true>) ()
#4 0x092a8364 in boost::detail::variant::invoke_visitor<(anonymous namespace)::write_key_val_visitor const>::result_type boost::detail::variant::visitation_impl_invoke<boost::detail::variant::invoke_visitor<(anonymous namespace)::write_key_val_visitor const>, void const*, t_string, boost::variant<boost::blank, bool, double, std::string, t_string, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_
|
Sun 09 Dec 2012 09:31:55 PM UTC, original submission:
When I freshly compiled wesnoth 1.11.1 from source using make on Linux Ubuntu 12.10, it crashed on startup. I deleted all files, compiled and installed it again, and it crashed again. 1.11.0 worked well when I compiled and installed it in the same way.
The error was a segmentation fault, with gdb, I came to this error log:
Program received signal SIGSEGV, Segmentation fault.
0x092a5be4 in (anonymous namespace)::escaped_string(__gnu_cxx::__normal_iterator<char const, std::string> const&, __gnu_cxx::__normal_iterator<char const, std::string> const&) ()
|