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

Infinite loop in mbgl::resample at zoom > 21 #4416

Closed
jfirebaugh opened this issue Mar 21, 2016 · 2 comments · Fixed by #4508
Closed

Infinite loop in mbgl::resample at zoom > 21 #4416

jfirebaugh opened this issue Mar 21, 2016 · 2 comments · Fixed by #4508
Labels

Comments

@jfirebaugh
Copy link
Contributor

Set map maxZoom to 25. Zoom into SF until you get past z21. Result: app hangs with high CPU usage. Breaking in the debugger, main thread is blocked on renderSync, map thread is blocked on ~WorkRequest, and worker is stuck in the following code:

#1  0x000000010025b396 in std::__1::enable_if<((is_same<std::__1::allocator<mbgl::Anchor>, std::__1::allocator<mbgl::Anchor> >::value) || (!(__has_construct<std::__1::allocator<mbgl::Anchor>, mbgl::Anchor*, mbgl::Anchor>::value))) && (is_trivially_move_constructible<mbgl::Anchor>::value), void>::type std::__1::allocator_traits<std::__1::allocator<mbgl::Anchor> >::__construct_backward<mbgl::Anchor>(std::__1::allocator<mbgl::Anchor>&, mbgl::Anchor*, mbgl::Anchor*, mbgl::Anchor*&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1582
#2  0x000000010025b308 in std::__1::vector<mbgl::Anchor, std::__1::allocator<mbgl::Anchor> >::__swap_out_circular_buffer(std::__1::__split_buffer<mbgl::Anchor, std::__1::allocator<mbgl::Anchor>&>&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:897
#3  0x000000010025b18c in void std::__1::vector<mbgl::Anchor, std::__1::allocator<mbgl::Anchor> >::__push_back_slow_path<mbgl::Anchor const&>(mbgl::Anchor const&&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:1579
#4  0x000000010036f46e in std::__1::vector<mbgl::Anchor, std::__1::allocator<mbgl::Anchor> >::push_back(mbgl::Anchor const&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:1596
#5  0x000000010036f2c5 in mbgl::resample(std::__1::vector<mbgl::vec2<short>, std::__1::allocator<mbgl::vec2<short> > > const&, float, float, float, float, float, bool, bool) at /Users/john/Development/mapbox-gl-native/src/mbgl/text/get_anchors.cpp:48
#6  0x000000010036f5bb in mbgl::resample(std::__1::vector<mbgl::vec2<short>, std::__1::allocator<mbgl::vec2<short> > > const&, float, float, float, float, float, bool, bool) at /Users/john/Development/mapbox-gl-native/src/mbgl/text/get_anchors.cpp:62
#7  0x000000010036f9a9 in mbgl::getAnchors(std::__1::vector<mbgl::vec2<short>, std::__1::allocator<mbgl::vec2<short> > > const&, float, float, float, float, float, float, float, float, float) at /Users/john/Development/mapbox-gl-native/src/mbgl/text/get_anchors.cpp:103
#8  0x000000010023a1dd in mbgl::SymbolBucket::addFeature(std::__1::vector<std::__1::vector<mbgl::vec2<short>, std::__1::allocator<mbgl::vec2<short> > >, std::__1::allocator<std::__1::vector<mbgl::vec2<short>, std::__1::allocator<mbgl::vec2<short> > > > > const&, mbgl::Shaping const&, mbgl::PositionedIcon const&, std::__1::map<unsigned int, mbgl::Glyph, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, mbgl::Glyph> > > const&) at /Users/john/Development/mapbox-gl-native/src/mbgl/renderer/symbol_bucket.cpp:312
#9  0x0000000100239894 in mbgl::SymbolBucket::addFeatures(unsigned long, mbgl::SpriteAtlas&, mbgl::GlyphAtlas&, mbgl::GlyphStore&) at /Users/john/Development/mapbox-gl-native/src/mbgl/renderer/symbol_bucket.cpp:269
#10 0x0000000100163125 in mbgl::SymbolLayer::createBucket(mbgl::StyleBucketParameters&) const at /Users/john/Development/mapbox-gl-native/src/mbgl/layer/symbol_layer.cpp:177
#11 0x00000001003baece in mbgl::TileWorker::parseLayer(mbgl::StyleLayer const*, mbgl::GeometryTile const&) at /Users/john/Development/mapbox-gl-native/src/mbgl/tile/tile_worker.cpp:162
#12 0x00000001003ba27b in mbgl::TileWorker::parseAllLayers(std::__1::vector<std::__1::unique_ptr<mbgl::StyleLayer, std::__1::default_delete<mbgl::StyleLayer> >, std::__1::allocator<std::__1::unique_ptr<mbgl::StyleLayer, std::__1::default_delete<mbgl::StyleLayer> > > >, std::__1::unique_ptr<mbgl::GeometryTile const, std::__1::default_delete<mbgl::GeometryTile const> >, mbgl::PlacementConfig) at /Users/john/Development/mapbox-gl-native/src/mbgl/tile/tile_worker.cpp:58
#13 0x0000000100446c17 in mbgl::Worker::Impl::parseGeometryTile(mbgl::TileWorker*, std::__1::vector<std::__1::unique_ptr<mbgl::StyleLayer, std::__1::default_delete<mbgl::StyleLayer> >, std::__1::allocator<std::__1::unique_ptr<mbgl::StyleLayer, std::__1::default_delete<mbgl::StyleLayer> > > >, std::__1::unique_ptr<mbgl::GeometryTile, std::__1::default_delete<mbgl::GeometryTile> >, mbgl::PlacementConfig, std::__1::function<void (mapbox::util::variant<mbgl::TileParseResultBuckets, std::exception_ptr>)>) at /Users/john/Development/mapbox-gl-native/src/mbgl/util/worker.cpp:37
#14 0x0000000100455082 in _ZZN4mbgl4util6ThreadINS_6Worker4ImplEE4bindIMS3_FvPNS_10TileWorkerENSt3__16vectorINS8_10unique_ptrINS_10StyleLayerENS8_14default_deleteISB_EEEENS8_9allocatorISE_EEEENSA_INS_12GeometryTileENSC_ISI_EEEENS_15PlacementConfigENS8_8functionIFvN6mapbox4util7variantIJNS_22TileParseResultBucketsESt13exception_ptrEEEEEEEEEDaT_ENKUlDpOT_E_clIJS7_SH_SK_SL_ZNS0_7RunLoop18invokeWithCallbackIS12_RSU_JS7_SH_SK_RSL_EEENSA_INS_11WorkRequestENSC_IS18_EEEEOSY_OT0_DpOT1_EUlS11_E_EEEDaS11_ at /Users/john/Development/mapbox-gl-native/gyp/../src/mbgl/util/thread.hpp:72
#15 0x0000000100454bdd in _ZN4mbgl4util7RunLoop7InvokerIZNS0_6ThreadINS_6Worker4ImplEE4bindIMS5_FvPNS_10TileWorkerENSt3__16vectorINSA_10unique_ptrINS_10StyleLayerENSA_14default_deleteISD_EEEENSA_9allocatorISG_EEEENSC_INS_12GeometryTileENSE_ISK_EEEENS_15PlacementConfigENSA_8functionIFvN6mapbox4util7variantIJNS_22TileParseResultBucketsESt13exception_ptrEEEEEEEEEDaT_EUlDpOT_E_NSA_5tupleIJS9_SJ_SM_SN_ZNS1_18invokeWithCallbackIS14_RSW_JS9_SJ_SM_RSN_EEENSC_INS_11WorkRequestENSE_IS19_EEEEOS10_OT0_DpOT1_EUlS13_E_EEEE6invokeIJLm0ELm1ELm2ELm3ELm4EEEEvNSA_16integer_sequenceImJXspT_EEEE at /Users/john/Development/mapbox-gl-native/gyp/../include/mbgl/util/run_loop.hpp:146
#16 0x0000000100454193 in _ZN4mbgl4util7RunLoop7InvokerIZNS0_6ThreadINS_6Worker4ImplEE4bindIMS5_FvPNS_10TileWorkerENSt3__16vectorINSA_10unique_ptrINS_10StyleLayerENSA_14default_deleteISD_EEEENSA_9allocatorISG_EEEENSC_INS_12GeometryTileENSE_ISK_EEEENS_15PlacementConfigENSA_8functionIFvN6mapbox4util7variantIJNS_22TileParseResultBucketsESt13exception_ptrEEEEEEEEEDaT_EUlDpOT_E_NSA_5tupleIJS9_SJ_SM_SN_ZNS1_18invokeWithCallbackIS14_RSW_JS9_SJ_SM_RSN_EEENSC_INS_11WorkRequestENSE_IS19_EEEEOS10_OT0_DpOT1_EUlS13_E_EEEEclEv at /Users/john/Development/mapbox-gl-native/gyp/../include/mbgl/util/run_loop.hpp:126
#17 0x000000010047a56b in mbgl::util::RunLoop::process() at /Users/john/Development/mapbox-gl-native/gyp/../include/mbgl/util/run_loop.hpp:170
#18 0x0000000100480226 in decltype(*(std::__1::forward<mbgl::util::RunLoop*&>(fp0)).*fp(std::__1::forward<>(fp1))) std::__1::__invoke<void (mbgl::util::RunLoop::*&)(), mbgl::util::RunLoop*&, void>(void (mbgl::util::RunLoop::*&&&)(), mbgl::util::RunLoop*&&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:382
#19 0x00000001004801a0 in std::__1::__bind_return<void (mbgl::util::RunLoop::*)(), std::__1::tuple<mbgl::util::RunLoop*>, std::__1::tuple<>, _is_valid_bind_return<void (mbgl::util::RunLoop::*)(), std::__1::tuple<mbgl::util::RunLoop*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (mbgl::util::RunLoop::*)(), std::__1::tuple<mbgl::util::RunLoop*>, 0ul, std::__1::tuple<> >(void (mbgl::util::RunLoop::*&)(), std::__1::tuple<mbgl::util::RunLoop*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:2060
#20 0x0000000100480178 in std::__1::__bind_return<void (mbgl::util::RunLoop::*)(), std::__1::tuple<mbgl::util::RunLoop*>, std::__1::tuple<>, _is_valid_bind_return<void (mbgl::util::RunLoop::*)(), std::__1::tuple<mbgl::util::RunLoop*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>::operator()<>() [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:2123
#21 0x0000000100480159 in decltype(std::__1::forward<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&>(std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:415
#22 0x000000010048014e in void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&>(std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:440
#23 0x000000010047ffc9 in std::__1::__function::__func<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>, std::__1::allocator<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*> >, void ()>::operator()() at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1407
#24 0x000000010047deff in std::__1::function<void ()>::operator()() const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1793
#25 0x0000000100472f5f in mbgl::util::AsyncTask::Impl::asyncCallback(uv_async_s*) at /Users/john/Development/mapbox-gl-native/platform/default/async_task.cpp:49
#26 0x00000001005a0fae in uv__async_event at /Users/travis/build/mapbox/mason/mason_packages/.build/libuv-1.7.5/src/unix/async.c:92
#27 0x00000001005a11e6 in uv__async_io at /Users/travis/build/mapbox/mason/mason_packages/.build/libuv-1.7.5/src/unix/async.c:137
#28 0x00000001005af1e2 in uv__io_poll at /Users/travis/build/mapbox/mason/mason_packages/.build/libuv-1.7.5/src/unix/kqueue.c:247
#29 0x00000001005a16b8 in uv_run at /Users/travis/build/mapbox/mason/mason_packages/.build/libuv-1.7.5/src/unix/core.c:341
#30 0x0000000100474cd5 in mbgl::util::RunLoop::run() at /Users/john/Development/mapbox-gl-native/platform/default/run_loop.cpp:155
#31 0x0000000100448b4a in void mbgl::util::Thread<mbgl::Worker::Impl>::run<std::__1::tuple<> >(mbgl::util::ThreadContext, std::__1::tuple<>&&, std::__1::integer_sequence<unsigned long>) at /Users/john/Development/mapbox-gl-native/gyp/../src/mbgl/util/thread.hpp:124
#32 0x0000000100448a4f in mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()::operator()() const at /Users/john/Development/mapbox-gl-native/gyp/../src/mbgl/util/thread.hpp:106
#33 0x0000000100448652 in std::__1::__invoke<mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()>(decltype(std::__1::forward<mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()>(fp)(std::__1::forward<>(fp0))), mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:415
#34 0x0000000100448646 in _ZNSt3__116__thread_executeIZN4mbgl4util6ThreadINS1_6Worker4ImplEEC1IJEEERKNS2_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:337
#35 0x0000000100448636 in std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()> >(void*, void*) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:347
@jfirebaugh jfirebaugh added this to the ios-v3.2.0 milestone Mar 21, 2016
@jfirebaugh jfirebaugh added the bug label Mar 21, 2016
@jfirebaugh
Copy link
Contributor Author

cc @ansis

@jfirebaugh
Copy link
Contributor Author

Removing from 3.2.0 milestone; we're going to work around this issue by limiting the maximum maximum zoom level to 21.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant