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

Segfault on second session in hostless mode #1897

Closed
o01eg opened this Issue Dec 1, 2017 · 10 comments

Comments

Projects
None yet
4 participants
@o01eg
Contributor

o01eg commented Dec 1, 2017

Environment

  • FreeOrion Version: b19e4dd
  • Operating System: Gentoo Linux AMD64
  • Graphic card used: NVIDIA GeForce 750Ti
  • Fetched as
    • Compiled from source

Description

At some turn in second or later game happens segmentation fault:

Thread 271 "freeoriond" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe769d700 (LWP 958)]
Condition::(anonymous namespace)::SpeciesSimpleMatch::operator() (candidate=std::shared_ptr (expired, weak 0) 0x7fffe769bb10, this=<optimized out>)
    at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:4129
4129	                return !species_name.empty() && (m_names.empty() || (std::find(m_names.begin(), m_names.end(), species_name) != m_names.end()));
(gdb) bt
#0  Condition::(anonymous namespace)::SpeciesSimpleMatch::operator() (candidate=std::shared_ptr (expired, weak 0) 0x7fffe769bb10, this=<optimized out>)
    at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:4129
#1  (anonymous namespace)::EvalImpl<Condition::(anonymous namespace)::SpeciesSimpleMatch> (pred=..., search_domain=Condition::NON_MATCHES, non_matches=..., 
    matches=...) at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:112
#2  Condition::Species::Eval (this=<optimized out>, parent_context=..., matches=..., non_matches=..., search_domain=<optimized out>)
    at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:4160
#3  0x00007ffff63205b2 in Condition::And::Eval (this=0x604000d6d9d0, parent_context=..., matches=std::vector of length 0, capacity 349, non_matches=..., 
    search_domain=<optimized out>) at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:9407
#4  0x00007ffff62f3061 in Condition::ConditionBase::Eval (this=this@entry=0x604000d6d9d0, parent_context=..., matches=std::vector of length 0, capacity 349)
    at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:276
#5  0x00007ffff653817a in (anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem::GetConditionMatches (source=..., 
    target_objects=std::vector of length 0, capacity 0, source_context=..., cached_condition_matches=..., cond=0x604000d6d9d0)
    at /mnt/another/srcs/GIT/freeorion/universe/Universe.cpp:1008
#6  (anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem::operator() (this=this@entry=0x60b000bf6d40)
    at /mnt/another/srcs/GIT/freeorion/universe/Universe.cpp:1077
#7  0x00007ffff653ad0b in ThreadQueue<(anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem>::operator() (this=0x60b000cf4850)
    at /mnt/another/srcs/GIT/freeorion/universe/../util/RunQueue.tcc:22
#8  boost::detail::thread_data<boost::reference_wrapper<ThreadQueue<(anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem> > >::run (
    this=<optimized out>) at /usr/include/boost/thread/detail/thread.hpp:136
#9  0x00007ffff33410cd in ?? () from /usr/lib64/libboost_thread.so.1.63.0
#10 0x00007ffff25de637 in start_thread () from /lib64/libpthread.so.0
#11 0x00007ffff231ed2f in clone () from /lib64/libc.so.6
(gdb) bt full
#0  Condition::(anonymous namespace)::SpeciesSimpleMatch::operator() (candidate=std::shared_ptr (expired, weak 0) 0x7fffe769bb10, this=<optimized out>)
    at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:4129
No locals.
#1  (anonymous namespace)::EvalImpl<Condition::(anonymous namespace)::SpeciesSimpleMatch> (pred=..., search_domain=Condition::NON_MATCHES, non_matches=..., 
    matches=...) at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:112
        it = std::shared_ptr (count 4, weak 1) 0x6120000febd0
        to_set = std::vector of length 44, capacity 349 = {std::shared_ptr (count 55, weak 1) 0x6150078eb810, 
          std::shared_ptr (count 15, weak 1) 0x6130001009d0, std::shared_ptr (count 16, weak 1) 0x61300003af90, 
          std::shared_ptr (count 15, weak 1) 0x61300003b310, std::shared_ptr (count 15, weak 1) 0x6130002ef6d0, 
          std::shared_ptr (count 15, weak 1) 0x6130002efc10, std::shared_ptr (count 27, weak 1) 0x6150078f0090, 
          std::shared_ptr (count 3, weak 1) 0x6130002d0950, std::shared_ptr (count 3, weak 1) 0x6130002d0e90, 
          std::shared_ptr (count 3, weak 1) 0x6130002d13d0, std::shared_ptr (count 4, weak 1) 0x6150090d5890, 
          std::shared_ptr (count 3, weak 1) 0x613000276c90, std::shared_ptr (count 3, weak 1) 0x613000277010, 
          std::shared_ptr (count 3, weak 1) 0x61300026fad0, std::shared_ptr (count 3, weak 1) 0x61300026fe50, 
          std::shared_ptr (count 15, weak 1) 0x6130000d70d0, std::shared_ptr (count 16, weak 1) 0x6130000bc950, 
          std::shared_ptr (count 15, weak 1) 0x6130000bccd0, std::shared_ptr (count 15, weak 1) 0x6130000bc410, 
          std::shared_ptr (count 15, weak 1) 0x61300002c190, std::shared_ptr (count 4, weak 1) 0x61500002b290, 
          std::shared_ptr (count 34, weak 1) 0x61500773fd90, std::shared_ptr (count 4, weak 1) 0x61500002c190, 
          std::shared_ptr (count 31, weak 1) 0x615007742810, std::shared_ptr (count 12, weak 1) 0x615004371810, 
          std::shared_ptr (count 50, weak 1) 0x615005201290, std::shared_ptr (count 34, weak 1) 0x615005201510, 
          std::shared_ptr (count 3, weak 1) 0x6130001dd1d0, std::shared_ptr (count 27, weak 1) 0x615005202190, 
          std::shared_ptr (count 3, weak 1) 0x6130001dd550, std::shared_ptr (count 27, weak 1) 0x615005204210, 
          std::shared_ptr (count 3, weak 1) 0x6130001dd8d0, std::shared_ptr (count 39, weak 1) 0x6150052e1b10, 
          std::shared_ptr (count 3, weak 1) 0x6130001ddc50, std::shared_ptr (count 4, weak 1) 0x61500015ac10, 
          std::shared_ptr (count 4, weak 1) 0x61500a1fac10, std::shared_ptr (count 12, weak 1) 0x61500c6c6990, 
          std::shared_ptr (count 8, weak 1) 0x61500c6c6e90, std::shared_ptr (count 55, weak 1) 0x6150052e3190, 
          std::shared_ptr (count 29, weak 1) 0x6150052e3690, std::shared_ptr (count 27, weak 1) 0x6150052e5490, 
          std::shared_ptr (count 55, weak 1) 0x615006cfcd10, std::shared_ptr (count 62, weak 1) 0x615006cfcf90, 
          std::shared_ptr (count 34, weak 1) 0x61500768ac10}
#2  Condition::Species::Eval (this=<optimized out>, parent_context=..., matches=..., non_matches=..., search_domain=<optimized out>)
    at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:4160
        simple_eval_safe = true
#3  0x00007ffff63205b2 in Condition::And::Eval (this=0x604000d6d9d0, parent_context=..., matches=std::vector of length 0, capacity 349, non_matches=..., 
    search_domain=<optimized out>) at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:9407
No locals.
#4  0x00007ffff62f3061 in Condition::ConditionBase::Eval (this=this@entry=0x604000d6d9d0, parent_context=..., matches=std::vector of length 0, capacity 349)
    at /mnt/another/srcs/GIT/freeorion/universe/Condition.cpp:276
No locals.
#5  0x00007ffff653817a in (anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem::GetConditionMatches (source=..., 
    target_objects=std::vector of length 0, capacity 0, source_context=..., cached_condition_matches=..., cond=0x604000d6d9d0)
    at /mnt/another/srcs/GIT/freeorion/universe/Universe.cpp:1008
        cache_entry = 0x60700005d578
        target_set = 0x60700005d580
        matched_target_objects = std::vector of length 0, capacity 349
#6  (anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem::operator() (this=this@entry=0x60b000bf6d40)
    at /mnt/another/srcs/GIT/freeorion/universe/Universe.cpp:1077
        source_invariant = <optimized out>
        condition_cache = <optimized out>
        __for_range = <optimized out>
#7  0x00007ffff653ad0b in ThreadQueue<(anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem>::operator() (this=0x60b000cf4850)
    at /mnt/another/srcs/GIT/freeorion/universe/../util/RunQueue.tcc:22
        current_item = 0x60b000bf6d40
#8  boost::detail::thread_data<boost::reference_wrapper<ThreadQueue<(anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem> > >::run (
    this=<optimized out>) at /usr/include/boost/thread/detail/thread.hpp:136
No locals.
#9  0x00007ffff33410cd in ?? () from /usr/lib64/libboost_thread.so.1.63.0
No symbol table info available.
#10 0x00007ffff25de637 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#11 0x00007ffff231ed2f in clone () from /lib64/libc.so.6
No symbol table info available.
(gdb) bt
Thread 1 (Thread 0x7ffff7f90780 (LWP 28254)):
#0  0x00007ffff25e5486 in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007ffff6576de3 in boost::condition_variable_any::wait<boost::unique_lock<boost::shared_mutex> > (this=0x7fffffffab58, m=...)
    at /usr/include/boost/thread/pthread/condition_variable.hpp:178
#2  0x00007ffff6558227 in RunQueue<(anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem>::Wait (lock=..., this=0x7fffffffa9c0)
    at /mnt/another/srcs/GIT/freeorion/universe/../util/RunQueue.tcc:109
#3  Universe::GetEffectsAndTargets (this=this@entry=0x7fffffffc7b8, targets_causes=std::vector of length 0, capacity 0, 
    target_objects=std::vector of length 0, capacity 0) at /mnt/another/srcs/GIT/freeorion/universe/Universe.cpp:1435
#4  0x00007ffff655a02b in Universe::GetEffectsAndTargets (this=this@entry=0x7fffffffc7b8, targets_causes=std::vector of length 0, capacity 0)
    at /mnt/another/srcs/GIT/freeorion/universe/Universe.cpp:1111

#5  0x00007ffff655f1bc in Universe::ApplyMeterEffectsAndUpdateMeters (this=this@entry=0x7fffffffc7b8, do_accounting=do_accounting@entry=false)
    at /mnt/another/srcs/GIT/freeorion/universe/Universe.cpp:551
#6  0x0000000000828c12 in ServerApp::PostCombatProcessTurns (this=this@entry=0x7fffffffc780) at /mnt/another/srcs/GIT/freeorion/server/ServerApp.cpp:3169
#7  0x0000000000896a22 in ProcessingTurn::react (this=<optimized out>, u=...) at /mnt/another/srcs/GIT/freeorion/server/ServerFSM.cpp:2214
#8  0x00000000008c5a92 in boost::statechart::custom_reaction<ProcessTurn>::react<ProcessingTurn, boost::statechart::event_base, void const*> (
    eventType=<synthetic pointer>: <optimized out>, evt=..., stt=...) at /usr/include/boost/statechart/custom_reaction.hpp:41
#9  boost::statechart::simple_state<ProcessingTurn, PlayingGame, boost::mpl::list<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_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, (boost::statechart::history_mode)0>::local_react_impl_non_empty::local_react_impl<boost::mpl::list<boost::statechart::custom_reaction<ProcessTurn>, boost::statechart::deferral<SaveGameRequest>, boost::statechart::deferral<TurnOrders>, boost::statechart::deferral<Diplomacy>, boost::statechart::custom_reaction<CheckTurnEndConditions>, 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>, boost::statechart::simple_state<ProcessingTurn, PlayingGame, boost::mpl::list<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_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, (boost::statechart::history_mode)0> > (
    eventType=0xc2a620 <boost::statechart::detail::id_holder<ProcessTurn>::idProvider_>, evt=..., stt=...)
    at /usr/include/boost/statechart/simple_state.hpp:816
#10 boost::statechart::simple_state<ProcessingTurn, PlayingGame, boost::mpl::list<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_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, (boost::statechart::history_mode)0>::local_react<boost::mpl::list<boost::statechart::custom_reaction<ProcessTurn>, boost::statechart::deferral<SaveGameRequest>, boost::statechart::deferral<TurnOrders>, boost::statechart::deferral<Diplomacy>, boost::statechart::custom_reaction<CheckTurnEndConditions>, 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> > (
---Type <return> to continue, or q <return> to quit---
    eventType=0xc2a620 <boost::statechart::detail::id_holder<ProcessTurn>::idProvider_>, evt=..., this=0x604002af3010)
    at /usr/include/boost/statechart/simple_state.hpp:851
#11 boost::statechart::simple_state<ProcessingTurn, PlayingGame, boost::mpl::list<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_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, (boost::statechart::history_mode)0>::react_impl (this=0x604002af3010, evt=..., eventType=0xc2a620 <boost::statechart::detail::id_holder<ProcessTurn>::idProvider_>)
    at /usr/include/boost/statechart/simple_state.hpp:489
#12 0x0000000000862aa6 in boost::statechart::detail::send_function<boost::statechart::detail::state_base<std::allocator<void>, boost::statechart::detail::rtti_policy>, boost::statechart::event_base, void const*>::operator() (this=<synthetic pointer>) at /usr/include/boost/statechart/state_machine.hpp:86
#13 boost::statechart::null_exception_translator::operator()<boost::statechart::detail::send_function<boost::statechart::detail::state_base<std::allocator<void>, boost::statechart::detail::rtti_policy>, boost::statechart::event_base, void const*>, boost::statechart::state_machine<ServerFSM, Idle, std::allocator<void>, boost::statechart::null_exception_translator>::exception_event_handler> (this=0x612000005c30, action=...)
    at /usr/include/boost/statechart/null_exception_translator.hpp:33
#14 boost::statechart::state_machine<ServerFSM, Idle, std::allocator<void>, boost::statechart::null_exception_translator>::send_event (evt=..., 
    this=0x612000005bc0) at /usr/include/boost/statechart/state_machine.hpp:885
#15 boost::statechart::state_machine<ServerFSM, Idle, std::allocator<void>, boost::statechart::null_exception_translator>::process_queued_events (
    this=this@entry=0x612000005bc0) at /usr/include/boost/statechart/state_machine.hpp:910
#16 0x0000000000862e7d in boost::statechart::state_machine<ServerFSM, Idle, std::allocator<void>, boost::statechart::null_exception_translator>::process_event (this=0x612000005bc0, evt=...) at /usr/include/boost/statechart/state_machine.hpp:280
#17 0x0000000000825abd in ServerApp::HandleMessage (this=<optimized out>, msg=..., player_connection=...)
    at /mnt/another/srcs/GIT/freeorion/server/ServerApp.cpp:418
#18 0x0000000000849783 in boost::_mfi::mf2<void, ServerApp, Message const&, std::shared_ptr<PlayerConnection> >::operator() (
    a2=std::shared_ptr (empty) 0x7fffffffbb20, a1=..., p=0x7fffffffc780, this=0x6070007f0f68) at /usr/include/boost/bind/mem_fn_template.hpp:280
#19 boost::_bi::list3<boost::_bi::value<ServerApp*>, boost::arg<1>, boost::arg<2> >::operator()<boost::_mfi::mf2<void, ServerApp, Message const&, std::shared_ptr<PlayerConnection> >, boost::_bi::rrlist2<Message, std::shared_ptr<PlayerConnection> > > (a=<synthetic pointer>..., f=..., this=0x6070007f0f78)
    at /usr/include/boost/bind/bind.hpp:398

#20 boost::_bi::bind_t<void, boost::_mfi::mf2<void, ServerApp, Message const&, std::shared_ptr<PlayerConnection> >, boost::_bi::list3<boost::_bi::value<ServerApp*>, boost::arg<1>, boost::arg<2> > >::operator()<Message, std::shared_ptr<PlayerConnection> >(Message&&, std::shared_ptr<PlayerConnection>&&) (
    a2=<optimized out>, a1=<unknown type in /mnt/new/o01eg/games/freeorion-testing/bin/freeoriond, CU 0x12d8446, DIE 0x145ccf1>, this=0x6070007f0f68)
    at /usr/include/boost/bind/bind.hpp:1318
#21 boost::detail::function::void_function_obj_invoker2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, ServerApp, Message const&, std::shared_ptr<PlayerConnection> >, boost::_bi::list3<boost::_bi::value<ServerApp*>, boost::arg<1>, boost::arg<2> > >, void, Message, std::shared_ptr<PlayerConnection> >::invoke (
    function_obj_ptr=..., a0=..., a1=...) at /usr/include/boost/function/function_template.hpp:159
#22 0x00000000004d741f in boost::function2<void, Message, std::shared_ptr<PlayerConnection> >::operator() (a1=std::shared_ptr (empty) 0x7fffffffbb80, 
    a0=..., this=0x6070007f0f60) at /usr/include/boost/function/function_template.hpp:771
#23 boost::_bi::list2<boost::_bi::value<Message>, boost::_bi::value<std::shared_ptr<PlayerConnection> > >::operator()<boost::function<void (Message, std::shared_ptr<PlayerConnection>)>, boost::_bi::list0>(boost::_bi::type<void>, boost::function<void (Message, std::shared_ptr<PlayerConnection>)>&, boost::_bi::list0&, int) (a=<synthetic pointer>..., f=..., this=0x6070007f0f80) at /usr/include/boost/bind/bind.hpp:319
#24 boost::_bi::bind_t<boost::_bi::unspecified, boost::function<void (Message, std::shared_ptr<PlayerConnection>)>, boost::_bi::list2<boost::_bi::value<Message>, boost::_bi::value<std::shared_ptr<PlayerConnection> > > >::operator()() (this=0x6070007f0f60) at /usr/include/boost/bind/bind.hpp:1294
#25 boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<boost::_bi::unspecified, boost::function<void (Message, std::shared_ptr<PlayerConnection>)>, boost::_bi::list2<boost::_bi::value<Message>, boost::_bi::value<std::shared_ptr<PlayerConnection> > > >, void>::invoke(boost::detail::function::function_buffer&) (function_obj_ptr=...) at /usr/include/boost/function/function_template.hpp:159
#26 0x00000000004b0b15 in boost::function0<void>::operator() (this=0x7fffffffbce0) at /usr/include/boost/function/function_template.hpp:771
#27 ServerNetworking::HandleNextEvent (this=this@entry=0x7fffffffd228) at /mnt/another/srcs/GIT/freeorion/network/ServerNetworking.cpp:539
#28 0x00000000008024a1 in ServerApp::Run (this=this@entry=0x7fffffffc780) at /mnt/another/srcs/GIT/freeorion/server/ServerApp.cpp:337
#29 0x0000000000802e4d in ServerApp::operator() (this=this@entry=0x7fffffffc780) at /mnt/another/srcs/GIT/freeorion/server/ServerApp.cpp:172
#30 0x0000000000451e44 in main (argc=<optimized out>, argv=<optimized out>) at /mnt/another/srcs/GIT/freeorion/server/dmain.cpp:79

Expected Result

Successful turn execution.

Steps to reproduce

  • Launch server in hostless mode.
  • Start the game.
  • Play near 10 turns.
  • Resign.
  • Start next game.
  • Play near 10 turns.
@o01eg

This comment has been minimized.

Show comment
Hide comment
Contributor

o01eg commented Dec 1, 2017

@geoffthemedio

This comment has been minimized.

Show comment
Hide comment
@geoffthemedio

geoffthemedio Mar 14, 2018

Member

Still occurring?

Member

geoffthemedio commented Mar 14, 2018

Still occurring?

@o01eg

This comment has been minimized.

Show comment
Hide comment
@o01eg

o01eg Mar 14, 2018

Contributor

@geoffthemedio No, it hasn't occuring. But I'm going to write unit test for hostless mode after #2050 will be finished.

Contributor

o01eg commented Mar 14, 2018

@geoffthemedio No, it hasn't occuring. But I'm going to write unit test for hostless mode after #2050 will be finished.

@Vezzra

This comment has been minimized.

Show comment
Hide comment
@Vezzra

Vezzra Mar 15, 2018

Member

But that means we can close this issue as resolved, right? @o01eg?

Member

Vezzra commented Mar 15, 2018

But that means we can close this issue as resolved, right? @o01eg?

@o01eg

This comment has been minimized.

Show comment
Hide comment
@o01eg

o01eg Mar 15, 2018

Contributor

Yep, I think it could be closed.

Contributor

o01eg commented Mar 15, 2018

Yep, I think it could be closed.

@o01eg

This comment has been minimized.

Show comment
Hide comment
@o01eg

o01eg Jun 19, 2018

Contributor

Got it again after 3 game with 100 turns in generation universe:

test log:

3Game. Connecting to server...
21:56:42.108712 [debug] network : ClientNetworking.cpp:335 : Attempt to connect to server at one of these addresses:
21:56:42.108893 [debug] network : ClientNetworking.cpp:337 :   tcp::resolver::iterator host_name: localhost  address: ::1  port: 12346
21:56:42.108942 [debug] network : ClientNetworking.cpp:337 :   tcp::resolver::iterator host_name: localhost  address: 127.0.0.1  port: 12346
21:56:42.109104 [debug] network : ClientNetworking.cpp:356 : Connected to server at host_name: localhost  address: ::1  port: 12346
21:56:42.109149 [debug] network : ClientNetworking.cpp:380 : Connecting to server took 0 ms.
21:56:42.109180 [debug] network : ClientNetworking.cpp:383 : ConnectToServer() : starting networking thread
21:56:43.109559 [info] test : ClientAppFixture.cpp:135 : Handle message SET_AUTH_ROLES
21:56:43.109665 [info] test : ClientAppFixture.cpp:135 : Handle message JOIN_GAME
21:56:43.109830 [debug] network : ClientNetworking.cpp:442 : ClientNetworking::SetPlayerID: player id set to: 1
21:56:43.109882 [info] test : ClientAppFixture.cpp:135 : Handle message CHECKSUM
21:56:43.219934 [debug] test : Building.cpp:407 : BuildingTypeManager checksum: 8935326
21:56:43.221044 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 1736867
21:56:43.221997 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 4856438
21:56:43.222887 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 6894379
21:56:43.228339 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 2026810
21:56:43.232220 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 2018647
21:56:43.232560 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 35252
21:56:43.350462 [debug] test : ShipDesign.cpp:766 : HullTypeManager checksum: 3240064
21:56:43.410497 [debug] test : ShipDesign.cpp:265 : PartTypeManager checksum: 1540152
21:56:43.414878 [debug] test : ShipDesign.cpp:1540 : PredefinedShipDesignManager checksum: 946116
21:56:43.906648 [debug] test : Species.cpp:629 : SpeciesManager checksum: 7179487
21:56:43.951425 [debug] test : Tech.cpp:715 : TechManager checksum: 5954953
21:56:43.951520 [info] test : ClientApp.cpp:175 : Checksum received from server matches client checksum.
21:56:43.951585 [info] test : ClientAppFixture.cpp:135 : Handle message HOST_ID
21:56:43.951632 [info] test : ClientAppFixture.cpp:135 : Handle message LOBBY_UPDATE
Entered to lobby
21:56:45.952689 [info] test : ClientAppFixture.cpp:135 : Handle message TURN_PROGRESS
21:56:45.952895 [info] test : ClientAppFixture.cpp:160 : Turn progress: STARTING_AIS
21:56:51.953651 [info] test : ClientAppFixture.cpp:135 : Handle message TURN_PROGRESS
21:56:51.953915 [info] test : ClientAppFixture.cpp:160 : Turn progress: GENERATING_UNIVERSE

gdb.log

Latest save from previous game: save.zip

freeoriond.log: log.zip

Contributor

o01eg commented Jun 19, 2018

Got it again after 3 game with 100 turns in generation universe:

test log:

3Game. Connecting to server...
21:56:42.108712 [debug] network : ClientNetworking.cpp:335 : Attempt to connect to server at one of these addresses:
21:56:42.108893 [debug] network : ClientNetworking.cpp:337 :   tcp::resolver::iterator host_name: localhost  address: ::1  port: 12346
21:56:42.108942 [debug] network : ClientNetworking.cpp:337 :   tcp::resolver::iterator host_name: localhost  address: 127.0.0.1  port: 12346
21:56:42.109104 [debug] network : ClientNetworking.cpp:356 : Connected to server at host_name: localhost  address: ::1  port: 12346
21:56:42.109149 [debug] network : ClientNetworking.cpp:380 : Connecting to server took 0 ms.
21:56:42.109180 [debug] network : ClientNetworking.cpp:383 : ConnectToServer() : starting networking thread
21:56:43.109559 [info] test : ClientAppFixture.cpp:135 : Handle message SET_AUTH_ROLES
21:56:43.109665 [info] test : ClientAppFixture.cpp:135 : Handle message JOIN_GAME
21:56:43.109830 [debug] network : ClientNetworking.cpp:442 : ClientNetworking::SetPlayerID: player id set to: 1
21:56:43.109882 [info] test : ClientAppFixture.cpp:135 : Handle message CHECKSUM
21:56:43.219934 [debug] test : Building.cpp:407 : BuildingTypeManager checksum: 8935326
21:56:43.221044 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 1736867
21:56:43.221997 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 4856438
21:56:43.222887 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 6894379
21:56:43.228339 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 2026810
21:56:43.232220 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 2018647
21:56:43.232560 [debug] test : Field.cpp:226 : FieldTypeManager checksum: 35252
21:56:43.350462 [debug] test : ShipDesign.cpp:766 : HullTypeManager checksum: 3240064
21:56:43.410497 [debug] test : ShipDesign.cpp:265 : PartTypeManager checksum: 1540152
21:56:43.414878 [debug] test : ShipDesign.cpp:1540 : PredefinedShipDesignManager checksum: 946116
21:56:43.906648 [debug] test : Species.cpp:629 : SpeciesManager checksum: 7179487
21:56:43.951425 [debug] test : Tech.cpp:715 : TechManager checksum: 5954953
21:56:43.951520 [info] test : ClientApp.cpp:175 : Checksum received from server matches client checksum.
21:56:43.951585 [info] test : ClientAppFixture.cpp:135 : Handle message HOST_ID
21:56:43.951632 [info] test : ClientAppFixture.cpp:135 : Handle message LOBBY_UPDATE
Entered to lobby
21:56:45.952689 [info] test : ClientAppFixture.cpp:135 : Handle message TURN_PROGRESS
21:56:45.952895 [info] test : ClientAppFixture.cpp:160 : Turn progress: STARTING_AIS
21:56:51.953651 [info] test : ClientAppFixture.cpp:135 : Handle message TURN_PROGRESS
21:56:51.953915 [info] test : ClientAppFixture.cpp:160 : Turn progress: GENERATING_UNIVERSE

gdb.log

Latest save from previous game: save.zip

freeoriond.log: log.zip

@o01eg o01eg reopened this Jun 19, 2018

@Vezzra Vezzra removed the status:resolved label Jun 24, 2018

@o01eg

This comment has been minimized.

Show comment
Hide comment
@o01eg

o01eg Aug 14, 2018

Contributor

It's looks like it could happen in the middle a game too:

Core was generated by `/usr/lib/freeorion/freeoriond --resource-dir /usr/share/games/freeorion/default'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f40c924a50d in Condition::(anonymous namespace)::SpeciesSimpleMatch::operator() (candidate=..., this=<optimized out>)
    at ./universe/Condition.cpp:4122
4122	./universe/Condition.cpp: No such file or directory.
[Current thread is 1 (Thread 0x7f40bb4c4700 (LWP 16028))]
(gdb) bt
#0  0x00007f40c924a50d in Condition::(anonymous namespace)::SpeciesSimpleMatch::operator() (
    candidate=std::shared_ptr<const UniverseObject> (expired, weak count 0) = {...}, this=<optimized out>) at ./universe/Condition.cpp:4122
#1  (anonymous namespace)::EvalImpl<Condition::(anonymous namespace)::SpeciesSimpleMatch> (pred=..., search_domain=Condition::NON_MATCHES, non_matches=..., 
    matches=...) at ./universe/Condition.cpp:111
#2  Condition::Species::Eval (this=<optimized out>, parent_context=..., matches=..., non_matches=..., search_domain=Condition::NON_MATCHES)
    at ./universe/Condition.cpp:4153
#3  0x00007f40c92619e6 in Condition::And::Eval (this=0x7f40843bb1c0, parent_context=..., matches=std::vector of length 0, capacity 383, 
    non_matches=std::vector of length 321, capacity 383 = {...}, search_domain=Condition::NON_MATCHES) at ./universe/Condition.cpp:9427
#4  0x00007f40c92361f6 in Condition::ConditionBase::Eval (this=this@entry=0x7f40843bb1c0, parent_context=..., matches=std::vector of length 0, capacity 383)
    at ./universe/Condition.cpp:275
#5  0x00007f40c93328b6 in (anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem::GetConditionMatches (
    source=std::shared_ptr<const UniverseObject> (empty) = {...}, match_log="", target_objects=std::vector of length 0, capacity 0, source_context=..., 
    cached_condition_matches=..., cond=0x7f40843bb1c0) at ./universe/Universe.cpp:1026
#6  (anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem::operator() (this=this@entry=0x7f40a85d7190) at ./universe/Universe.cpp:1107
#7  0x00007f40c9332be0 in ThreadQueue<(anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem>::operator() (this=0x7f40a8959450)
    at ./universe/../util/RunQueue.tcc:22
#8  boost::detail::thread_data<boost::reference_wrapper<ThreadQueue<(anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem> > >::run (
    this=<optimized out>) at /usr/include/boost/thread/detail/thread.hpp:136
#9  0x00007f40c5d58bcd in ?? () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1
#10 0x00007f40c7cbf6db in start_thread (arg=0x7f40bb4c4700) at pthread_create.c:463
#11 0x00007f40c661c88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Logs:
freeoriond.log.2018-08-10T18-45-58.zip

Contributor

o01eg commented Aug 14, 2018

It's looks like it could happen in the middle a game too:

Core was generated by `/usr/lib/freeorion/freeoriond --resource-dir /usr/share/games/freeorion/default'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f40c924a50d in Condition::(anonymous namespace)::SpeciesSimpleMatch::operator() (candidate=..., this=<optimized out>)
    at ./universe/Condition.cpp:4122
4122	./universe/Condition.cpp: No such file or directory.
[Current thread is 1 (Thread 0x7f40bb4c4700 (LWP 16028))]
(gdb) bt
#0  0x00007f40c924a50d in Condition::(anonymous namespace)::SpeciesSimpleMatch::operator() (
    candidate=std::shared_ptr<const UniverseObject> (expired, weak count 0) = {...}, this=<optimized out>) at ./universe/Condition.cpp:4122
#1  (anonymous namespace)::EvalImpl<Condition::(anonymous namespace)::SpeciesSimpleMatch> (pred=..., search_domain=Condition::NON_MATCHES, non_matches=..., 
    matches=...) at ./universe/Condition.cpp:111
#2  Condition::Species::Eval (this=<optimized out>, parent_context=..., matches=..., non_matches=..., search_domain=Condition::NON_MATCHES)
    at ./universe/Condition.cpp:4153
#3  0x00007f40c92619e6 in Condition::And::Eval (this=0x7f40843bb1c0, parent_context=..., matches=std::vector of length 0, capacity 383, 
    non_matches=std::vector of length 321, capacity 383 = {...}, search_domain=Condition::NON_MATCHES) at ./universe/Condition.cpp:9427
#4  0x00007f40c92361f6 in Condition::ConditionBase::Eval (this=this@entry=0x7f40843bb1c0, parent_context=..., matches=std::vector of length 0, capacity 383)
    at ./universe/Condition.cpp:275
#5  0x00007f40c93328b6 in (anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem::GetConditionMatches (
    source=std::shared_ptr<const UniverseObject> (empty) = {...}, match_log="", target_objects=std::vector of length 0, capacity 0, source_context=..., 
    cached_condition_matches=..., cond=0x7f40843bb1c0) at ./universe/Universe.cpp:1026
#6  (anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem::operator() (this=this@entry=0x7f40a85d7190) at ./universe/Universe.cpp:1107
#7  0x00007f40c9332be0 in ThreadQueue<(anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem>::operator() (this=0x7f40a8959450)
    at ./universe/../util/RunQueue.tcc:22
#8  boost::detail::thread_data<boost::reference_wrapper<ThreadQueue<(anonymous namespace)::StoreTargetsAndCausesOfEffectsGroupsWorkItem> > >::run (
    this=<optimized out>) at /usr/include/boost/thread/detail/thread.hpp:136
#9  0x00007f40c5d58bcd in ?? () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1
#10 0x00007f40c7cbf6db in start_thread (arg=0x7f40bb4c4700) at pthread_create.c:463
#11 0x00007f40c661c88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Logs:
freeoriond.log.2018-08-10T18-45-58.zip

@Vezzra Vezzra modified the milestones: v0.4.8 (optional), post 0.4.8 Aug 31, 2018

@o01eg

This comment has been minimized.

Show comment
Hide comment
@o01eg

o01eg Sep 5, 2018

Contributor

Looks like old objects aren't cleared from m_existing... map. ObjectMap::Clear clears only main maps.
In 75e6779 by @Dilvish-fo when maps of existing objects was introduced it wasn't considered them should be cleared too.
I could try to fix it but I want to know how it better to change code?

  • Is it correct to add those maps to FOR_EACH_SPECIALIZED_MAP macros so them will be processed with other maps too?
  • Get them new macros FOR_EACH_EXISTING_MAP or so and rewrite some old code to use it.
  • Simply repeat each map like it has already done in Remove and UpdateCurrentDestroyedObjects?

What should be done with ObjectMap::swap?
P.S. should existing object be shared_ptr instead weak_ptr? As I see main maps are already owns those objects.
P.P.S. Should GeneralizedLocation in universe/Pathfinder.cpp accept std::shared_ptr by value? It doesn't looks like takes ownership on this.

Contributor

o01eg commented Sep 5, 2018

Looks like old objects aren't cleared from m_existing... map. ObjectMap::Clear clears only main maps.
In 75e6779 by @Dilvish-fo when maps of existing objects was introduced it wasn't considered them should be cleared too.
I could try to fix it but I want to know how it better to change code?

  • Is it correct to add those maps to FOR_EACH_SPECIALIZED_MAP macros so them will be processed with other maps too?
  • Get them new macros FOR_EACH_EXISTING_MAP or so and rewrite some old code to use it.
  • Simply repeat each map like it has already done in Remove and UpdateCurrentDestroyedObjects?

What should be done with ObjectMap::swap?
P.S. should existing object be shared_ptr instead weak_ptr? As I see main maps are already owns those objects.
P.P.S. Should GeneralizedLocation in universe/Pathfinder.cpp accept std::shared_ptr by value? It doesn't looks like takes ownership on this.

@o01eg

This comment has been minimized.

Show comment
Hide comment
@o01eg

o01eg Sep 6, 2018

Contributor

I added std::map::clear and std::map::swap into ObjectMap::Clear and ObjectMap::swap for m_existing... maps and successfully got 20 game of 100 turns each on the one server without any errors.

Contributor

o01eg commented Sep 6, 2018

I added std::map::clear and std::map::swap into ObjectMap::Clear and ObjectMap::swap for m_existing... maps and successfully got 20 game of 100 turns each on the one server without any errors.

@Dilvish-fo

This comment has been minimized.

Show comment
Hide comment
@Dilvish-fo

Dilvish-fo Sep 6, 2018

Member

I don't have time just now to dig into this too much to try helping sort it out, but I'm glad to hear you are having some success with your latest attempt and I do have a couple comments.

Is it correct to add those maps to FOR_EACH_SPECIALIZED_MAP macros so them will be processed with other maps too?

I don't think that's the right approach, and for example would not be good for the use in ObjectMap::CopyObjectsToSpecializedMaps()

Get them new macros FOR_EACH_EXISTING_MAP or so and rewrite some old code to use it.
Simply repeat each map like it has already done in Remove and UpdateCurrentDestroyedObjects?

Either of those sound fine to me.

Member

Dilvish-fo commented Sep 6, 2018

I don't have time just now to dig into this too much to try helping sort it out, but I'm glad to hear you are having some success with your latest attempt and I do have a couple comments.

Is it correct to add those maps to FOR_EACH_SPECIALIZED_MAP macros so them will be processed with other maps too?

I don't think that's the right approach, and for example would not be good for the use in ObjectMap::CopyObjectsToSpecializedMaps()

Get them new macros FOR_EACH_EXISTING_MAP or so and rewrite some old code to use it.
Simply repeat each map like it has already done in Remove and UpdateCurrentDestroyedObjects?

Either of those sound fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment