EXC_BAD_ACCESS on iOS with C++ client

Hi,

I have integrated Nakama in my Apps and now run into a problem with the iOS client.

On a real device (in the simulator all is ok) my app crashes when trying to login to my Nakama server (with TLS enabled). In the stacktrace is see the app crashes on OPENSSL_sk_num() called from within the Nakama client (stacktrace of the last two calles included below).

Any one have similar issues or an idea how to fix this?

Thanks!

> |#0|0x0000000106e1afe4 in OPENSSL_sk_num ()|
> |---|---|
> |#1|0x0000000106e2df28 in X509_STORE_add_lookup ()|
> |#2|0x0000000106e2d6fc in X509_STORE_set_default_paths ()|
> |#3|0x0000000102a2fe88 in boost::asio::ssl::context::set_default_verify_paths(boost::system::error_code&) ()|
> |#4|0x0000000102a2f714 in boost::asio::ssl::context::set_default_verify_paths() ()|
> |#5|0x0000000102a2f3e0 in web::http::client::details::asio_connection::upgrade_to_ssl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::function<void (boost::asio::ssl::context&)> const&) ()|
> |#6|0x0000000102a257dc in web::http::client::details::asio_client::obtain_connection(web::http::http_request const&) ()|
> |#7|0x0000000102a17dc8 in web::http::client::details::asio_context::create_request_context(std::__1::shared_ptr<web::http::client::details::_http_client_communicator>&, web::http::http_request&) ()|
> |#8|0x0000000102a178e0 in web::http::client::details::asio_client::propagate(web::http::http_request) ()|
> |#9|0x000000010291524c in web::http::oauth2::details::oauth2_handler::propagate(web::http::http_request) ()|
> |#10|0x0000000102914dbc in web::http::oauth1::details::oauth1_handler::propagate(web::http::http_request) ()|
> |#11|0x0000000102910f94 in web::http::client::http_pipeline::propagate(web::http::http_request) ()|
> |#12|0x0000000102910cbc in web::http::client::http_client::request(web::http::http_request, pplx::cancellation_token const&) ()|
> |#13|0x0000000102a628f8 in Nakama::NHttpClientCppRest::request(Nakama::NHttpRequest const&, std::__1::function<void (std::__1::shared_ptr<Nakama::NHttpResponse>)> const&) ()|
> |#14|0x0000000102a8f8ec in Nakama::RestClient::sendReq(Nakama::RestReqContext*, Nakama::NHttpReqMethod, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::multimap<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >&&) ()|
> |#15|0x0000000102a95498 in Nakama::RestClient::authenticateCustom(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, std::__1::function<void (std::__1::shared_ptr<Nakama::NSessionInterface>)>, std::__1::function<void (Nakama::NError const&)>) ()|

For posterity again:

My app was linked with OpenSSL for local receipt validation. Apparently this did not play nice with the Nakama libs. After removing OpenSSL it worked. Receipt validation will now be done online via the Nakama server (thanks for the LUA modules!).

2 Likes