You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Sometimes when closing and reopening the app it crashes #608
#0 0x4012c048 in tgkill () from /home/leith/mb/android-nexus/system_lib/libc.so
#1 0x4011d09c in pthread_kill () from /home/leith/mb/android-nexus/system_lib/libc.so
#2 0x4011d2b0 in raise () from /home/leith/mb/android-nexus/system_lib/libc.so
#3 0x4011bfe6 in ?? () from /home/leith/mb/android-nexus/system_lib/libc.so
#4 0x4012b900 in abort () from /home/leith/mb/android-nexus/system_lib/libc.so
#5 0x6a472ba8 in abort_message (format=<optimized out>)
at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/abort_message.cpp:47
#6 0x6a472cc0 in default_terminate_handler ()
at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_default_handlers.cpp:63
#7 0x6a4625d0 in std::__terminate (func=0x0)
at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_handlers.cpp:68
#8 0x6a4618f0 in failed_throw (exception_header=<optimized out>)
at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_exception.cpp:149
#9 __cxa_throw (thrown_object=0x6b977cc8, tinfo=<optimized out>, dest=<optimized out>)
at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_exception.cpp:244
#10 0x6a11b310 in mbgl::Style::loadJSON (this=0x6b1a0c44,
data=0x6b903008 "{\n \"version\": 6,\n \"constants\": {\n \"@name\": \"{name_en}\",\n \"@sans\": \"Open Sans Regular, Arial Unicode MS Regular\",\n \"@sans_it\": \"Open Sans Italic, Arial Unicode MS Regular\",\n \"@sans_md\": \""...)
at ../../src/style/style.cpp:105
#11 0x6a1c7888 in mbgl::Map::setStyleJSON (this=0x6b07d4e0, newStyleJSON=..., base=...) at ../../src/map/map.cpp:432
#12 0x6a1cba34 in operator() (this=0x6b36f42c, res=...) at ../../src/map/map.cpp:757
#13 0x6a1cb51c in __invoke<<lambda at ../../src/map/map.cpp:748:67> &, const mbgl::Response &> (this=0x6b36f42c, __f=..., __args=...)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/__functional_base:413
#14 std::__1::__function::__func<mbgl::Map::prepare()::$_6, std::__1::allocator<mbgl::Map::prepare()::$_6>, void (mbgl::Response const&)>::operator()(mbgl::Response const&) (this=0x6b36f428, __arg=...)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/functional:1370
#15 0x6a09319c in std::__1::function<void (mbgl::Response const&)>::operator()(mbgl::Response const&) const (this=0x6b36f428,
__arg=...)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/functional:1756
#16 0x6a092cdc in mbgl::invoke<std::__1::function<void (mbgl::Response const&)>, mbgl::Response&>(std::__1::forward_list<std::__1::unique_ptr<mapbox::util::variant<std::__1::function<void (mbgl::Response const&)>, std::__1::function<void ()> >, std::__1::default_delete<mapbox::util::variant<std::__1::function<void (mbgl::Response const&)>, std::__1::function<void ()> > > >, std::__1::allocator<std::__1::unique_ptr<mapbox::util::variant<std::__1::function<void (mbgl::Response const&)>, std::__1::function<void ()> >, std::__1::default_delete<mapbox::util::variant<std::__1::function<void (mbgl::Response const&)>, std::__1::function<void ()> > > > > > const&, mbgl::Response&) (list=..., args=...) at ../../src/storage/base_request.cpp:16
#17 0x6a091ce4 in mbgl::BaseRequest::notify (this=0x6b9513b4) at ../../src/storage/base_request.cpp:48
#18 0x6a080728 in mbgl::AssetRequestBaton::run (async=0x6b84fa20) at ../../platform/android/asset_request_baton.cpp:112
#19 0x6a3e77f8 in uv__async_event () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#20 0x6a3e7dd0 in uv__async_io () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#21 0x6a3fce74 in uv__io_poll () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#22 0x6a3e8548 in uv_run () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#23 0x6a1c607c in mbgl::Map::run (this=0x6b07d4e0) at ../../src/map/map.cpp:276
#24 0x6a1ccb04 in operator() (this=0x6b07d4e0, arg=0x6b07d4e0) at ../../src/map/map.cpp:189
#25 0x6a1cca84 in __invoke (arg=0x6b07d4e0) at ../../src/map/map.cpp:181
#26 0x6a3e69a8 in uv__thread_start () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#27 0x4011722c in __thread_entry () from /home/leith/mb/android-nexus/system_lib/libc.so
#28 0x401173c4 in pthread_create () from /home/leith/mb/android-nexus/system_lib/libc.so
#29 0x00000000 in ?? ()
#0 0x4012c048 in tgkill () from /home/leith/mb/android-nexus/system_lib/libc.so
#1 0x4011d09c in pthread_kill () from /home/leith/mb/android-nexus/system_lib/libc.so
#2 0x4011d2b0 in raise () from /home/leith/mb/android-nexus/system_lib/libc.so
#3 0x4011bfe6 in ?? () from /home/leith/mb/android-nexus/system_lib/libc.so
#4 0x4012b900 in abort () from /home/leith/mb/android-nexus/system_lib/libc.so
#5 0x4011cacc in ?? () from /home/leith/mb/android-nexus/system_lib/libc.so
#6 0x4011c044 in __assert2 () from /home/leith/mb/android-nexus/system_lib/libc.so
#7 0x6a0a1d68 in mbgl::FileSource::~FileSource (this=0x6b8e28dc) at ../../src/storage/file_source.cpp:29
#8 0x6a1d5620 in std::__1::__shared_ptr_emplace<mbgl::FileSource, std::__1::allocator<mbgl::FileSource> >::__on_zero_shared (
this=0x6b8e28d0)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/memory:3738
#9 0x6a453c78 in __release_shared (this=0x6b8e28d0)
at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/memory.cpp:61
#10 std::__1::__shared_weak_count::__release_shared (this=0x6b8e28d0)
at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/memory.cpp:86
#11 0x6a1afac4 in std::__1::shared_ptr<mbgl::FileSource>::~shared_ptr (this=0x6b934ef8)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/memory:4448
#12 0x6a1aec18 in mbgl::util::ptr<mbgl::FileSource>::~ptr (this=0x6b934ef8) at ../../include/mbgl/util/ptr.hpp:11
#13 0x6a1d3158 in mbgl::GlyphStore::~GlyphStore (this=0x6b934eec) at ../../include/mbgl/text/glyph_store.hpp:72
#14 0x6a1d2ffc in std::__1::__shared_ptr_emplace<mbgl::GlyphStore, std::__1::allocator<mbgl::GlyphStore> >::__on_zero_shared (
this=0x6b934ee0)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/memory:3738
#15 0x6a453c78 in __release_shared (this=0x6b934ee0)
at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/memory.cpp:61
#16 std::__1::__shared_weak_count::__release_shared (this=0x6b934ee0)
at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/libcxx/src/memory.cpp:86
#17 0x6a1b2984 in std::__1::shared_ptr<mbgl::GlyphStore>::~shared_ptr (this=0x6d14ecac)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/memory:4448
#18 0x6a1b19b0 in mbgl::util::ptr<mbgl::GlyphStore>::~ptr (this=0x6d14ecac) at ../../include/mbgl/util/ptr.hpp:11
#19 0x6a1b3ab0 in mbgl::TileParser::~TileParser (this=0x6d14ec90) at ../../src/map/tile_parser.cpp:30
#20 0x6a1b054c in mbgl::VectorTileData::parse (this=0x6b13f4dc) at ../../src/map/vector_tile_data.cpp:33
#21 0x6a1ae754 in operator() (this=0x6a1ae68c <__invoke(mbgl::util::ptr<mbgl::TileData>&)>, tile=...)
at ../../src/map/tile_data.cpp:92
#22 0x6a1ae6d0 in __invoke (tile=...) at ../../src/map/tile_data.cpp:91
#23 0x6a1aef54 in uv::work<mbgl::util::ptr<mbgl::TileData> >::do_work (data=0x6b1bdee8) at ../../include/mbgl/util/uv_detail.hpp:179
#24 0x6a27ad2c in uv__worker_thread_loop () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#25 0x6a3e6da8 in uv__thread_start () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#26 0x4011722c in __thread_entry () from /home/leith/mb/android-nexus/system_lib/libc.so
#27 0x401173c4 in pthread_create () from /home/leith/mb/android-nexus/system_lib/libc.so
#28 0x00000000 in ?? ()
FileSource::~FileSource() {
assert(thread_id == uv_thread_self());
uv_messenger_stop(queue, [](uv_messenger_t *msgr) {
delete msgr;
});
util::ptr<BaseRequest> req;
// Send a cancel() message to all requests that we are still holding.
for (const std::pair<std::string, std::weak_ptr<BaseRequest>> &pair : pending) {
if ((req = pair.second.lock())) {
req->cancel();
}
}
}
Actually looks like the clue is this: #20 0x6a1b054c in mbgl::VectorTileData::parse (this=0x6b13f4dc) at ../../src/map/vector_tile_data.cpp:33
Which is the catch line in:
void VectorTileData::parse() {
if (state != State::loaded) {
return;
}
try {
// Parsing creates state that is encapsulated in TileParser. While parsing,
// the TileParser object writes results into this objects. All other state
// is going to be discarded afterwards.
TileParser parser(data, *this, map.getStyle(), map.getGlyphAtlas(),
map.getGlyphStore(), map.getSpriteAtlas(), map.getSprite());
parser.parse();
} catch (const std::exception& ex) {
#if defined(DEBUG)
fprintf(stderr, "[%p] exception [%d/%d/%d]... failed: %s\n", this, id.z, id.x, id.y, ex.what());
#endif
cancel();
return;
}
So it appears parse() throws an exception and this causes objects to be deleted on the wrong thread?
@xor22h What happens if you put some Log::Debug() calls with binaryFormat at glGetProgramBinary and glProgramBinary to find where it is saving the bad binaryFormat value.
I/OpenGLRenderer( 1960): Initialized EGL, version 1.4
D/OpenGLRenderer( 1960): Enabling debug mode 0
V/MapView ( 1960): surfaceCreated
I/OpenGL ( 1960): GL Vendor: Qualcomm
I/OpenGL ( 1960): GL Renderer: Adreno (TM) 330
I/OpenGL ( 1960): GL Version: OpenGL ES 3.0 [email protected] AU@ (GIT@I68fa98814b)
I/OpenGL ( 1960): GL SL Version: OpenGL ES GLSL ES 3.00
I/OpenGL ( 1960): GL Extensions: GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_robustness GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_sync GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil
I/OpenGL ( 1960): GL Extensions: GL_OES_depth_texture_cube_map GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_OES_vertex_array_object GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_t
I/OpenGL ( 1960): GL Extensions: exture_sRGB_decode GL_EXT_texture_filter_anisotropic GL_EXT_multisampled_render_to_texture GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_disjoint_timer_query
I/OpenGL ( 1960): Using GL_OES_vertex_array_object.
I/OpenGL ( 1960): Using GL_OES_packed_depth_stencil.
I/OpenGL ( 1960): Using GL_OES_depth24.
I/OpenGL ( 1960): Using GL_OES_get_program_binary.
I/OpenGL ( 1960): Using GL_EXT_debug_marker.
I/OpenGL ( 1960): Using GL_EXT_debug_label.
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
V/MapView ( 1960): surfaceChanged
I/MapView ( 1960): resize 4 1080 1597
V/MapView ( 1960): surfaceRedrawNeeded
V/MapView ( 1960): surfaceRedrawNeeded
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
I/ActivityManager( 772): Displayed com.mapbox.mapboxgl.app/.MainActivity: +513ms
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with a zero length binary!
E/OpenGL ( 1960): Trying load program binary with an invalid binaryFormat!
E/OpenGL ( 1960): Trying load program binary with a zero length binary!
I/Sprite ( 1960): loaded https://www.mapbox.com/mapbox-gl-styles/sprites/[email protected]
also, please note that TAG 'android-v0.1.2' breaks make scripts. it tries to explode "." and fails to convert 'android-v0' to integer. creating a new tag '0.1.2' solves the problem;
Activity
ljbade commentedon Nov 18, 2014
Found another crash:
ljbade commentedon Nov 18, 2014
OK for first crash got back trace:
ljbade commentedon Nov 18, 2014
Looks like in:
It is throwing because of parse error.
ljbade commentedon Nov 18, 2014
The JSON ends with:
Comparing to the file bright-v6.json, it looks like there is some junk
\020\021Yat the end of the string, perhaps null termination is in wrong place.ljbade commentedon Nov 18, 2014
This only started happening after I added asset style loading, so I am perhaps returning some junk from AssetRequestBaton.
ljbade commentedon Nov 18, 2014
I think it was because I was not telling std::string how long my data is.
ljbade commentedon Nov 18, 2014
Fixed the first crash in
e52cf05
Still got the second crash.
ljbade commentedon Nov 18, 2014
Okay backtrace for second crash:
ljbade commentedon Nov 18, 2014
Hmm it appears to be the assert in:
ljbade commentedon Nov 18, 2014
@kkaefer
I am guessing this crash is because a HTTP request finishes loading after I have called Map::stop?So thread_id is no longer valid and does not match the thread that deltes FileSource?Should we even have an assert here?
ljbade commentedon Nov 18, 2014
Actually looks like the clue is this:
#20 0x6a1b054c in mbgl::VectorTileData::parse (this=0x6b13f4dc) at ../../src/map/vector_tile_data.cpp:33Which is the catch line in:
So it appears parse() throws an exception and this causes objects to be deleted on the wrong thread?
ljbade commentedon Nov 18, 2014
OK we will need to implement #613 so I can actually see why tile parsing is failing here.
Quick fix for #608
9 remaining items
ljbade commentedon Jan 1, 2015
@incanus Am I right in recalling you have a Nexus 5? Have you seen this error?
xor22h commentedon Jan 2, 2015
It happens everylaunch. I was unnable to run app at all. Clearing cache, data, removing entire app and reinstalling didn't helped.
Note: i'm using dpi mod. Build.prop density=400. But it crashes with default (480) also.
Atlas is comming from here i think: https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ThreadedRenderer.java
I see this with other apps too.
If i can help somehow - please ask.
ljbade commentedon Jan 2, 2015
@xor22h Can you try disabling these lines as a work around: https://github.com/mapbox/mapbox-gl-native/blob/android-mason/android/cpp/native_map_view.cpp#L626-L638
That will stop the app trying to load the GL program binary extension which should stop the crash.
xor22h commentedon Jan 2, 2015
Yes, commenting out these lines fixes crash.
ljbade commentedon Jan 2, 2015
@xor22h What happens if you put some Log::Debug() calls with binaryFormat at glGetProgramBinary and glProgramBinary to find where it is saving the bad binaryFormat value.
xor22h commentedon Jan 2, 2015
@ljbade, Not sure if i correctly understood what you have asked. I tried:
ljbade commentedon Jan 2, 2015
@xor22h I meant just before https://github.com/mapbox/mapbox-gl-native/blob/android-mason/src/mbgl/shader/shader.cpp#L40 and https://github.com/mapbox/mapbox-gl-native/blob/android-mason/src/mbgl/shader/shader.cpp#L183 to see what the value of binaryFormat is.
ljbade commentedon Jan 4, 2015
@xor22h I was able to recreate the bug. It appears that somehow garbage was being read for binaryFormat.
I added some validation in 8eceb08 to ignore the garbage.
Can you please test this version?
xor22h commentedon Jan 5, 2015
Yes, it has fixed an issue. App launches.
also, please note that TAG 'android-v0.1.2' breaks make scripts. it tries to explode "." and fails to convert 'android-v0' to integer. creating a new tag '0.1.2' solves the problem;
ljbade commentedon Jan 5, 2015
@xor22h Which line in the make file is that? I will see if I can escape it properly.
xor22h commentedon Jan 5, 2015
It's on build script:
https://github.com/mapbox/mapbox-gl-native/blob/android-mason/scripts/build-version.py#L16
incanus commentedon Jan 5, 2015
FYI no, I have Nexuses 4, 7, and 9 :-)
ljbade commentedon Jan 9, 2015
I am closing this, but will take another look at the underlying issue in #740