r 7847 crashes on Linux (Ubuntu)

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

r 7847 crashes on Linux (Ubuntu)

#1 Post by Dilvish »

immediate crash for me, no message to console, only log output is below:

Code: Select all

2015-01-17 16:44:57,499 DEBUG Client : Logger initialized
2015-01-17 16:44:57,499 DEBUG Client : v0.4.4+ [SVN 7847] CMake
2015-01-17 16:44:57,557 DEBUG Client : OpenAL initialized. Version 1.1 ALSOFT 1.14Renderer OpenAL SoftVendor OpenAL Community
Extensions: AL_EXT_ALAW AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_LOKI_quadriphonic AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data AL_SOFTX_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points

2015-01-17 16:44:57,685 DEBUG Client : ProductionWindow:  app-width: 1024 ; windowed width: 1024
2015-01-17 16:44:57,688 DEBUG Client : DesignWnd::MainPanel::ReregisterDesigns
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: r 7847 crashes on Linux (Ubuntu)

#2 Post by Geoff the Medio »

I guess try to figure out which revision is the latest that still works.

I'm not going to be able to do much work on parsers if any change causes GCC-compiled code to crash, even when the additions are nearly the same as existing code...

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: r 7847 crashes on Linux (Ubuntu)

#3 Post by Mitten.O »

Crashes for me, too (r7849). Partial stack trace:

Code: Select all

#0 parse<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<> >, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<const boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > >, boost::spirit::unused_type>, char const* const>, ValueRef::ComplexVariable<int>*> (attr=@0x7fffffff76d0: 0x0, skipper=..., context=..., last=..., first=..., this=<optimized out>) at /usr/include/boost/spirit/home/qi/reference.hpp:43
#1 parse<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<> >, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<const boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > >, boost::spirit::unused_type>, char const* const>, const boost::spirit::unused_type> (attr_=..., skipper=..., context=..., last=..., first=..., this=<optimized out>) at /usr/include/boost/spirit/home/qi/action/action.hpp:65
#2 call<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<const boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > >, boost::spirit::unused_type>, char const* const>, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<> > > (skipper=..., context=..., last=..., first=..., this=<optimized out>) at /usr/include/boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp:33
#3 operator()<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<const boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > >, boost::spirit::unused_type>, char const* const>, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<> > > (skipper=..., context=..., last=..., first=..., this=<optimized out>) at /usr/include/boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp:53
#4 boost::detail::function::function_obj_invoker4<boost::spirit::qi::detail::parser_binder<boost::spirit::qi::action<boost::spirit::qi::reference<boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ComplexVariable<int>* (), boost::spirit::locals<std::string, ValueRef::ValueRefBase<int>*, ValueRef::ValueRefBase<int>*, ValueRef::ValueRefBase<std::string>*, ValueRef::ValueRefBase<std::string>*, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, __gnu_cxx::__normal_iterator<char const*, std::string>, boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > > > >, char const*>, boost::spirit::unused_type> const>, boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::assign_eval, boost::fusion::vector<boost::spirit::attribute<0>, boost::phoenix::composite<boost::phoenix::detail::new_eval<ValueRef::StaticCast<int, double> >, boost::fusion::vector<boost::spirit::argument<0>, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > > >, mpl_::bool_<false> >, bool, boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > >&, boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > > const&, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<void> >&, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, __gnu_cxx::__normal_iterator<char const*, std::string>, boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > > > > const, boost::spirit::unused_type>, char const* const> const&>::invoke(boost::detail::function::function_buffer&, boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > >&, boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > > const&, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<void> >&, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, __gnu_cxx::__normal_iterator<char const*, std::string>, boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > > > > const, boost::spirit::unused_type>, char const* const> const&) (function_obj_ptr=..., a0=..., a1=..., a2=..., a3=...) at /usr/include/boost/function/function_template.hpp:132
#5 0x00007ffff687ec53 in operator() (a3=..., a2=..., a1=..., a0=..., this=<optimized out>) at /usr/include/boost/function/function_template.hpp:767
#6 parse<boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<> >, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<const boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > >, boost::spirit::unused_type>, char const* const>, ValueRef::ValueRefBase<double>*> (attr=@0x7fffffff7ab0: 0x0, skipper=..., last=..., first=..., this=<optimized out>) at /usr/include/boost/spirit/home/qi/nonterminal/rule.hpp:303
#7 parse<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<> >, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<const boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > >, boost::spirit::unused_type>, char const* const>, ValueRef::ValueRefBase<double>*> (context=..., attr=@0x7fffffff7ab0: 0x0, skipper=..., last=..., first=..., this=<optimized out>) at /usr/include/boost/spirit/home/qi/reference.hpp:43
#8 call<boost::spirit::qi::reference<const boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ValueRefBase<double>*(), boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > > >, boost::spirit::unused_type, boost::spirit::unused_type> > > (component=..., this=<synthetic pointer>) at /usr/include/boost/spirit/home/qi/detail/alternative_function.hpp:70
#9 call_unused<boost::spirit::qi::reference<const boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ValueRefBase<double>*(), boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > > >, boost::spirit::unused_type, boost::spirit::unused_type> > > (component=..., this=<synthetic pointer>) at /usr/include/boost/spirit/home/qi/detail/alternative_function.hpp:153
#10 operator()<boost::spirit::qi::reference<const boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ValueRefBase<double>*(), boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > > >, boost::spirit::unused_type, boost::spirit::unused_type> > > (component=..., this=<synthetic pointer>) at /usr/include/boost/spirit/home/qi/detail/alternative_function.hpp:170
#11 linear_any<boost::fusion::cons_iterator<const boost::fusion::cons<boost::spirit::qi::reference<const boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ValueRefBase<double>*(), boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > > >, boost::spirit::unused_type, boost::spirit::unused_type> >, boost::fusion::cons<boost::spirit::qi::reference<const boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ComplexVariable<double>*(), boost::spirit::locals<std::basic_string<char>, ValueRef::ValueRefBase<int>*, ValueRef::ValueRefBase<int>*, ValueRef::ValueRefBase<std::basic_string<char> >*, ValueRef::ValueRefBase<std::basic_string<char> >*>, boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > > >, boost::spirit::unused_type> >, boost::fusion::nil> > >, boost::fusion::cons_iterator<const boost::fusion::nil>, boost::spirit::qi::detail::alternative_function<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<> >, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<const boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > >, boost::spirit::unused_type>, char const* const>, ValueRef::ValueRefBase<double>*> > (last=..., f=<synthetic pointer>, first=...) at /usr/include/boost/fusion/algorithm/query/detail/any.hpp:37
#12 linear_any<boost::fusion::cons_iterator<const boost::fusion::cons<boost::spirit::qi::reference<const boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ValueRefBase<double>*(), boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > > >, boost::spirit::unused_type, boost::spirit::unused_type> >, boost::fusion::cons<boost::spirit::qi::reference<const boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ValueRefBase<double>*(), boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > > >, boost::spirit::unused_type, boost::spirit::unused_type> >, boost::fusion::cons<boost::spirit::qi::reference<const boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ComplexVariable<double>*(), boost::spirit::locals<std::basic_string<char>, ValueRef::ValueRefBase<int>*, ValueRef::ValueRefBase<int>*, ValueRef::ValueRefBase<std::basic_string<char> >*, ValueRef::ValueRefBase<std::basic_string<char> >*>, boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > > >, boost::spirit::unused_type> >, boost::fusion::nil> > > >, boost::fusion::cons_iterator<const boost::fusion::nil>, boost::spirit::qi::detail::alternative_function<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<> >, boost::spirit::qi::state_switcher_context<boost::spirit::lex::reference<const boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > >, boost::spirit::unused_type>, char const* const>, ValueRef::ValueRefBase<double>*> > (last=..., f=<synthetic pointer>, first=...) at /usr/include/boost/fusion/algorithm/query/detail/any.hpp:42
...

Code: Select all

#279 phrase_parse<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::spirit::qi::parameterized_nonterminal<boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > >, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, mpl_::bool_<true>, mpl_::bool_<true> > >, void(std::map<std::basic_string<char>, PartType*>&), boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > > > >, boost::fusion::vector<boost::phoenix::actor<boost::phoenix::reference<std::map<std::basic_string<char>, PartType*> > >, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > >, 0l>, boost::proto::exprns_::expr<boost::proto::tagns_::tag::subscript, boost::proto::argsns_::list2<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::spirit::terminal_ex<boost::spirit::tag::in_state, boost::fusion::vector1<char const (&)[3]> > >, 0l>&, const boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> >, boost::mpl::vector<bool, int, double, char const*, std::basic_string<char> > > > > >&>, 2l> > (post_skip=boost::spirit::qi::skip_flag::postskip, skipper=..., expr=..., last=<error reading variable: access outside bounds of object referenced via synthetic pointer>, first=...) at /usr/include/boost/spirit/home/qi/parse.hpp:118
#280 parse_file<(anonymous namespace)::rules, std::map<std::basic_string<char>, PartType*> > (arg1=..., path=...) at /.../Source/freeorion/private/FreeOrion/parse/ParseImpl.h:79
#281 parse::ship_parts (path=..., parts=...) at /.../Source/freeorion/private/FreeOrion/parse/ShipPartsParser.cpp:211
#282 0x00007ffff7237694 in PartTypeManager::PartTypeManager (this=0x7ffff7dc55a0 <PartTypeManager::GetPartTypeManager()::manager>) at /.../Source/freeorion/private/FreeOrion/universe/ShipDesign.cpp:135
#283 0x00007ffff7237a50 in PartTypeManager::GetPartTypeManager () at /.../Source/freeorion/private/FreeOrion/universe/ShipDesign.cpp:158
#284 0x00007ffff7237511 in GetPartTypeManager () at /.../Source/freeorion/private/FreeOrion/universe/ShipDesign.cpp:108
#285 0x0000000000754851 in DesignWnd::PartPalette::PartPalette (this=0x23bf910, w=X{423}, h=Y{290}) at /.../Source/freeorion/private/FreeOrion/UI/DesignWnd.cpp:814
#286 0x00000000007618db in DesignWnd::DesignWnd (this=0x220e700, w=X{1024}, h=Y{726}) at /.../Source/freeorion/private/FreeOrion/UI/DesignWnd.cpp:3114
#287 0x00000000008d0c10 in MapWnd::MapWnd (this=0x16dcf20) at /.../Source/freeorion/private/FreeOrion/UI/MapWnd.cpp:1065
#288 0x000000000069ad6b in ClientUI::ClientUI (this=0x16739d0) at /.../Source/freeorion/private/FreeOrion/UI/ClientUI.cpp:539
#289 0x000000000057a07e in HumanClientApp::HumanClientApp (this=0x7fffffffd600, root=0x7ffff7ea08d8, window=0x7ffff7eb0068, scene_manager=0x7ffff7eb55c8, camera=0x7ffff7ebf088, viewport=0x7fffe7fb24a8, ois_input_cfg_file_path=...) at /.../Source/freeorion/private/FreeOrion/client/human/HumanClientApp.cpp:201
#290 0x00000000005cbcfe in mainSetupAndRunOgre () at /.../Source/freeorion/private/FreeOrion/client/human/chmain.cpp:310
#291 0x00000000005c84a4 in main (argc=1, argv=0x7fffffffe408) at /.../Source/freeorion/private/FreeOrion/client/human/chmain.cpp:88
Any code by me in this post is released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: r 7847 crashes on Linux (Ubuntu)

#4 Post by Geoff the Medio »

There's no scripts that use this parser, so it's something in the initialization of the parsers that's crashing, not an attempt to parse that's failing (although the stack suggests it's trying to do a parse... so maybe it is?)

I have no idea... The new double complex parser code is very similar to the existing int complex parser code, but much shorter / simpler. It's not using any extra other parsers (Condition, other ValueRefs) that the int complex parser code doesn't.

All I can guess is that it doesn't like operator %= when there's just one parser being assigned to start? Try removing the % on line 31 of DoubleComplexValueRefParser.cpp .

Otherwise, one of you will need to figure this out... I can't tell what will or won't cause problems.

User avatar
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: r 7847 crashes on Linux (Ubuntu)

#5 Post by Vezzra »

Just for the records: no crashes with r7848 on OSX. Builds and runs fine. Not even error messages in the logs.

@Dilvish, Mitten: I assume you're building with gcc, right? Xcode uses clang/llvm, so maybe that's a gcc specific issue...?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: r 7847 crashes on Linux (Ubuntu)

#6 Post by Geoff the Medio »

Vezzra wrote:...maybe that's a gcc specific issue...?
Apparently different intialization orders, which are somehow affected by changing direct use to calling a reference-valued-returning function?

I'll try adding a function to manually do the parser initializations (by calling the getters) in Parse.cpp... Maybe the gcc users can try reordering these init calls to make it work?

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: r 7847 crashes on Linux (Ubuntu)

#7 Post by Dilvish »

Geoff the Medio wrote:There's no scripts that use this parser, so it's something in the initialization of the parsers that's crashing, not an attempt to parse that's failing (although the stack suggests it's trying to do a parse... so maybe it is?) I have no idea... The new double complex parser code is very similar to the existing int complex parser code, but much shorter / simpler. It's not using any extra other parsers (Condition, other ValueRefs) that the int complex parser code doesn't. All I can guess is that it doesn't like operator %= when there's just one parser being assigned to start? Try removing the % on line 31 of DoubleComplexValueRefParser.cpp . Otherwise, one of you will need to figure this out... I can't tell what will or won't cause problems.
Sorry, no, removing that % didn't change things. One thing I think is significant to note here is that unlike some of the other recent parser problems, this one is a crash, not a hang. If I run with Valgrind, it looks like the crash is triggered by boost::spirit making an invalid read and then trying to jump to execute that value.

Adding a bunch of logging, I determined that yes, this is happening when it is trying to do a parse, specifically when PartTypeManager::PartTypeManager calls parse::ship_parts(). I lose the trail there, but it looks like some new part of the parser is not getting initialized.

I started making an attempt to move the double complex parser (or at least simply the part_capacity parser) directly into the double_parser_rules, but then even simply adding the declaration

Code: Select all

            const parse::value_ref_parser_rule<std::string>::type& string_value_ref =
                parse::value_ref_parser<std::string>();
led to the initialization deadlock because parse::value_ref_parser<std::string> in turn depends on double_free_variable() which is derived from double_parser_rules, completing a circle.

I started to look at whether some simpler string parser could be used in the part_capacity parser rule, basically drawing on the structure of string_parser_rules.constant, because it doesn't seem to me like we really need anything more there do we, at least to start? But I'm afraid I'm feeling exhausted by all this parser stuff at the moment-- it's been a few hours so far today trying to sort this out.

Adding the details of the valgrind error was messing badly with the margins on this post, so I'm putting that in a follow-up post.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: r 7847 crashes on Linux (Ubuntu)

#8 Post by Dilvish »

here is the error detail that goes with the above post.

The bad read is

Code: Select all

==8609== Invalid read of size 8
==8609==    at 0x5753C88: boost::detail::function::function_obj_invoker4<boost::spirit::qi::detail::parser_binder<boost::spirit::qi::action<boost::spirit::qi::reference<boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ComplexVariable<int>* (), boost::spirit::locals<std::string, ValueRef::ValueRefBase<int>*, ValueRef::ValueRefBase<int>*, ValueRef::ValueRefBase<std::string>*, ValueRef::ValueRefBase<std::string>*, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, __gnu_cxx::__normal_iterator<char const*, std::string>, boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > > > >, char const*>, boost::spirit::unused_type> const>, boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::assign_eval, boost::fusion::vector<boost::spirit::attribute<0>, boost::phoenix::composite<boost::phoenix::detail::new_eval<ValueRef::StaticCast<int, double> >, boost::fusion::vector<boost::spirit::argument<0>, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > > >, mpl_::bool_<false> >, bool, boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > >&, boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > > const&, boost::spirit::context<boost::fusion::cons<ValueRef::ValueRefBase<double>*&, boost::fusion::nil>, boost::fusion::vector0<void> >&, boost:

<skipping a few 'by' sections>

==8609==    by 0x575C612: boost::detail::function::function_obj_invoker4<boost::spirit::qi::detail::parser_binder<boost::spirit::qi::alternative<boost::fusion::cons<boost::spirit::qi::expect<boost::fusion::cons<boost::spirit::qi::sequence<boost::fusion::cons<boost::spirit::qi::alternative<boost::fusion::cons<boost::spirit::qi::action<boost::spirit::lex::reference<boost::spirit::lex::token_def<char const*, char, unsigned long> const, unsigned long>, boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::assign_eval, boost::fusion::vector<boost::spirit::local_variable<2>, boost::phoenix::value<ValueRef::OpType>, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > > >, boost::fusion::cons<boost::spirit::qi::action<boost::spirit::lex::reference<boost::spirit::lex::token_def<char const*, char, unsigned long> const, unsigned long>, boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::assign_eval, boost::fusion::vector<boost::spirit::local_variable<2>, boost::phoenix::value<ValueRef::OpType>, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > > >, boost::fusion::cons<boost::spirit::qi::action<boost::spirit::lex::reference<boost::spirit::lex::token_def<char const*, char, unsigned long> const, unsigned long>, boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::assign_eval, boost::fusion::vector<boost::spirit::local_variable<2>, boost::phoenix::value<ValueRef::OpType>, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > > >, boost::fusion::cons<boost::spirit::qi::action<boost::spirit::lex::reference<boost::spirit::lex::token_def<char const*, char, unsigned long> const, unsigned long>, boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::assign_eval, boost::fusion::vector<boost::spirit::local_variable<2>, boost::phoenix::value<ValueRef::OpType>, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > > >, boost::fusion::nil> > > > >, boost::fusion::cons<boost::spirit::qi::literal_char<boost::spirit::char_encoding::standard, true, false>, boost::fusion::nil> > >, boost::fusion::cons<boost::spirit::qi::action<boost::spirit::qi::reference<boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ValueRefBase<double>* (), boost::spirit::qi::in_state_skipper<boost::spirit::lex::detail::lexer_def_<boost::spirit::lex::lexer<boost::spirit::lex::lexertl::actor_lexer<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, __gnu_cxx::__normal_iterator<char const*, std::string>, boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, 
and this results in

Code: Select all

==8609==  Address 0x10 is not stack'd, malloc'd or (recently) free'd
==8609== 
==8609== 
==8609== Process terminating with default action of signal 11 (SIGSEGV)
==8609==  Access not within mapped region at address 0x10
==8609==    at 0x5753C88: boost::detail::function::function_obj_invoker4<boost::spirit::qi::detail::parser_binder<boost::spirit::qi::action<boost::spirit::qi::reference<boost::spirit::qi::rule<boost::spirit::lex::lexertl::iterator<boost::spirit::lex::lexertl::functor<boost::spirit::lex::lexertl::position_token<__gnu_cxx::__normal_iterator<char const*, std::string>, boost::mpl::vector<bool, int, double, char const*, std::string, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, mpl_::bool_<true>, unsigned long>, boost::spirit::lex::lexertl::detail::data, __gnu_cxx::__normal_iterator<char const*, std::string>, mpl_::bool_<true>, mpl_::bool_<true> > >, ValueRef::ComplexVariable<int>* ()...
I skipped the rest of this invalid access info because it looked the same as the bad read info above.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: r 7847 crashes on Linux (Ubuntu)

#9 Post by Geoff the Medio »

Dilvish wrote:...initialization deadlock because parse::value_ref_parser<std::string> in turn depends on double_free_variable() which is derived from double_parser_rules, completing a circle.
That's potentially something we can fix easily... presently the string parser is set up to accept many of the other tokens that can be used for star types, ints, doubles, object types, etc. I was already thinking this is probably a bad idea and might want to remove it, but if it fixes a cyclical dependence, that would be even more reason.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]


User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: r 7847 crashes on Linux (Ubuntu)

#10 Post by Dilvish »

That patch doesn't work for me, could you double check it for yourself too? For me it leads to an exit due to a problem parsing techs. The log shows

Code: Select all

2015-01-18 20:02:31,707 ERROR Client : /home/FO/programs/freeorion_dev1/default/techs.txt:354:24: Parse error.  Expected string bound_variable name (e.g., Name) here:
                GenerateSitRepMessage
                    message = "EFFECT_MINES"
                    icon = "icons/sitrep/combat_damage.png"
                    parameters = [
                        tag = "empire" data = Target.Owner
                        tag = "fleet" data = Target.ID
                        ^
                        tag = "rawtext" data = "2"
                        tag = "system" data = Target.SystemID
                    ]
                    empire = Target.Owner
            ]

2015-01-18 20:02:31,707 ERROR Client : ERROR: The following categories were defined in techs.txt, but no techs were defined that fell within them: "CONSTRUCTION_CATEGORY" "GROWTH_CATEGORY" "LEARNING_CATEGORY" "PRODUCTION_CATEGORY" "SHIPS_CATEGORY" "SPY_CATEGORY"
2015-01-18 20:02:31,707 ERROR Client : ERROR: Tech "DEF_PLANET_CLOAK" requires a missing or malformed tech "SPY_STEALTH_3" as its prerequisite.
2015-01-18 20:02:31,707 ERROR Client : main() caught exception(std::runtime_error): ERROR: Tech "DEF_PLANET_CLOAK" requires a missing or malformed tech "SPY_STEALTH_3" as its prerequisite.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: r 7847 crashes on Linux (Ubuntu)

#11 Post by Geoff the Medio »

I didn't realize that int or double valueref were being used / casted to strings. I can add back the functionality locally in the GenerateSitrepMessage parser, though, which shouldn't have the same circular dependency results as putting it into the string valueref parser itself...

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: r 7847 crashes on Linux (Ubuntu)

#12 Post by Dilvish »

ok, I got things working with putting the part_capacity parser directly into double_parser_rules, using a more limited string parser, as follows:

Code: Select all

            part_capacity
                =   (
                            tok.PartCapacity_ [ _a = construct<std::string>(_1) ]
                        >   parse::label(Name_token)   >   tok.string [ _d = new_<ValueRef::Constant<std::string> >(_1) ]
                    ) [ _val = new_<ValueRef::ComplexVariable<double> >(_a, _b, _c, _d, _e) ]
                ;
I verified that it worked using the following modified parts (not the way we'd really want to set things up, just a proof-of-concept):

Code: Select all

Part
    name = "SH_DEFENSE_GRID_BASE"
    description = "SH_DEFENSE_GRID_DESC"
    class = Shield
    capacity = 4
    mountableSlotTypes = Internal
    buildcost = 40 * [[FLEET_UPKEEP_MULTIPLICATOR]]
    buildtime = 2
    location = OwnedBy empire = Source.Owner
    icon = "icons/ship_parts/defense_grid.png"

Part
    name = "SH_DEFENSE_GRID"
    description = "SH_DEFENSE_GRID_DESC"
    class = Shield
    capacity = 0
    mountableSlotTypes = Internal
    buildcost = 40 * [[FLEET_UPKEEP_MULTIPLICATOR]]
    buildtime = 2
    location = OwnedBy empire = Source.Owner
    effectsgroups =
        EffectsGroup
            scope = Source
            activation = Source
            stackinggroup = "SHIELD_PART_STACK"
            effects = SetMaxShield value = Value + PartCapacity name = "SH_DEFENSE_GRID_BASE"
    icon = "icons/ship_parts/defense_grid.png"
A patch is attached. This gets Head working for me again, so I'd very much like to commit it right away.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: r 7847 crashes on Linux (Ubuntu)

#13 Post by Geoff the Medio »

What if, instead of removing all of DoubleComplexValueRefParser.cpp, you change the parser in it the same way?

Code: Select all

+            part_capacity
+                =   (
+                            tok.PartCapacity_ [ _a = construct<std::string>(_1) ]
+                        >   parse::label(Name_token) >> tok.string [ _d = new_<ValueRef::Constant<std::string> >(_1) ]
+                    ) [ _val = new_<ValueRef::ComplexVariable<double> >(_a, _b, _c, _d, _e) ]
+                ;
Edit: and also comment out the line getting the reference string_value_ref reference as well, if needed.

Also for the GenerateSitrepMessage effect, I suppose there isn't really any need to parse specifically value refs of a particular type... just taking whatever the scripter gives and passing it into the effect is probably fine.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: r 7847 crashes on Linux (Ubuntu)

#14 Post by Dilvish »

Geoff the Medio wrote:Edit: and also comment out the line getting the reference string_value_ref reference as well, if needed.
It turned out this line was the real culprit; before I posted the patch I had tried simply changing part_capacity within DoubleComplexValueRefParser.cpp, but hadn't commented out the declaration for the unused string parser and was still getting the crash due to some parser part (apparently the string parser) being insufficiently initialized. I've committed this change now.

Code: Select all

r7852 | dilvish-fo | 2015-01-19 14:04:17 -0800 (Mon, 19 Jan 2015) | 1 line
adjustment to the new PartCapacity parser to avoid a parser crash on Linux
Geoff the Medio wrote:Also for the GenerateSitrepMessage effect, I suppose there isn't really any need to parse specifically value refs of a particular type... just taking whatever the scripter gives and passing it into the effect is probably fine.
The problem with that parser was only arising when we were trying to simplify the main parse::value_ref_parser_rule<std::string>, so I don't think we really need to worry about it just now. Despite the fact that it includes some seemingly circular references to the double parser, apparently the way things were getting staged still let it work out. It might be good to try diagramming the sequence of parsers that get referenced by other parsers and see when each is getting initialized, that might help us avoid stumbling into more deadlocks.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: r 7847 crashes on Linux (Ubuntu)

#15 Post by Geoff the Medio »

Dilvish wrote:The problem with [GenerateSitrepMessage] parser was only arising when we were trying to simplify the main parse::value_ref_parser_rule<std::string>, so I don't think we really need to worry about it just now.
I've wanted to change it for some time anyway, and presently the fix for part_capacity is limited in that it doesn't accept proper ValueRefs as parameters. In the event there were ValueRefs to get part type names (what is the shield part on this ship, what is the most expensive part, or similar), it would be preferable to be able to use a ValueRef to get this info. And I expect to want to use a variety of string ValueRefs for accessing Species info via ComplexVariable<double>, including the names of species on planets or ships.

Edit: patch attached. If that works, maybe try switching the GenerateSitrepMessage data parser to take a proper string ValueRef instead of just a string constant.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]


Post Reply