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.

Run core tests on Android #5456

Closed
Closed

Description

@ivovandongen

In order to test the android bindings for core-gl we need to run the core unit tests on Android.

There two ways to run the tests:

Furthermore, there are a couple types of tests:

  • 'Simple' tests - no dependencies on fs, network, etc
  • Fixture tests - need fixures from the fs to run
  • Network tests - need an http server
  • Render tests - need a headless renderer

Activity

  1. added
    Android
    on Jun 23, 2016
  2. ivovandongen commented on Jun 23, 2016

    @ivovandongen
    ContributorAuthor

    I started of with the a native executable running only the 'simple' tests. With great help from @tmpsantos we got some 20 unit tests to run on the device. However, it seems that these executables have no access to any kind of vm (as they're not started from dalvik/art). Proceeding with the approach in #4671.

    Also, it only compiles with arm-v7. @jfirebaugh suggested updating the ndk. Adding that to the list.

  3. tobrun commented on Jun 23, 2016

    @tobrun
    Member

    Linking #2150

  4. added a commit that references this issue on Jun 23, 2016
  5. ivovandongen commented on Jun 27, 2016

    @ivovandongen
    ContributorAuthor

    Progress - Runs on a vm now, properly linked with gtest in a shared lib, from the command line. But only for a subset of the tests still. A couple of hacks were needed to get things going:

    • Got rid of the -whole-archive in test/test.gyphi as it gives linking errors when linking into a shared library - need to make that dependent on the target os.
    • Commented out one line in jni.cpp as it made it crash - no ideas yet
    • Still commented out tests that need external resources or a headless renderer - next steps
  6. ivovandongen commented on Jun 27, 2016

    @ivovandongen
    ContributorAuthor

    Concerning the crash in jni.cpp:

    ********** Crash dump: **********
    Build fingerprint: 'google/bullhead/bullhead:6.0.1/MTC19V/2862947:user/release-keys'
    pid: 32683, tid: 32683, name: main  >>> dalvikvm32 <<<
    signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    Stack frame #00 pc 00042374  /system/lib/libc.so (tgkill+12)
    Stack frame #01 pc 0003ff81  /system/lib/libc.so (pthread_kill+32)
    Stack frame #02 pc 0001c73f  /system/lib/libc.so (raise+10)
    Stack frame #03 pc 000198f1  /system/lib/libc.so (__libc_android_abort+34)
    Stack frame #04 pc 000174b0  /system/lib/libc.so (abort+4)
    Stack frame #05 pc 007161f4  /data/local/tmp/libmapbox-gl.so: Routine 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:29
    Stack frame #06 pc 00716368  /data/local/tmp/libmapbox-gl.so: Routine 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:68
    Stack frame #07 pc 007069b0  /data/local/tmp/libmapbox-gl.so: Routine std::__terminate(void (*)()) at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_handlers.cpp:70
    Stack frame #08 pc 00705bec  /data/local/tmp/libmapbox-gl.so: Routine __cxa_begin_catch at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_exception.cpp:425
    Stack frame #09 pc 002e0144  /data/local/tmp/libmapbox-gl.so: Routine _jfieldID* jni::CheckJavaException<_jfieldID*>(_JNIEnv&, _jfieldID*&&) at /Users/ivo/git/mapbox-gl-native/mason_packages/headers/jni.hpp/2.0.0/include/jni/errors.hpp:64
    Stack frame #10 pc 002a4134  /data/local/tmp/libmapbox-gl.so: Routine jni::GetFieldID(_JNIEnv&, jni::jclass&, char const*, char const*) at /Users/ivo/git/mapbox-gl-native/mason_packages/headers/jni.hpp/2.0.0/include/jni/functions.hpp:253
    Stack frame #11 pc 002e957c  /data/local/tmp/libmapbox-gl.so: Routine Field at /Users/ivo/git/mapbox-gl-native/mason_packages/headers/jni.hpp/2.0.0/include/jni/field.hpp:21
    Stack frame #12 pc 002e177c  /data/local/tmp/libmapbox-gl.so: Routine void jni::RegisterNativePeer<mbgl::HTTPRequest, mbgl::HTTPRequest, jni::NativePeerMemberFunctionMethod<void (mbgl::HTTPRequest::*)(_JNIEnv&, int, jni::Object<jni::StringTag>), &mbgl::HTTPRequest::onFailure>, jni::NativePeerMemberFunctionMethod<void (mbgl::HTTPRequest::*)(_JNIEnv&, int, jni::Object<jni::StringTag>, jni::Object<jni::StringTag>, jni::Object<jni::StringTag>, jni::Object<jni::StringTag>, jni::Array<signed char, void>), &mbgl::HTTPRequest::onResponse> >(_JNIEnv&, jni::Class<mbgl::HTTPRequest> const&, char const*, jni::NativePeerMemberFunctionMethod<void (mbgl::HTTPRequest::*)(_JNIEnv&, int, jni::Object<jni::StringTag>), &mbgl::HTTPRequest::onFailure>&&, jni::NativePeerMemberFunctionMethod<void (mbgl::HTTPRequest::*)(_JNIEnv&, int, jni::Object<jni::StringTag>, jni::Object<jni::StringTag>, jni::Object<jni::StringTag>, jni::Object<jni::StringTag>, jni::Array<signed char, void>), &mbgl::HTTPRequest::onResponse>&&) at /Users/ivo/git/mapbox-gl-native/mason_packages/headers/jni.hpp/2.0.0/include/jni/native_method.hpp:285
    Stack frame #13 pc 002e131c  /data/local/tmp/libmapbox-gl.so: Routine mbgl::android::RegisterNativeHTTPRequest(_JNIEnv&) at /Users/ivo/git/mapbox-gl-native/build/android-arm-v7/../../platform/android/src/http_file_source.cpp:63
    Stack frame #14 pc 0029fbfc  /data/local/tmp/libmapbox-gl.so: Routine JNI_OnLoad at /Users/ivo/git/mapbox-gl-native/build/android-arm-v7/../../platform/android/src/jni.cpp:1574
    Stack frame #15 pc 0024eba7  /system/lib/libart.so (_ZN3art9JavaVMExt17LoadNativeLibraryEP7_JNIEnvRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEP8_jobjectPS9_+1190)
    Stack frame #16 pc 002c02eb  /system/lib/libart.so (_ZN3artL18Runtime_nativeLoadEP7_JNIEnvP7_jclassP8_jstringP8_jobjectS5_+178)
    Stack frame #17 pc 72ce2105  /data/dalvik-cache/arm/system@[email protected] (offset 0x1ecf000)
    
  7. bleege commented on Jun 27, 2016

    @bleege
    Contributor

    /sub

  8. jfirebaugh commented on Jun 27, 2016

    @jfirebaugh
    Contributor

    The crash occurs during setup of the JNI bindings. It's trying to look up the mNativePtr field for the class com.mapbox.mapboxsdk.http.HTTPRequest and for some reason failing. Maybe a class loader issue?

  9. ivovandongen commented on Jun 28, 2016

    @ivovandongen
    ContributorAuthor

    Could be @jfirebaugh . But, if I load the class from the vm side, it loads fine:
    System.out.println(Class.forName("com.mapbox.mapboxsdk.http.HTTPRequest"));
    As long as I comment out the line in jni.cpp where it get's hooked up. If I leave it in, it breaks in the same spot, which seems to indicate it's not a classloading issue as the jni onLoad is triggered by loading the class. To be sure, I've added in a static call to loadLibrary in the HTTPRequest java class.

  10. ivovandongen commented on Jun 28, 2016

    @ivovandongen
    ContributorAuthor

    The crash above was indeed caused by a class loading issue. The underlying cause however was that libjavacrypto.so couldn't be loaded. Fixed that by setting the /system/lib dir explicitly in the LD_LIBRARY_PATH. Have to check the portability of this path.

  11. 90 remaining items

  12. added 8 commits that reference this issue on Jul 7, 2016
  13. ivovandongen commented on Jul 7, 2016

    @ivovandongen
    ContributorAuthor

    Completed the port of the nodejs webserver to c++ using cpp-httplib. cpp-httplib seems to have a serious issue with concurrency though. This results in the *FileSource.Load tests failing on the 'test-macos` target because clients can't connect. Other tests all run now against the new webserver.

    [ RUN      ] OnlineFileSource.Load
    /Users/ivo/git/mapbox-gl-native/test/storage/online_file_source.cpp:238: Failure
    Value of: res.error
      Actual: 8-byte object <B0-76 F0-7C 89-7F 00-00>
    Expected: nullptr
    Which is: 8-byte object <00-00 00-00 00-00 00-00>
    ....
    
  14. ivovandongen commented on Jul 7, 2016

    @ivovandongen
    ContributorAuthor

    Remaining issues on android

    On the android side of the tests, there are a couple more issues:

    • test/storage/online_file_source.cpp won't compile
    • HTTP tests on android crash
    • AssetFileSource tests crash
    • API.RepeatedRender test seems to lock up

    I've included the details for these below.

    test/storage/online_file_source.cpp won't compile:

    In file included from ../../test/storage/online_file_source.cpp:1:
    In file included from ../../test/src/mbgl/test/util.hpp:44:
    /Users/ivo/git/mapbox-gl-native/mason_packages/android-arm-v7-9/gtest/1.7.0/include/gtest/gtest.h:18998:28: error: invalid operands to binary expression ('const
          std::__ndk1::chrono::time_point<std::__ndk1::chrono::system_clock, std::__ndk1::chrono::duration<long long, std::__ndk1::ratio<1, 1> > >' and 'const
          std::experimental::__library_fundamentals_v1::optional<std::__ndk1::chrono::time_point<std::__ndk1::chrono::system_clock, std::__ndk1::chrono::duration<long long, std::__ndk1::ratio<1, 1> > > >')
    GTEST_IMPL_CMP_HELPER_(GT, >);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
    /Users/ivo/git/mapbox-gl-native/mason_packages/android-arm-v7-9/gtest/1.7.0/include/gtest/gtest.h:18975:12: note: expanded from macro 'GTEST_IMPL_CMP_HELPER_'
      if (val1 op val2) {\
          ~~~~ ^  ~~~~
    ../../test/storage/online_file_source.cpp:151:9: note: in instantiation of function template specialization
          'testing::internal::CmpHelperGT<std::__ndk1::chrono::time_point<std::__ndk1::chrono::system_clock, std::__ndk1::chrono::duration<long long, std::__ndk1::ratio<1, 1> > >,
          std::experimental::__library_fundamentals_v1::optional<std::__ndk1::chrono::time_point<std::__ndk1::chrono::system_clock, std::__ndk1::chrono::duration<long long, std::__ndk1::ratio<1, 1> > > > >'
          requested here
            EXPECT_GT(util::now(), res.expires);
            ^
    

    http tests crash.

    On arm-v7:

    [ RUN      ] HTTPFileSource.HTTP200
    Segmentation fault 
    

    From logcat:

    07-07 11:06:51.272  3690  3690 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    07-07 11:06:51.273  3690  3690 F DEBUG   : Build fingerprint: 'google/bullhead/bullhead:6.0.1/MTC19V/2862947:user/release-keys'
    07-07 11:06:51.273  3690  3690 F DEBUG   : Revision: 'rev_1.0'
    07-07 11:06:51.274  3690  3690 F DEBUG   : ABI: 'arm'
    07-07 11:06:51.274  3690  3690 F DEBUG   : pid: 9499, tid: 9573, name: .0.0.1:3000/...  >>> dalvikvm32 <<<
    07-07 11:06:51.275  3690  3690 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    07-07 11:06:51.279  4930  6911 W NativeCrashListener: Couldn't find ProcessRecord for pid 9499
    07-07 11:06:51.278  3690  3690 W debuggerd: type=1400 audit(0.0:696539): avc: denied { search } for name="tmp" dev="dm-2" ino=752194 scontext=u:r:debuggerd:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
    07-07 11:06:51.284  3690  3690 F DEBUG   :     r0 f1444b80  r1 edafa26c  r2 00000000  r3 00000005
    07-07 11:06:51.285  3690  3690 E DEBUG   : AM write failed: Broken pipe
    07-07 11:06:51.286  3690  3690 F DEBUG   :     r4 70b97108  r5 00000000  r6 12c381c0  r7 12cb6660
    07-07 11:06:51.286  3690  3690 F DEBUG   :     r8 00000000  r9 f13cc300  sl 00000000  fp edafa324
    07-07 11:06:51.286  3690  3690 F DEBUG   :     ip f6e5d000  sp edafa250  lr 7367a879  pc 00000000  cpsr 200b0010
    07-07 11:06:51.290  3690  3690 F DEBUG   : 
    07-07 11:06:51.290  3690  3690 F DEBUG   : backtrace:
    07-07 11:06:51.291  3690  3690 F DEBUG   :     #00 pc 00000000  <unknown>
    07-07 11:06:51.291  3690  3690 F DEBUG   :     #01 pc 7367a877  /data/dalvik-cache/arm/system@[email protected] (offset 0x1ecf000)
    07-07 11:06:51.332  3690  3690 W debuggerd: type=1400 audit(0.0:696540): avc: denied { search } for name="tmp" dev="dm-2" ino=752194 scontext=u:r:debuggerd:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
    07-07 11:06:51.345  3690  3690 W debuggerd: type=1400 audit(0.0:696541): avc: denied { search } for name="tmp" dev="dm-2" ino=752194 scontext=u:r:debuggerd:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
    07-07 11:06:51.345  3690  3690 W debuggerd: type=1400 audit(0.0:696542): avc: denied { search } for name="tmp" dev="dm-2" ino=752194 scontext=u:r:debuggerd:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
    07-07 11:06:51.463  3690  3690 F DEBUG   : 
    07-07 11:06:51.463  3690  3690 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_02
    

    On x86 (emulator)

    [----------] 10 tests from HTTPFileSource
    [ RUN      ] HTTPFileSource.Cancel
    [       OK ] HTTPFileSource.Cancel (17 ms)
    [ RUN      ] HTTPFileSource.HTTP200
    java.lang.UnsatisfiedLinkError: No implementation found for int android.util.Log.println_native(int, int, java.lang.String, java.lang.String) (tried Java_android_util_Log_println_1native and Java_android_util_Log_println_1native__IILjava_lang_String_2Ljava_lang_String_2)
        at android.util.Log.println_native(Native Method)
        at android.util.Log.w(Log.java:181)
        at com.mapbox.mapboxsdk.http.HTTPRequest.onFailure(HTTPRequest.java:124)
        at com.mapbox.mapboxsdk.http.HTTPRequest.onFailure(HTTPRequest.java:120)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:140)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
    java.lang.UnsatisfiedLinkError: No implementation found for int android.util.Log.println_native(int, int, java.lang.String, java.lang.String) (tried Java_android_util_Log_println_1native and Java_android_util_Log_println_1native__IILjava_lang_String_2Ljava_lang_String_2)
        at android.util.Log.println_native(Native Method)
        at android.util.Log.v(Log.java:118)
        at com.mapbox.mapboxsdk.http.HTTPRequest.onResponse(HTTPRequest.java:91)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:133)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
    

    Which is weird. The Java class for Log is loaded, but the associated native library isn't. Need to figure out which shared library contains the native implementations.

    AssetFileSource crashes

    [----------] 6 tests from AssetFileSource
    [ RUN      ] AssetFileSource.Load
    Segmentation fault 
    

    From logcat+ndk-stack

    ********** Crash dump: **********
    Build fingerprint: 'google/bullhead/bullhead:6.0.1/MTC19V/2862947:user/release-keys'
    pid: 9263, tid: 9357, name:   >>> dalvikvm32 <<<
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c
    Stack frame #00 pc 0004027e  /system/lib/libc.so (pthread_mutex_lock+3)
    Stack frame #01 pc 007fcd19  /data/local/tmp/core-tests/libmapbox-gl.so: Routine __libcpp_compressed_pair_imp at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/memory:2138
    Stack frame #02 pc 007cc8c8  /data/local/tmp/core-tests/libmapbox-gl.so: Routine __tuple_impl<0, 1, 2, mbgl::GlyphStore *, std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > >, std::__ndk1::pair<unsigned short, unsigned short> , mbgl::GlyphStore *, const std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > &, const std::__ndk1::pair<unsigned short, unsigned short> &> at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/tuple:399 (discriminator 1)
    Stack frame #03 pc 007cc7fc  /data/local/tmp/core-tests/libmapbox-gl.so: Routine __bind<void (mbgl::GlyphStore::*)(const std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > &, const std::__ndk1::pair<unsigned short, unsigned short> &), mbgl::GlyphStore *, const std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > &, const std::__ndk1::pair<unsigned short, unsigned short> &, void> at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/functional:2078
    Stack frame #04 pc 003bf484  /data/local/tmp/core-tests/libmapbox-gl.so: Routine ~basic_stringstream at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/iosfwd:126
    Stack frame #05 pc 003bf2dc  /data/local/tmp/core-tests/libmapbox-gl.so: Routine mbgl::platform::lowercase(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) at /Users/ivo/git/mapbox-gl-native/build/android-x86/../../platform/default/string_stdlib.cpp:74 (discriminator 1)
    Stack frame #06 pc 003bf050  /data/local/tmp/core-tests/libmapbox-gl.so: Routine std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >::size() const at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/string:1479 (discriminator 2)
    Stack frame #07 pc 003b5714  /data/local/tmp/core-tests/libmapbox-gl.so: Routine std::__ndk1::__compressed_pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >::__rep, std::__ndk1::allocator<char> >::first() const at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/memory:2371
    Stack frame #08 pc 003bb278  /data/local/tmp/core-tests/libmapbox-gl.so: Routine unique_ptr at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/memory:2511
    Stack frame #09 pc 003ba43c  /data/local/tmp/core-tests/libmapbox-gl.so: Routine ~unique_ptr at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/memory:2598
    Stack frame #10 pc 003be334  /data/local/tmp/core-tests/libmapbox-gl.so: Routine std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >::length() const at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/string:1480
    Stack frame #11 pc 003be250  /data/local/tmp/core-tests/libmapbox-gl.so: Routine std::__ndk1::__compressed_pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >::__rep, std::__ndk1::allocator<char> >::first() const at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/memory:2371
    Stack frame #12 pc 003bde20  /data/local/tmp/core-tests/libmapbox-gl.so: Routine basic_iostream at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/istream:1492
    Stack frame #13 pc 007ccf18  /data/local/tmp/core-tests/libmapbox-gl.so: Routine __func at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/functional:1318
    Stack frame #14 pc 007cccd0  /data/local/tmp/core-tests/libmapbox-gl.so: Routine std::__ndk1::allocator<std::__ndk1::__function::__func<std::__ndk1::__bind<void (mbgl::GlyphStore::*)(std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > const&, std::__ndk1::pair<unsigned short, unsigned short> const&), mbgl::GlyphStore*, std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > const&, std::__ndk1::pair<unsigned short, unsigned short> const&>, std::__ndk1::allocator<std::__ndk1::__bind<void (mbgl::GlyphStore::*)(std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > const&, std::__ndk1::pair<unsigned short, unsigned short> const&), mbgl::GlyphStore*, std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > const&, std::__ndk1::pair<unsigned short, unsigned short> const&> >, void ()> >::allocate(unsigned int, void const*) at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/memory:1634
    Stack frame #15 pc 003bc07c  /data/local/tmp/core-tests/libmapbox-gl.so: Routine tuple at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/tuple:506
    Stack frame #16 pc 003bbfd4  /data/local/tmp/core-tests/libmapbox-gl.so: Routine __func at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/functional:1308
    Stack frame #17 pc 003bbd5c  /data/local/tmp/core-tests/libmapbox-gl.so: Routine _ZNSt6__ndk117__compressed_pairIPNS_10__function6__funcIZN4mbgl4util7RunLoop18invokeWithCallbackIZNS4_6ThreadINS3_15AssetFileSource4ImplEE4bindIMS9_FvRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_8functionIFvNS3_8ResponseEEEEEEEDaT_EUlDpOT_E_RSN_JSJ_EEENS_10unique_ptrINS3_12AsyncRequestENS_14default_deleteISY_EEEEOSR_OT0_DpOT1_EUlSU_E_NSF_IS18_EESM_EENS_22__allocator_destructorINSF_IS1A_EEEEE5firstEv at /Users/ivo/git/mapbox-gl-native/mason_packages/osx-x86_64/android-ndk/x86-9-r12b/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../include/c++/4.9.x/memory:2370
    Stack frame #18 pc 0003f883  /system/lib/libc.so (_ZL15__pthread_startPv+30)
    Stack frame #19 pc 00019f75  /system/lib/libc.so (__start_thread+6)
    

    API.RepeatedRender lockup

    On the emulator:

    07-07 11:39:53.198  3132  3132 E EGL_emulation: tid 3132: eglBindAPI(783): error 0x300c (EGL_BAD_PARAMETER)
    07-07 11:39:53.216  3132  3132 E EGL_emulation: tid 3132: eglBindAPI(783): error 0x300c (EGL_BAD_PARAMETER)
    

    But this is also printed for the tests that succeed, might not be related. More probable is that I don't clean up correctly as it seems to lock after a couple of render iterations.

    On arm-v7 I don't get these messages (still locks up though). Maybe an emulator issue.

  15. ivovandongen commented on Jul 11, 2016

    @ivovandongen
    ContributorAuthor

    Concerning the crash of the Http tests on Android. After removing the Log.* calls from our HTTPContext class, the tests ran rather smoothly. Turns out that not all native methods from the Android framework are loaded at the proper time. Loading the correct library (System.loadLibrary("android_runtime");) didn't help.

    The missing methods native methods are in the util Log class. Registration of these methods seem to go through the AndroidRuntime class: Java_com_android_internal_util_WithFramework_registerNatives or Java_LoadClass_registerNatives. The former is used by WithFramework.java, the later by LoadClass.java.

    Both are package protected, so not easily re-usable. But similar functionality shouldn't be too hard to create for our test loader if we can link to either of those functions. Otherwise we can probably stub out the Log class as it is the only class from the runtime we need atm.

  16. tobrun commented on Dec 21, 2016

    @tobrun
    Member

    @ivovandongen basic integration for x86 has landed, good to close for now?

  17. added
    archived
    on Nov 16, 2018
  18. stale commented on Nov 24, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

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

Metadata

Metadata

Assignees

Labels

Androidarchived

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions