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.

Crash in HTTPRequest::handleResponse() #1837

Closed

Description

@kkaefer

I'm ocassionally seeing crashes in there on OS X with the NSURL backend, typically during the Storage.HTTPLoad test. I've also seen them on Travis, so they're probably not NSURL related. This crash on Travis might also be related.

...

Thread 27 (Thread 0x1057 of process 31381):
#0  0x00007fff88fcf286 in __pthread_kill () from /usr/lib/system/libsystem_kernel.dylib
#1  0x00007fff83d1242f in pthread_kill () from /usr/lib/system/libsystem_pthread.dylib
#2  0x00007fff8db02b53 in abort () from /usr/lib/system/libsystem_c.dylib
#3  0x000000010021756d in uv__async_send (wa=0x1003d018e <sqlite3_os_init.aVfs+558>) at src/unix/async.c:190
#4  0x000000010021744d in uv_async_send (handle=0x100a21560) at src/unix/async.c:58
#5  0x0000000100185f82 in send (this=0x0) at ../../src/mbgl/util/uv_detail.hpp:116
#6  mbgl::Request::notify (this=0x6, response_=...) at ../../src/mbgl/storage/request.cpp:55
#7  0x00000001001832ac in mbgl::DefaultFileSource::Impl::notify (this=0x105f81000, request=0x104405b00, response=..., hint=mbgl::FileCache::Hint::Full) at ../../src/mbgl/storage/default_file_source.cpp:174
#8  0x0000000100183488 in operator() (this=<optimized out>, res=..., hint=<optimized out>) at ../../src/mbgl/storage/default_file_source.cpp:131
#9  __invoke<(lambda at ../../src/mbgl/storage/default_file_source.cpp:130:21) &, std::__1::shared_ptr<const mbgl::Response>, mbgl::FileCache::Hint> (__args=<optimized out>, __args=<optimized out>, __f=...) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:413
#10 std::__1::__function::__func<mbgl::DefaultFileSource::Impl::startRealRequest(mbgl::DefaultFileRequest*, std::__1::shared_ptr<mbgl::Response const>)::$_1, std::__1::allocator<mbgl::DefaultFileSource::Impl::startRealRequest(mbgl::DefaultFileRequest*, std::__1::shared_ptr<mbgl::Response const>)::$_1>, void (std::__1::shared_ptr<mbgl::Response const>, mbgl::FileCache::Hint)>::operator()(std::__1::shared_ptr<mbgl::Response const>&&, mbgl::FileCache::Hint&&) (this=<optimized out>, __arg=<optimized out>, __arg=<optimized out>) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1370
#11 0x00000001001f3896 in operator() (__arg=..., this=<optimized out>, __arg=...) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1756
#12 mbgl::HTTPRequest::handleResponse() (this=0x6) at ../../platform/darwin/http_request_nsurl.mm:207
#13 0x00000001002173ef in uv__async_event (loop=0x100b56990, w=0x100b56b18, nevents=2) at src/unix/async.c:80
#14 0x00000001002177ea in uv__async_io (loop=0x100b56990, w=0x100b56b20, events=1) at src/unix/async.c:156
#15 0x0000000100233479 in uv__io_poll (loop=0x100b56990, timeout=-1) at src/unix/kqueue.c:233
#16 0x0000000100217ef1 in uv_run (loop=0x100b56990, mode=UV_RUN_DEFAULT) at src/unix/core.c:317
...

/cc @tmpsantos

Activity

  1. self-assigned this
    on Jul 10, 2015
  2. friedbunny commented on Jul 10, 2015

    @friedbunny
    Contributor

    Saw this crash today on master 30416c5, panning/zooming around the satellite layer in the simulator.

    * thread #9: tid = 0x36594e, 0x000000010d223286 libsystem_kernel.dylib`__pthread_kill + 10, name = 'FileSource', stop reason = signal SIGABRT
        frame #0: 0x000000010d223286 libsystem_kernel.dylib`__pthread_kill + 10
        frame #1: 0x000000010d25642f libsystem_pthread.dylib`pthread_kill + 90
        frame #2: 0x000000010cfc319a libsystem_sim_c.dylib`abort + 129
      * frame #3: 0x000000010990fa4f Mapbox GL`uv__async_send(wa=0x00007faa53e5018e) + 191 at async.c:190
        frame #4: 0x000000010990f92d Mapbox GL`uv_async_send(handle=0x00007faa56e0a640) + 61 at async.c:58
        frame #5: 0x00000001098f667e Mapbox GL`uv::async::send(this=0x00007faa56e64460) + 46 at uv_detail.hpp:116
        frame #6: 0x00000001096ec550 Mapbox GL`mbgl::Request::notify(this=0x00007faa58d5b590, response_=0x000000011b245a78) + 720 at request.cpp:55
        frame #7: 0x00000001096d3fe0 Mapbox GL`mbgl::DefaultFileSource::Impl::notify(this=0x000000011b24ea98, request=0x00007faa53dd9650, response=shared_ptr<const mbgl::Response> at 0x000000011b245a78, hint=No) + 896 at default_file_source.cpp:174
        frame #8: 0x00000001096d6d33 Mapbox GL`mbgl::DefaultFileSource::Impl::startCacheRequest(this=0x00007faa53f472e8, response=unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> > at 0x000000011b245ce0)::$_0::operator()(std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> >) const + 371 at default_file_source.cpp:124
        frame #9: 0x00000001096d6897 Mapbox GL`std::__1::__function::__func<mbgl::DefaultFileSource::Impl::startCacheRequest(mbgl::DefaultFileRequest*)::$_0, std::__1::allocator<mbgl::DefaultFileSource::Impl::startCacheRequest(mbgl::DefaultFileRequest*)::$_0>, void (std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> >)>::operator()(std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> >&&) [inlined] decltype(__f=0x00007faa53f472e8, __args=0x000000011b245f60)::$_0&>(fp)(std::__1::forward<std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> > >(fp0))) std::__1::__invoke<mbgl::DefaultFileSource::Impl::startCacheRequest(mbgl::DefaultFileRequest*)::$_0&, std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> > >(mbgl::DefaultFileSource::Impl::startCacheRequest(mbgl::DefaultFileRequest*)::$_0&&&, std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> >&&) + 302 at __functional_base:413
        frame #10: 0x00000001096d6769 Mapbox GL`std::__1::__function::__func<mbgl::DefaultFileSource::Impl::startCacheRequest(mbgl::DefaultFileRequest*)::$_0, std::__1::allocator<mbgl::DefaultFileSource::Impl::startCacheRequest(mbgl::DefaultFileRequest*)::$_0>, void (std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> >)>::operator(this=0x00007faa53f472e0, __arg=0x000000011b245f60)(std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> >&&) + 89 at functional:1370
        frame #11: 0x00000001098f6052 Mapbox GL`std::__1::function<void (std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> >)>::operator(this=0x00007faa53f472e0, __arg=unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> > at 0x000000011b245f60)(std::__1::unique_ptr<mbgl::Response, std::__1::default_delete<mbgl::Response> >) const + 162 at functional:1756
        frame #12: 0x0000000109909acf Mapbox GL`_ZZN4mbgl4util7RunLoop18invokeWithCallbackIZNS0_6ThreadINS_11SQLiteCache4ImplEE4bindIMS5_FvRKNS_8ResourceENSt3__18functionIFvNSB_10unique_ptrINS_8ResponseENSB_14default_deleteISE_EEEEEEEEEEDaT_EUlDpOT_E_RSJ_JSA_EEENSD_INS_11WorkRequestENSF_IST_EEEEOSN_OT0_DpOT1_ENKUlSQ_E_clIJSH_EEEDaSQ_(this=0x00007faa53f472d0, results=0x00007faa53f47310) + 367 at run_loop.hpp:49
        frame #13: 0x000000010990993b Mapbox GL`_ZN4mbgl4util7RunLoop7InvokerIKZNS1_18invokeWithCallbackIZNS0_6ThreadINS_11SQLiteCache4ImplEE4bindIMS6_FvRKNS_8ResourceENSt3__18functionIFvNSC_10unique_ptrINS_8ResponseENSC_14default_deleteISF_EEEEEEEEEEDaT_EUlDpOT_E_RSK_JSB_EEENSE_INS_11WorkRequestENSG_ISU_EEEEOSO_OT0_DpOT1_EUlSR_E_NSC_5tupleIJSI_EEEE6invokeIJLm0EEEEvNSC_16integer_sequenceImJXspT_EEEE(this=0x00007faa53f47270, (null)=std::__1::index_sequence<0UL> at 0x000000011b245fa8) + 75 at run_loop.hpp:110
        frame #14: 0x00000001099097b8 Mapbox GL`_ZN4mbgl4util7RunLoop7InvokerIKZNS1_18invokeWithCallbackIZNS0_6ThreadINS_11SQLiteCache4ImplEE4bindIMS6_FvRKNS_8ResourceENSt3__18functionIFvNSC_10unique_ptrINS_8ResponseENSC_14default_deleteISF_EEEEEEEEEEDaT_EUlDpOT_E_RSK_JSB_EEENSE_INS_11WorkRequestENSG_ISU_EEEEOSO_OT0_DpOT1_EUlSR_E_NSC_5tupleIJSI_EEEEclEv(this=0x00007faa53f47270) + 184 at run_loop.hpp:90
        frame #15: 0x0000000109841f7b Mapbox GL`mbgl::util::RunLoop::process(this=0x000000011b24eb00) + 683 at run_loop.cpp:27
        ...
  3. tmpsantos commented on Jul 14, 2015

    @tmpsantos
    Contributor

    I spent some time trying to reproduce this one today, but I didn't manage. I notice tough that very often I get the error below with raster tiles:

    [ERROR] {Map}[Style]: Failed to load [https://a.tiles.mapbox.com/v4/mapbox.mapbox-terrain-v2/9/489/275.vector.pbf?access_token=pk.XXXXXXXXXXXXXXXXXXXXX]: HTTP status code 404
    [ERROR] {Map}[Style]: Failed to load [https://a.tiles.mapbox.com/v4/mapbox.mapbox-terrain-v2/9/488/276.vector.pbf?access_token=pk.XXXXXXXXXXXXXXXXXXXXX]: HTTP status code 404
    [ERROR] {Map}[Style]: Failed to load [https://b.tiles.mapbox.com/v4/mapbox.mapbox-terrain-v2/9/488/275.vector.pbf?access_token=pk.XXXXXXXXXXXXXXXXXXXXX]: HTTP status code 404
    [ERROR] {Map}[Style]: Failed to load [https://b.tiles.mapbox.com/v4/mapbox.mapbox-terrain-v2/9/489/276.vector.pbf?access_token=pk.XXXXXXXXXXXXXXXXXXXXX]: HTTP status code 404
    
  4. picciano commented on Jul 30, 2015

    @picciano

    Probably related, saw this on iOS today, iPhone 6, iOS 8.4.

    Thread : Crashed: FileSource
    0  TallyGo                        0x00000001002d0f84 uv__async_send (async.c:168)
    1  TallyGo                        0x00000001002d0ec8 uv_async_send (async.c:58)
    2  TallyGo                        0x00000001002d0ec8 uv_async_send (async.c:58)
    3  TallyGo                        0x000000010024df64 mbgl::Request::notify(std::__1::shared_ptr<mbgl::Response const> const&) (uv_detail.hpp:116)
    4  TallyGo                        0x000000010024ac68 mbgl::DefaultFileSource::Impl::notify(mbgl::DefaultFileRequest*, std::__1::shared_ptr<mbgl::Response const>, mbgl::FileCache::Hint) (__tree:157)
    5  TallyGo                        0x000000010024adf0 std::__1::__function::__func<mbgl::DefaultFileSource::Impl::startRealRequest(mbgl::DefaultFileRequest*, std::__1::shared_ptr<mbgl::Response const>)::$_1, std::__1::allocator<mbgl::DefaultFileSource::Impl::startRealRequest(mbgl::DefaultFileRequest*, std::__1::shared_ptr<mbgl::Response const>)::$_1>, void (std::__1::shared_ptr<mbgl::Response const>, mbgl::FileCache::Hint)>::operator()(std::__1::shared_ptr<mbgl::Response const>&&, mbgl::FileCache::Hint&&) (memory:4447)
    6  TallyGo                        0x00000001002cff7c mbgl::HTTPRequest::handleResponse() (memory:4447)
    7  TallyGo                        0x00000001002d0e7c uv__async_event (async.c:80)
    8  TallyGo                        0x00000001002d1234 uv__async_io (async.c:156)
    9  TallyGo                        0x00000001002db38c uv__io_poll (kqueue.c:233)
    10 TallyGo                        0x00000001002d1814 uv_run (core.c:317)
    11 TallyGo                        0x000000010024c9e8 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>) (thread.hpp:128)
    12 TallyGo                        0x000000010024c8e4 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*) (thread.hpp:104)
    13 libsystem_pthread.dylib        0x0000000196dfbdc8 _pthread_body + 164
    14 libsystem_pthread.dylib        0x0000000196dfbd24 _pthread_body
    
  5. picciano commented on Aug 28, 2015

    @picciano

    We are still seeing variants of this crash.

    Thread : Crashed: NSOperationQueue 0x17dfbf60 :: NSOperation 0xea014c0 (QOS: LEGACY)
    0  libc++.1.dylib                 0x31b01872 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string() + 5
    1  TallyGo                        0x002fa2fd mbgl::HTTPNSURLRequest::handleResult(NSData*, NSURLResponse*, NSError*) (response.hpp:8)
    2  TallyGo                        0x002fa2fd mbgl::HTTPNSURLRequest::handleResult(NSData*, NSURLResponse*, NSError*) (response.hpp:8)
    3  CFNetwork                      0x238d650f __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 254
    4  Foundation                     0x24b99439 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 8
    5  Foundation                     0x24b040a1 -[NSBlockOperation main] + 148
    6  Foundation                     0x24af6b0d -[__NSOperationInternal _start:] + 768
    7  Foundation                     0x24b9bd93 __NSOQSchedule_f + 186
    8  libdispatch.dylib              0x3289c4d3 _dispatch_queue_drain$VARIANT$mp + 1462
    9  libdispatch.dylib              0x3289bda1 _dispatch_queue_invoke$VARIANT$mp + 84
    10 libdispatch.dylib              0x3289e491 _dispatch_root_queue_drain + 388
    11 libdispatch.dylib              0x3289f8a3 _dispatch_worker_thread3 + 106
    12 libsystem_pthread.dylib        0x32a13d9d _pthread_wqthread + 668
    13 libsystem_pthread.dylib        0x32a13af0 start_wqthread + 8
    
  6. picciano commented on Oct 5, 2015

    @picciano

    We've seen several more of these crashes lately.

    Thread : Crashed: NSOperationQueue 0x145bcdb0 :: NSOperation 0x1aca60c0 (QOS: LEGACY)
    0  libsystem_kernel.dylib         0x31543df0 __pthread_kill + 8
    1  libsystem_pthread.dylib        0x315c4c8b pthread_kill + 62
    2  libsystem_c.dylib              0x314e28c1 abort + 76
    3  libsystem_malloc.dylib         0x3156e3a7 free + 398
    4  TallyGo                        0x0038324f mbgl::HTTPNSURLRequest::handleResult(NSData*, NSURLResponse*, NSError*) (memory:2459)
    5  CFNetwork                      0x2248450f __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 254
    6  Foundation                     0x23747439 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 8
    7  Foundation                     0x236b20a1 -[NSBlockOperation main] + 148
    8  Foundation                     0x236a4b0d -[__NSOperationInternal _start:] + 768
    9  Foundation                     0x23749d93 __NSOQSchedule_f + 186
    10 libdispatch.dylib              0x3144a4d3 _dispatch_queue_drain$VARIANT$mp + 1462
    11 libdispatch.dylib              0x31449da1 _dispatch_queue_invoke$VARIANT$mp + 84
    12 libdispatch.dylib              0x3144c491 _dispatch_root_queue_drain + 388
    13 libdispatch.dylib              0x3144d8a3 _dispatch_worker_thread3 + 106
    14 libsystem_pthread.dylib        0x315c1d9d _pthread_wqthread + 668
    15 libsystem_pthread.dylib        0x315c1af0 start_wqthread + 8
    
  7. ljbade commented on Oct 6, 2015

    @ljbade
    Contributor

    @kkaefer possibly related to #2295 (which has still not been fixed - we just switched back to curl on Android which does not use uv_async.

  8. kkaefer commented on Oct 26, 2015

    @kkaefer
    MemberAuthor

    @picciano I just merged #2617 and can't reproduce this anymore. Can you please check out the current master build and see if that issue still exists?

  9. picciano commented on Oct 26, 2015

    @picciano

    I will. It was intermittent, so it may take a couple days.

    On Oct 26, 2015, at 10:22 AM, Konstantin Käfer [email protected] wrote:

    @picciano I just merged #2617 and can't reproduce this anymore. Can you please check out the current master build and see if that issue still exists?

    —
    Reply to this email directly or view it on GitHub.

  10. kkaefer commented on Oct 27, 2015

    @kkaefer
    MemberAuthor

    I'm attributing this crash to #2123. Please reopen if you continue to observe this issue after #2123 is merged.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions