I have problem with smartfox api c++

Post here your questions about the C++ API for SFS2X

Moderators: Lapo, Bax, MBagnati

alexdao
Posts: 11
Joined: 30 Sep 2015, 13:44

I have problem with smartfox api c++

Postby alexdao » 19 Nov 2015, 11:30

Dear friends,
My app use smartfox api c++ 1.1.6 and cocos2dx 3.8.1,

Sometime, my app crashed with details:

Code: Select all

0xb6dd39b8 tgkill
0xb6db03c1 pthread_kill
0xb6db0fd3 raise
0xb6dad795 (Missing)
0xb6dabf44 abort
0xa36da24b __gnu_cxx::__verbose_terminate_handler()
0xa36a45ad __cxxabiv1::__terminate(void (*)())
0xa36a4671 std::terminate()
0xa36a4e27 __cxa_pure_virtual
0xa29569f0 boost::detail::sp_counted_base::release()
0xa2956ac0 boost::detail::shared_count::~shared_count()
0xa29714cc boost::shared_ptr<std::string>::~shared_ptr()
0xa2cb7484 Sfs2X::Core::BaseEvent::~BaseEvent()
0xa2c60fbc Sfs2X::Core::SFSEvent::~SFSEvent()
0xa2c60ff4 void boost::checked_delete<Sfs2X::Core::SFSEvent>(Sfs2X::Core::SFSEvent*)
0xa2c68b78 boost::detail::sp_counted_impl_p<Sfs2X::Core::SFSEvent>::dispose()
0xa29569f0 boost::detail::sp_counted_base::release()
0xa2956ac0 boost::detail::shared_count::~shared_count()
0xa2974348 boost::shared_ptr<Sfs2X::Core::BaseEvent>::~shared_ptr()
0xa2c631a8 void std::_Destroy<boost::shared_ptr<Sfs2X::Core::BaseEvent> >(boost::shared_ptr<Sfs2X::Core::BaseEvent>*)
0xa2c61640 void std::_Destroy_aux<false>::__destroy<boost::shared_ptr<Sfs2X::Core::BaseEvent>*>(boost::shared_ptr<Sfs2X::Core::BaseEvent>*, boost::shared_ptr<Sfs2X::Core::BaseEvent>*)
0xa2c5d6f8 void std::_Destroy<boost::shared_ptr<Sfs2X::Core::BaseEvent>*>(boost::shared_ptr<Sfs2X::Core::BaseEvent>*, boost::shared_ptr<Sfs2X::Core::BaseEvent>*)
0xa2c5843c void std::_Destroy<boost::shared_ptr<Sfs2X::Core::BaseEvent>*, boost::shared_ptr<Sfs2X::Core::BaseEvent> >(boost::shared_ptr<Sfs2X::Core::BaseEvent>*, boost::shared_ptr<Sfs2X::Core::BaseEvent>*, std::allocator<boost::shared_ptr<Sfs2X::Core::BaseEvent> >&)
0xa2c55e2c std::vector<boost::shared_ptr<Sfs2X::Core::BaseEvent>, std::allocator<boost::shared_ptr<Sfs2X::Core::BaseEvent> > >::_M_erase_at_end(boost::shared_ptr<Sfs2X::Core::BaseEvent>*)
0xa2c4ec88 std::vector<boost::shared_ptr<Sfs2X::Core::BaseEvent>, std::allocator<boost::shared_ptr<Sfs2X::Core::BaseEvent> > >::clear()
0xa2c4a364 Sfs2X::SmartFox::ProcessEvents()
0xa297408c GameServer::updateEvent()
0xa2b6130c SceneManager::updateEvent(float)
0xa31a3b9c cocos2d::TimerTargetSelector::trigger(float)
0xa31a388c cocos2d::Timer::update(float)
0xa31af724 cocos2d::Scheduler::update(float)
0xa3170ef0 cocos2d::Director::drawScene()
0xa31754b0 cocos2d::DisplayLinkDirector::mainLoop()
0xa2e08504 Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender
0xaf2a9f65 (Missing)


Please help me fix it,

Many thanks!
User avatar
Lapo
Site Admin
Posts: 20113
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: I have problem with smartfox api c++

Postby Lapo » 19 Nov 2015, 14:41

Hi,
version 1.1.6 is pretty old, the latest version available is 1.6.1
I would highly recommend to update and see if the problem goes away: http://smartfoxserver.com/download/#p=client

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
MBagnati
Posts: 125
Joined: 12 Feb 2013, 10:57

Re: I have problem with smartfox api c++

Postby MBagnati » 25 Nov 2015, 16:10

Hi,
have you updated to rel. 1.6.1?
Is error still present in 1.6.1?

Thanks
alexdao
Posts: 11
Joined: 30 Sep 2015, 13:44

Re: I have problem with smartfox api c++

Postby alexdao » 28 Nov 2015, 09:50

MBagnati wrote:Hi,
have you updated to rel. 1.6.1?
Is error still present in 1.6.1?

Thanks

Hi, thank Mbagnati, i updated to 1.6.1, but, sometime, my app stills crash with error:

Code: Select all

>   SmartFoxClientApi.dll!boost::asio::detail::deadline_timer_service<boost::asio::time_traits<boost::posix_time::ptime> >::cancel(boost::asio::detail::deadline_timer_service<boost::asio::time_traits<boost::posix_time::ptime> >::implementation_type & impl, boost::system::error_code & ec) Line 108   C++
    SmartFoxClientApi.dll!boost::asio::deadline_timer_service<boost::posix_time::ptime,boost::asio::time_traits<boost::posix_time::ptime> >::cancel(boost::asio::detail::deadline_timer_service<boost::asio::time_traits<boost::posix_time::ptime> >::implementation_type & impl, boost::system::error_code & ec) Line 97   C++
    SmartFoxClientApi.dll!boost::asio::basic_deadline_timer<boost::posix_time::ptime,boost::asio::time_traits<boost::posix_time::ptime>,boost::asio::deadline_timer_service<boost::posix_time::ptime,boost::asio::time_traits<boost::posix_time::ptime> > >::cancel() Line 216   C++
    SmartFoxClientApi.dll!Sfs2X::Core::Sockets::TCPClient::OnBoostAsioConnect(const boost::system::error_code & code) Line 126   C++
    SmartFoxClientApi.dll!boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>::operator()(Sfs2X::Core::Sockets::TCPClient * p, const boost::system::error_code & a1) Line 165   C++
    SmartFoxClientApi.dll!boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> >::operator()<boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list1<boost::system::error_code const &> >(boost::_bi::type<void> __formal, boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &> & f, boost::_bi::list1<boost::system::error_code const &> & a, int __formal) Line 314   C++
    SmartFoxClientApi.dll!boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >::operator()<boost::system::error_code>(const boost::system::error_code & a1) Line 48   C++
    SmartFoxClientApi.dll!boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code>::operator()() Line 48   C++
    SmartFoxClientApi.dll!boost::asio::asio_handler_invoke<boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code> >(boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code> & function, ...) Line 70   C++
    SmartFoxClientApi.dll!boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code>,boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > > >(boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code> & function, boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > > & context) Line 37   C++
    SmartFoxClientApi.dll!boost::asio::detail::asio_handler_invoke<boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code>,boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code>(boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code> & function, boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code> * this_handler) Line 89   C++
    SmartFoxClientApi.dll!boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code>,boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code> >(boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code> & function, boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > >,boost::system::error_code> & context) Line 37   C++
    SmartFoxClientApi.dll!boost::asio::detail::reactive_socket_connect_op<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Sfs2X::Core::Sockets::TCPClient,boost::system::error_code const &>,boost::_bi::list2<boost::_bi::value<Sfs2X::Core::Sockets::TCPClient *>,boost::arg<1> > > >::do_complete(boost::asio::detail::win_iocp_io_service * owner, boost::asio::detail::win_iocp_operation * base, const boost::system::error_code & __formal, unsigned int __formal) Line 93   C++
    SmartFoxClientApi.dll!boost::asio::detail::win_iocp_operation::complete(boost::asio::detail::win_iocp_io_service & owner, const boost::system::error_code & ec, unsigned int bytes_transferred) Line 46   C++
    SmartFoxClientApi.dll!boost::asio::detail::win_iocp_io_service::do_one(bool block, boost::system::error_code & ec) Line 404   C++
    SmartFoxClientApi.dll!boost::asio::detail::win_iocp_io_service::run(boost::system::error_code & ec) Line 162   C++
    SmartFoxClientApi.dll!boost::asio::io_service::run() Line 59   C++
    SmartFoxClientApi.dll!boost::_mfi::mf0<unsigned int,boost::asio::io_service>::call<boost::shared_ptr<boost::asio::io_service> >(boost::shared_ptr<boost::asio::io_service> & u, const void * __formal) Line 40   C++
    SmartFoxClientApi.dll!boost::_mfi::mf0<unsigned int,boost::asio::io_service>::operator()<boost::shared_ptr<boost::asio::io_service> >(boost::shared_ptr<boost::asio::io_service> & u) Line 56   C++
    SmartFoxClientApi.dll!boost::_bi::list1<boost::_bi::value<boost::shared_ptr<boost::asio::io_service> > >::operator()<unsigned int,boost::_mfi::mf0<unsigned int,boost::asio::io_service>,boost::_bi::list0>(boost::_bi::type<unsigned int> __formal, boost::_mfi::mf0<unsigned int,boost::asio::io_service> & f, boost::_bi::list0 & a, long __formal) Line 244   C++
    SmartFoxClientApi.dll!boost::_bi::bind_t<unsigned int,boost::_mfi::mf0<unsigned int,boost::asio::io_service>,boost::_bi::list1<boost::_bi::value<boost::shared_ptr<boost::asio::io_service> > > >::operator()() Line 21   C++
    SmartFoxClientApi.dll!boost::detail::thread_data<boost::_bi::bind_t<unsigned int,boost::_mfi::mf0<unsigned int,boost::asio::io_service>,boost::_bi::list1<boost::_bi::value<boost::shared_ptr<boost::asio::io_service> > > > >::run() Line 118   C++
    SmartFoxClientApi.dll!boost::`anonymous namespace'::thread_start_function(void * param) Line 217   C++


Can you fix it for me?

Thanks
MBagnati
Posts: 125
Joined: 12 Feb 2013, 10:57

Re: I have problem with smartfox api c++

Postby MBagnati » 30 Nov 2015, 03:09

Hi,
Your stack trace shows the call of Sfs2X::Core::Sockets::TCPClient::OnBoostAsioConnect method.
It is a callback invoked when the TCP establishes a connection with SmartFoxServer.
At the begin of Sfs2X::Core::Sockets::TCPClient::OnBoostAsioConnect there is a statement to stop a timer used to measure the time spent for connection.
Stack trace goes up to this point, so seems that error occurs when API tries to stop the connection timer.
Please can you give me additional info?
When you see the crash, what are you doing?
Is your game initializing something because it has just established the connection with SmartFoxServer?
Are you perform a shutdown of just established connection with SmartFoxServer?
dungdt
Posts: 13
Joined: 11 Dec 2015, 02:19

Re: I have problem with smartfox api c++

Postby dungdt » 28 Dec 2015, 03:33

I'have been crashed the same Alexdao.

But before i'm using the function killConnection() to disconnect the connection becase the app after 30s not receive ping messsage (every 5s).

Call that function could be caused the crash ?
User avatar
Lapo
Site Admin
Posts: 20113
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: I have problem with smartfox api c++

Postby Lapo » 28 Dec 2015, 08:21

Hi,
the killConnection method is there only for testing purposes, for the reconnection system.

If you want to disconnect the client you should call the SmartFox.disconnect() method.

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C++ API”

Who is online

Users browsing this forum: No registered users and 1 guest