Skip to content

Crash when HttpResponseDecoder::processBody doesn't get JSON response #1338

Description

@hanselip

Describe your environment.

  • Noticed with the latest bits of the library on Android
  • Network conditions are key: attempt to launch our app when a WiFi network is available but requires sign-in

Steps to reproduce.

  • Attempt to launch an app that integrated the library on a device with limited connectivity (e.g. sign-in required for the network)
  • When the library attempts to process an expected JSON response it fails and crashes our app

Additional context.

partial stack trace:

bool nlohmann::json_abi_v3_11_3::detail::parser<nlohmann::json_abi_v3_11_3::basic_json<std::__ndk1::map, std::__ndk1::vector, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, bool, long, unsigned long, double, std::__ndk1::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::__ndk1::vector<unsigned char, std::__ndk1::allocator >, void>, nlohmann::json_abi_v3_11_3::detail::iterator_input_adapter<char const*> >::sax_parse_internal<nlohmann::json_abi_v3_11_3::detail::json_sax_dom_parser<nlohmann::json_abi_v3_11_3::basic_json<std::__ndk1::map, std::__ndk1::vector, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, bool, long, unsigned long, double, std::__ndk1::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::__ndk1::vector<unsigned char, std::__ndk1::allocator >, void> > >(nlohmann::json_abi_v3_11_3::detail::json_sax_dom_parser<nlohmann::json_abi_v3_11_3::basic_json<std::__ndk1::map, std::__ndk1::vector, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, bool, long, unsigned long, double, std::__ndk1::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::__ndk1::vector<unsigned char, std::__ndk1::allocator >, void> >)+4044)
nlohmann::json_abi_v3_11_3::detail::parser<nlohmann::json_abi_v3_11_3::basic_json<std::__ndk1::map, std::__ndk1::vector, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, bool, long, unsigned long, double, std::__ndk1::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::__ndk1::vector<unsigned char, std::__ndk1::allocator >, void>, nlohmann::json_abi_v3_11_3::detail::iterator_input_adapter<char const
> >::parse(bool, nlohmann::json_abi_v3_11_3::basic_json<std::__ndk1::map, std::__ndk1::vector, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, bool, long, unsigned long, double, std::__ndk1::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::__ndk1::vector<unsigned char, std::__ndk1::allocator >, void>&)+124)
nlohmann::json_abi_v3_11_3::basic_json<std::__ndk1::map, std::__ndk1::vector, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, bool, long, unsigned long, double, std::__ndk1::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::__ndk1::vector<unsigned char, std::__ndk1::allocator >, void> nlohmann::json_abi_v3_11_3::basic_json<std::__ndk1::map, std::__ndk1::vector, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, bool, long, unsigned long, double, std::__ndk1::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::__ndk1::vector<unsigned char, std::__ndk1::allocator >, void>::parse<char const*>(char const*&&, std::__ndk1::function<bool (int, nlohmann::json_abi_v3_11_3::detail::parse_event_t, nlohmann::json_abi_v3_11_3::basic_json<std::__ndk1::map, std::__ndk1::vector, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, bool, long, unsigned long, double, std::__ndk1::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::__ndk1::vector<unsigned char, std::__ndk1::allocator >, void>&)>, bool, bool)+196)
Microsoft::Applications::Events::HttpResponseDecoder::processBody(Microsoft::Applications::Events::IHttpResponse const&, Microsoft::Applications::Events::HttpRequestResult&)+380)
Microsoft::Applications::Events::HttpResponseDecoder::handleDecode(std::__ndk1::shared_ptrMicrosoft::Applications::Events::EventsUploadContext const&)+216)
Microsoft::Applications::Events::HttpClientManager::onHttpResponse(Microsoft::Applications::Events::HttpClientManager::HttpCallback*)+176)
Microsoft::Applications::Events::PlatformAbstraction::WorkerThread::threadFunc(void*)+548)
void* std::__ndk1::__thread_proxy<std::__ndk1::tuple<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_deletestd::__ndk1::__thread_struct >, void ()(void), void*> >(void*)+44)

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions