Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

iOS 9: Crash in mbgl::HTTPRequest::start() #1911

Closed

Description

@quicklywilliam

Top of master, hitting the assertion in the first line of the function. Here's the stack:

#3  0x00000001004c308c in mbgl::HTTPRequest::start() at /Users/admin/Developer/mapbox-gl-native/platform/darwin/http_request_nsurl.mm:152
#4  0x00000001004c7060 in mbgl::HTTPRequest::retry()::$_2::operator()() const at /Users/admin/Developer/mapbox-gl-native/platform/darwin/http_request_nsurl.mm:361
#5  0x00000001004c6e5c in decltype(std::__1::forward<mbgl::HTTPRequest::retry()::$_2&>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<mbgl::HTTPRequest::retry()::$_2&>(mbgl::HTTPRequest::retry()::$_2&&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:413
#6  0x00000001004c6e48 in std::__1::__function::__func<mbgl::HTTPRequest::retry()::$_2, std::__1::allocator<mbgl::HTTPRequest::retry()::$_2>, void ()>::operator()() at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1370
#7  0x000000010026fffc in std::__1::function<void ()>::operator()() const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1756
#8  0x00000001004c96dc in uv::timer::timer_cb(uv_timer_s*, int) at /Users/admin/Developer/mapbox-gl-native/src/mbgl/util/uv_detail.hpp:161
#9  0x0000000100548c58 in uv__run_timers at /Users/admin/Developer/mapbox-gl-native/mason_packages/.build/libuv-0.10.28/src/unix/timer.c:146
#10 0x0000000100541e00 in uv_run at /Users/admin/Developer/mapbox-gl-native/mason_packages/.build/libuv-0.10.28/src/unix/core.c:308
#11 0x000000010017f6d4 in uv::loop::run() at /Users/admin/Developer/mapbox-gl-native/src/mbgl/util/uv_detail.hpp:62
#12 0x000000010036e178 in void mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::run<std::__1::tuple<mbgl::FileCache*&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>, 0ul, 1ul>(mbgl::util::ThreadContext, std::__1::tuple<mbgl::FileCache*&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) at /Users/admin/Developer/mapbox-gl-native/src/mbgl/util/thread.hpp:125
#13 0x000000010036e02c in mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<mbgl::FileCache*&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(mbgl::util::ThreadContext const&, mbgl::FileCache*&&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&)::'lambda'()::operator()() const at /Users/admin/Developer/mapbox-gl-native/src/mbgl/util/thread.hpp:104
#14 0x000000010036dd10 in std::__1::__invoke<mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<mbgl::FileCache*&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(mbgl::util::ThreadContext const&, mbgl::FileCache*&&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&)::'lambda'()>(decltype(std::__1::forward<mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<mbgl::FileCache*&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(mbgl::util::ThreadContext const&, mbgl::FileCache*&&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&)::'lambda'()>(fp)(std::__1::forward<>(fp0))), mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<mbgl::FileCache*&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(mbgl::util::ThreadContext const&, mbgl::FileCache*&&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&)::'lambda'()&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:413
#15 0x000000010036dd04 in _ZNSt3__116__thread_executeIZN4mbgl4util6ThreadINS1_17DefaultFileSource4ImplEEC1IJRPNS1_9FileCacheERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEERKNS2_13ThreadContextEDpOT_EUlvE_JEJEEEvRNS_5tupleIJT_DpT0_EEENS_15__tuple_indicesIJXspT1_EEEE [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:332
#16 0x000000010036dcf4 in std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<mbgl::FileCache*&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(mbgl::util::ThreadContext const&, mbgl::FileCache*&&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&)::'lambda'()> >(void*, void*) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:342

Running iOS 9 beta 4.

Activity

  1. added
    iOS
    on Jul 21, 2015
  2. quicklywilliam commented on Jul 22, 2015

    @quicklywilliam
    Author

    Cannot reproduce this on iOS 8.4.

  3. quicklywilliam commented on Jul 22, 2015

    @quicklywilliam
    Author

    To be clear, I'm not positive this is caused by iOS 9b4, just haven't had luck reproducing on my 8.4 device yet.

  4. incanus commented on Jul 22, 2015

    @incanus
    Contributor

    I'm testing master as of 93e1ced, built in Xcode 6.4 against 8.4 (since we don't yet have Mason libs for 9.0), and running on an iPod touch with 9.0b4. Not seeing this happen.

    @quicklywilliam Is this sporadic, very frequent, ?? Any particular triggers?

  5. incanus commented on Jul 23, 2015

    @incanus
    Contributor

    [got access to @quicklywilliam's custom style]

    Not sure if it's a factor, but I still don't get the crash. I am seeing a lot of e.g.

    [ERROR] {Map}[Style]: Failed to parse [10/292/392]: pbf unknown field type exception
    
  6. added this to the milestone on Jul 27, 2015
  7. 1ec5 commented on Jul 27, 2015

    @1ec5
    Contributor

    This assertion failure reproduces every time on a stock iosapp running in the iOS 9.0 Simulator in Xcode 7.

  8. 1ec5 commented on Jul 27, 2015

    @1ec5
    Contributor

    The failure occurs because of a reachability notification that fires on iOS 9 but not earlier OSes, causing a call to HTTPRequest::retry() that’s probably unexpected:

    #0  0x000000010423bea2 in -[MGLMapView reachabilityChanged:] at /path/to/mapbox-gl-native/platform/ios/MGLMapView.mm:417
    #1  0x0000000105f1d7fc in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ ()
    #2  0x0000000105f1d53b in _CFXRegistrationPost ()
    #3  0x0000000105f1d2a2 in ___CFXNotificationPost_block_invoke ()
    #4  0x0000000105f62c02 in -[_CFXNotificationRegistrar find:object:observer:enumerator:] ()
    #5  0x0000000105e18e78 in _CFXNotificationPost ()
    #6  0x0000000105391cd7 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
    #7  0x000000010422e3c2 in __39-[MGLReachability reachabilityChanged:]_block_invoke at /path/to/mapbox-gl-native/platform/darwin/reachability.m:455
    …
    Enqueued from com.tonymillion.reachability (Thread 4)Queue : com.tonymillion.reachability (serial)
    #0  0x0000000107acdbf4 in _dispatch_barrier_async_f ()
    #1  0x000000010422e32e in -[MGLReachability reachabilityChanged:] at /path/to/mapbox-gl-native/platform/darwin/reachability.m:454
    #2  0x000000010422d803 in TMReachabilityCallback at /path/to/mapbox-gl-native/platform/darwin/reachability.m:82
    
    #0  0x0000000109ee1210 in mbgl::HTTPRequest::retry() at /path/to/mapbox-gl-native/platform/darwin/http_request_nsurl.mm:362
    #1  0x0000000109ce01ed in mbgl::HTTPContext::retryRequests() at /path/to/mapbox-gl-native/src/mbgl/storage/http_context.cpp:26
    #2  0x0000000109ce1666 in mbgl::HTTPContext::HTTPContext(uv_loop_s*)::$_0::operator()() const at /path/to/mapbox-gl-native/src/mbgl/storage/http_context.cpp:6
    

    /cc @kkaefer @jfirebaugh

  9. changed the title [-]Crash in mbgl::HTTPRequest::start()[/-] [+]iOS 9: Crash in mbgl::HTTPRequest::start()[/+] on Jul 27, 2015
  10. 1ec5 commented on Jul 27, 2015

    @1ec5
    Contributor

    The reachability notification shouldn’t be firing, since (at least in my case) we start out reachable.

  11. 1ec5 commented on Jul 28, 2015

    @1ec5
    Contributor

    This is a change in behavior in SystemConfiguration in iOS 9. Radar forthcoming.

  12. self-assigned this
    on Jul 28, 2015
  13. 1ec5 commented on Jul 28, 2015

    @1ec5
    Contributor

    Here’s the Radar, and a workaround is in #1958.

  14. added a commit that references this issue on Jul 29, 2015
    807d87f
  15. 1ec5 commented on Aug 5, 2015

    @1ec5
    Contributor

    The Radar was closed as a duplicate of rdar://problem/21882003.

  16. added a commit that references this issue on Nov 6, 2015
    4d89f88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

crashiOS

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions