Intermodalics / tango_ros

ROS related software for Tango
Apache License 2.0
67 stars 22 forks source link

YS device: App is seg faulting when connecting to Tango #219

Open PerrineAguiar opened 7 years ago

PerrineAguiar commented 7 years ago

Seg fault seems to appear only on YS devices:

PerrineAguiar commented 7 years ago

Concerning the second crash: The cause of the second crash was that the device was running under ART, which is not fully working on Android Kitkat. Switching back to Dalvik (Settings --> Developer options --> Select runtime) seems to resolve it.

According to this post: Basically there are two run-time environments on Android.

1) Dalvik VM : Dalvik is the managed runtime used by applications and some system services on Android. Dalvik was originally created specifically for the Android project.

2) ART- ART is a new Android runtime being introduced experimentally in the 4.4 release that will eventually replace Dalvik. This is a preview of work in progress in KitKat that can be turned on in Settings > developer options.

Important: Dalvik must remain the default runtime or you risk breaking your Android implementations and third-party applications.

Above content is from Android developer site.

PerrineAguiar commented 7 years ago

Concerning the first crash: It happens:

It does not happen:

EDIT I ran the test on device with tango_service running with valgrind, I got one potentially interesting message:

Waiting for client to connect
Transaction code: GET_CONFIG
Requested config type: TANGO_CONFIG_DEFAULT
Waiting for client to connect
Transaction code: SET_POSE_LISTENER_FRAMES
set poseListenerFrames from 8823
Transaction code: CONNECT_CAMERA
Camera ID: 2
==8258== Thread 4 Binder_1:
==8258== Invalid read of size 4
==8258==    at 0x4DB0092: tango_service::JniTangoService::HasAndroidPermission(tango_service::AndroidPermission, std::string const&) (in /data/app-lib/com.google.tango-1/libtango_service_library.so)
==8258==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==8258== 
==8258== 
==8258== Process terminating with default action of signal 11 (SIGSEGV)
==8258==  Access not within mapped region at address 0x0
==8258==    at 0x4DB0092: tango_service::JniTangoService::HasAndroidPermission(tango_service::AndroidPermission, std::string const&) (in /data/app-lib/com.google.tango-1/libtango_service_library.so)
==8258==  If you believe this happened as a result of a stack
==8258==  overflow in your program's main thread (unlikely but
==8258==  possible), you can try to increase the size of the
==8258==  main thread stack using the --main-stacksize= flag.
==8258==  The main thread stack size used in this run was 8388608.
==8258== 
==8258== HEAP SUMMARY:
==8258==     in use at exit: 267,746 bytes in 3,824 blocks
==8258==   total heap usage: 14,788 allocs, 10,964 frees, 802,743 bytes allocated
==8258== 
==8258== LEAK SUMMARY:
==8258==    definitely lost: 0 bytes in 0 blocks
==8258==    indirectly lost: 0 bytes in 0 blocks
==8258==      possibly lost: 147,536 bytes in 1,180 blocks
==8258==    still reachable: 120,210 bytes in 2,644 blocks
==8258==         suppressed: 0 bytes in 0 blocks
==8258== Rerun with --leak-check=full to see details of leaked memory
==8258== 
==8258== For counts of detected and suppressed errors, rerun with: -v
==8258== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 0 from 0)