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.
@mikemorris I am seeing this crash at startup in the Android app:
#0 0x40163048 in tgkill () from /home/leith/mb/android-nexus/system_lib/libc.so
#1 0x4015409c in pthread_kill () from /home/leith/mb/android-nexus/system_lib/libc.so
#2 0x401542b0 in raise () from /home/leith/mb/android-nexus/system_lib/libc.so
#3 0x40152fe6 in ?? () from /home/leith/mb/android-nexus/system_lib/libc.so
#4 0x40162900 in abort () from /home/leith/mb/android-nexus/system_lib/libc.so
#5 0x6ba0aba4 in uv_mutex_lock () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#6 0x6b85f1a4 in uv_messenger_send () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#7 0x6b670210 in mbgl::CachingHTTPFileSource::prepare(std::__1::function<void ()>) (this=0x66f8a028, fn=...)
at ../../platform/default/caching_http_file_source.cpp:103
#8 0x6b7a6f40 in mbgl::Map::setReachability (this=0x66f8a070, reachable=true) at ../../src/map/map.cpp:373
#9 0x6b64266c in (anonymous namespace)::nativeSetReachability (env=0x40135008, obj=0x19000019, nativeMapViewPtr=1727569936,
status=1 '\001') at ../../android/cpp/jni.cpp:702
#10 0x417f6bd0 in dvmPlatformInvoke () from /home/leith/mb/android-nexus/system_lib/libdvm.so
#11 0x41827126 in dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*) ()
from /home/leith/mb/android-nexus/system_lib/libdvm.so
#12 0x41800028 in dvmJitToInterpNoChain () from /home/leith/mb/android-nexus/system_lib/libdvm.so
#13 0x41800028 in dvmJitToInterpNoChain () from /home/leith/mb/android-nexus/system_lib/libdvm.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
#0 0x40163048 in tgkill () from /home/leith/mb/android-nexus/system_lib/libc.so
#1 0x4015409c in pthread_kill () from /home/leith/mb/android-nexus/system_lib/libc.so
#2 0x401542b0 in raise () from /home/leith/mb/android-nexus/system_lib/libc.so
#3 0x40152fe6 in ?? () from /home/leith/mb/android-nexus/system_lib/libc.so
#4 0x40162900 in abort () from /home/leith/mb/android-nexus/system_lib/libc.so
#5 0x40153acc in ?? () from /home/leith/mb/android-nexus/system_lib/libc.so
#6 0x40153044 in __assert2 () from /home/leith/mb/android-nexus/system_lib/libc.so
#7 0x6b446de4 in mbgl::CachingHTTPFileSource::request (this=0x66f8718c, type=mbgl::JSON, url_=...)
at ../../src/mbgl/storage/caching_http_file_source.cpp:72
#8 0x6b534c8c in mbgl::Map::prepare (this=0x66f871e0) at ../../src/mbgl/map/map.cpp:702
#9 0x6b53460c in mbgl::Map::run (this=0x66f871e0) at ../../src/mbgl/map/map.cpp:291
#10 0x6b53b544 in operator() (this=0x6876daf8) at ../../src/mbgl/map/map.cpp:206
#11 0x6b53b30c in std::__1::__thread_proxy<std::__1::tuple<mbgl::Map::start(bool)::$_6> >(void*) (__vp=0x6876daf8)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/memory:2607
#12 0x4014e22c in __thread_entry () from /home/leith/mb/android-nexus/system_lib/libc.so
#13 0x4014e3c4 in pthread_create () from /home/leith/mb/android-nexus/system_lib/libc.so
#14 0x00000000 in ?? ()
``
#0 0x401a2048 in tgkill () from /home/leith/mb/android-nexus/system_lib/libc.so
#1 0x4019309c in pthread_kill () from /home/leith/mb/android-nexus/system_lib/libc.so
#2 0x401932b0 in raise () from /home/leith/mb/android-nexus/system_lib/libc.so
#3 0x40191fe6 in ?? () from /home/leith/mb/android-nexus/system_lib/libc.so
#4 0x401a1900 in abort () from /home/leith/mb/android-nexus/system_lib/libc.so
#5 0x40192acc in ?? () from /home/leith/mb/android-nexus/system_lib/libc.so
#6 0x40192044 in __assert2 () from /home/leith/mb/android-nexus/system_lib/libc.so
#7 0x6b466010 in uv_messenger_stop () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#8 0x6b2b7594 in mbgl::CachingHTTPFileSource::clearLoop (this=0x66f24224) at ../../src/mbgl/storage/caching_http_file_source.cpp:41
#9 0x6b3af730 in operator() (this=0x66fcfe24) at ../../src/mbgl/map/map.cpp:158
#10 0x6b3af31c in __invoke<<lambda at ../../src/mbgl/map/map.cpp:150:59> &> (this=0x66fcfe24, __f=...)
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
#11 std::__1::__function::__func<mbgl::Map::start(bool)::$_3, std::__1::allocator<mbgl::Map::start(bool)::$_3>, void ()>::operator()() (this=0x66fcfe20)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/functional:1370
#12 0x6b2a652c in std::__1::function<void ()>::operator()() const (this=0x66fcfe20)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/functional:1756
#13 0x6b2a6444 in uv::async::async_cb (a=0x6877e798) at ../../src/mbgl/util/uv_detail.hpp:81
#14 0x6b600930 in uv__async_event () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#15 0x6b600f08 in uv__async_io () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#16 0x6b615fac in uv__io_poll () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#17 0x6b601680 in uv_run () from /home/leith/mb/mbgl-android/build/android/out/Debug/lib.target/libmapbox-gl.so
#18 0x6b3a58c0 in mbgl::Map::run (this=0x66f24278) at ../../src/mbgl/map/map.cpp:296
#19 0x6b3ac798 in operator() (this=0x66fcfd80) at ../../src/mbgl/map/map.cpp:206
#20 0x6b3ac560 in std::__1::__thread_proxy<std::__1::tuple<mbgl::Map::start(bool)::$_6> >(void*) (__vp=0x66fcfd80)
at /home/leith/mb/mbgl-android/mason_packages/.android-platform//bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../include/c++/4.9/memory:2607
#21 0x4018d22c in __thread_entry () from /home/leith/mb/android-nexus/system_lib/libc.so
#22 0x4018d3c4 in pthread_create () from /home/leith/mb/android-nexus/system_lib/libc.so
#23 0x00000000 in ?? ()
It is possible that stop gets called more than once, the Android lifecycle is very messed up with GL, need to check my debug print spew to see if it is
This usage looks quite similar to how I'm creating the Map and FileSource objects in Node.js bindings, which required disabling a handful of asserts to get everything running. Longer-term fix for this probably involves revisiting the threading model in Map objects.
@mikemorris I believe that particular assert is correct, and failing it indicates a problem. There's what I'm calling the "main thread" and there's the thread that the event loop runs on. setLoop and clearLoop should only be called from the latter.
@jfirebaugh Oh, I'm getting a bit mixed up with all these threads, main != map.
FileSource loop is only set in Map::prepare, and cleared in asyncTerminate. If the assert in asyncTerminate passes, then I would expect the assert in clearLoop to pass as well?
EDIT: Is threadId set properly in setLoop? It's set to the id of the current thread, not the id of the loop thread?
Activity
mikemorris commentedon Dec 4, 2014
Possibly caused by/related to #686 (comment)?
ljbade commentedon Dec 4, 2014
Possibly, but I am not app switcing, just opening the app for the first time.
jfirebaugh commentedon Dec 4, 2014
Does it call
Map::setReachabilitybeforeMap::startorMap::setStyleJSON?jfirebaugh commentedon Dec 4, 2014
@ljbade Merge 16fe8e6 and see if that resolves this.
ljbade commentedon Dec 5, 2014
Yeah I think that could happen, let me check.
ljbade commentedon Dec 5, 2014
@jfirebaugh now I get:
ljbade commentedon Dec 8, 2014
Now am I getting different crashes:
So much has been changed I don't really know what is going on here.
ljbade commentedon Dec 8, 2014
Another crash, this time when the app is closing:
ljbade commentedon Dec 8, 2014
Also for some reason map tiles other than from the initial view do not get loaded. You can zoom in and pan but it only shows the initial tiles.
ljbade commentedon Dec 8, 2014
Saw a message about heap corruption:
ljbade commentedon Dec 8, 2014
@jfirebaugh @mikemorris seems things have really gone downhill from when I had it pretty much stable last week
jfirebaugh commentedon Dec 8, 2014
The
uv_messenger_stopassertion failure suggestsMap::stopmay be getting called multiple times.Where's the code that creates
CachingHTTPFileSourcefor android?ljbade commentedon Dec 8, 2014
@jfirebaugh https://github.com/mapbox/mapbox-gl-native/blob/android-mason/android/cpp/native_map_view.cpp
It is possible that stop gets called more than once, the Android lifecycle is very messed up with GL, need to check my debug print spew to see if it is
mikemorris commentedon Dec 8, 2014
@jfirebaugh
CachingHTTPFileSourceis created at https://github.com/mapbox/mapbox-gl-native/blob/android-mason/android/cpp/native_map_view.cpp#L50This usage looks quite similar to how I'm creating the
MapandFileSourceobjects in Node.js bindings, which required disabling a handful of asserts to get everything running. Longer-term fix for this probably involves revisiting the threading model inMapobjects.ljbade commentedon Dec 9, 2014
@mikemorris I tried your branch with the disabled asserts but I still get the clearLoop assert and still does not load tiles properly.
mikemorris commentedon Dec 9, 2014
@ljbade I would expect the assert in
clearLoopto fail. It should probably be removed, as that function can be called from the main loop inMap. @jfirebaugh removed the assert fromsetBasefor the same reason 0c9ae49.Ultimately,
clearLoopis still a hack, and we'll need to rework the threading model 36500b9jfirebaugh commentedon Dec 9, 2014
@mikemorris I believe that particular assert is correct, and failing it indicates a problem. There's what I'm calling the "main thread" and there's the thread that the event loop runs on.
setLoopandclearLoopshould only be called from the latter.mikemorris commentedon Dec 9, 2014
@jfirebaugh Oh, I'm getting a bit mixed up with all these threads,
main!=map.FileSourceloop is only set inMap::prepare, and cleared inasyncTerminate. If the assert inasyncTerminatepasses, then I would expect the assert inclearLoopto pass as well?EDIT: Is
threadIdset properly insetLoop? It's set to the id of the current thread, not the id of the loop thread?jfirebaugh commentedon Dec 9, 2014
I'm blocked from debugging this by #689.
mikemorris commentedon Dec 10, 2014
Blocked by #689 as well.
jfirebaugh commentedon Dec 10, 2014
Now blocked by #712.
jfirebaugh commentedon Dec 11, 2014
Now blocked by SIGILL in the debugger: https://gist.github.com/jfirebaugh/1fe15362b75e56ef4e72
ljbade commentedon Dec 18, 2014
After merging latest master everything seems to be working now. Haven't been able to bring back the crash and tiles now load properly.
I think that loop fix was the trick.
mikemorris commentedon Dec 18, 2014
Alright, that's great!