smartFoxClientApi c++ crash at init

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

Moderators: Lapo, Bax, MBagnati

cokdevelop@gmail.com
Posts: 8
Joined: 16 May 2018, 05:47

smartFoxClientApi c++ crash at init

Postby cokdevelop@gmail.com » 02 Nov 2018, 06:15

[img][img][/img][/img]i am using the c++ client api and i do the steps following Client API setup (http://docs2x.smartfoxserver.com/Gettin ... ios-xcode7) and success compile the smartFoxClienApi.a
when i use the smartFoxClienApi.a in my project the crash happened
my version is 1.6.4 and xcode 10 and the same with the version 1.7.5(already tryed)
can you help me to fix it

#17 0x000000010acd1b55 in boost::asio::ssl::detail::openssl_init_base::do_init::do_init() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/impl/openssl_init.ipp:39
#18 0x000000010acd19d5 in boost::asio::ssl::detail::openssl_init_base::do_init::do_init() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/impl/openssl_init.ipp:38
#19 0x000000010acd1871 in boost::asio::ssl::detail::openssl_init_base::instance() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/impl/openssl_init.ipp:131
#20 0x000000010acd17a2 in boost::asio::ssl::detail::openssl_init<true>::openssl_init() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/openssl_init.hpp:60
#21 0x000000010accd115 in boost::asio::ssl::detail::openssl_init<true>::openssl_init() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/openssl_init.hpp:61
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClientApi c++ crash at init

Postby Lapo » 02 Nov 2018, 08:26

Hi,
it's not very clear what the error is, as there is no error message, or rather, the stack trace is cut and it's not possible to understand the cause of the message.

Can you report the whole stack trace?
What platform are you compiling for? iOS?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
cokdevelop@gmail.com
Posts: 8
Joined: 16 May 2018, 05:47

Re: smartFoxClientApi c++ crash at init

Postby cokdevelop@gmail.com » 02 Nov 2018, 08:58

hi i build for ios
and the stack is


#0 0x0000000116757aa2 in _os_once_gate_recursive_abort ()
#1 0x0000000116757b57 in _os_once_gate_wait_slow ()
#2 0x00000001167668f9 in pthread_once ()
#3 0x000000010914ddd9 in CRYPTO_THREAD_run_once ()
#4 0x000000010914260a in OPENSSL_init_crypto ()
#5 0x0000000109137f2d in ERR_get_state ()
#6 0x0000000109137da3 in ERR_put_error ()
#7 0x000000010912fe7d in DSO_dsobyaddr ()
#8 0x0000000109142946 in ossl_init_base_ossl_ ()
#9 0x000000011676695e in __pthread_once_handler ()
#10 0x0000000116753f00 in _os_once ()
#11 0x00000001167668f9 in pthread_once ()
#12 0x000000010914ddd9 in CRYPTO_THREAD_run_once ()
#13 0x000000010914260a in OPENSSL_init_crypto ()
#14 0x000000010913fed8 in EVP_get_cipherbyname ()
#15 0x0000000109098f86 in ssl_load_ciphers ()
#16 0x00000001081b4bb1 in SSL_library_init ()
#17 0x0000000107ddeb55 in boost::asio::ssl::detail::openssl_init_base::do_init::do_init() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/impl/openssl_init.ipp:39
#18 0x0000000107dde9d5 in boost::asio::ssl::detail::openssl_init_base::do_init::do_init() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/impl/openssl_init.ipp:38
#19 0x0000000107dde871 in boost::asio::ssl::detail::openssl_init_base::instance() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/impl/openssl_init.ipp:131
#20 0x0000000107dde7a2 in boost::asio::ssl::detail::openssl_init<true>::openssl_init() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/openssl_init.hpp:60
#21 0x0000000107dda115 in boost::asio::ssl::detail::openssl_init<true>::openssl_init() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/openssl_init.hpp:61
#22 0x00000001081b8be4 in ::__cxx_global_var_init.22() at /Users/baolongsheng/Downloads/smartFox/SFS2X_Cpp_Examples/Connector/SFS2X_API_Cpp_v1.6.4/Core/BoostAsio/Unix/boost/asio/ssl/detail/openssl_init.hpp:90
#23 0x000000010d8bcf14 in ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) ()
#24 0x000000010d8bd112 in ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) ()
#25 0x000000010d8b8547 in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#26 0x000000010d8b7704 in ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#27 0x000000010d8b7798 in ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) ()
#28 0x000000010d8ab388 in dyld::initializeMainExecutable() ()
#29 0x000000010d8af497 in dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) ()
#30 0x000000010d8aa624 in start_sim ()
#31 0x000000010e96dded in dyld::useSimulatorDyld(int, macho_header const*, char const*, int, char const**, char const**, char const**, unsigned long*, unsigned long*) ()
#32 0x000000010e96b7a3 in dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) ()
#33 0x000000010e9673d4 in dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) ()
#34 0x000000010e9671d2 in _dyld_start ()
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClientApi c++ crash at init

Postby Lapo » 02 Nov 2018, 09:24

Did you follow the steps to build openssl here?
http://docs2x.smartfoxserver.com/Gettin ... ios-xcode7

Were you able to compile it without errors?
Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
cokdevelop@gmail.com
Posts: 8
Joined: 16 May 2018, 05:47

Re: smartFoxClientApi c++ crash at init

Postby cokdevelop@gmail.com » 02 Nov 2018, 09:27

yes i follow the steps to build openssl and there create libcrypto.a and libssl.a
cokdevelop@gmail.com
Posts: 8
Joined: 16 May 2018, 05:47

Re: smartFoxClientApi c++ crash at init

Postby cokdevelop@gmail.com » 02 Nov 2018, 09:31

Lapo wrote:Did you follow the steps to build openssl here?
http://docs2x.smartfoxserver.com/Gettin ... ios-xcode7

Were you able to compile it without errors?
Thanks



i success compile the project
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: smartFoxClientApi c++ crash at init

Postby Lapo » 05 Nov 2018, 11:48

A couple of ideas:

1) OpenSSL version
In our docs we say this:
Note that OpenSSL project has delivered since 2016 newest versions of the library like the version 1.1.0. Do not use versions greater than 1.0.2 because they are not compatible with Boost Library 1.59 used from client API.

Did you make sure to use a version <= 1.0.2?

2) Target architecture
Is it possible that OpenSSL was not compiled for the same target architecture? e.g. 32 vs 64 bit?

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C++ API”

Who is online

Users browsing this forum: No registered users and 16 guests