cnlohr / rawdrawandroid

Build android apps without any java, entirely in C and Make
MIT License
3.55k stars 226 forks source link

ASensorManager_getDefaultSensor returns NULL #22

Closed EmmanuelMess closed 4 years ago

EmmanuelMess commented 4 years ago

I get this crash when the app starts (not modified):

07-24 22:30:23.221 24560 24576 D cnfgtest: Starting with Android SDK Version: 25Starting Main
07-24 22:30:23.221 24560 24576 D cnfgtest: Start: 0xab9179e0
07-24 22:30:23.223 24560 24576 D cnfgtest: activityState=10
07-24 22:30:23.228 24560 24576 D cnfgtest: event not handled: 10Resume: 0xab9179e0
07-24 22:30:23.228 24560 24576 D cnfgtest: activityState=11
07-24 22:30:23.248 24560 24576 D cnfgtest: event not handled: 11InputQueueCreated: 0xab9179e0 -- 0xab917b20
07-24 22:30:23.248 24560 24576 D cnfgtest: APP_CMD_INPUT_CHANGED
07-24 22:30:23.279  1158  8026 D InputDispatcher: Focus entered window: Window{7ee26fc u0 org.yourorg.cnfgtest/android.app.NativeActivity}
07-24 22:30:23.285 24560 24576 D cnfgtest: Attaching input queue to looperevent not handled: 0NativeWindowCreated: 0xab9179e0 -- 0xab97e008
07-24 22:30:23.285 24560 24576 D cnfgtest: APP_CMD_INIT_WINDOW
07-24 22:30:23.285 24560 24576 D cnfgtest: Got start event
07-24 22:30:23.292 24560 24576 D cnfgtest: WindowFocusChanged: 0xab9179e0 -- 1
07-24 22:30:23.295 24560 24576 D cnfgtest: EGL Version: "1.4 Android META-EGL"
07-24 22:30:23.295 24560 24576 D cnfgtest: EGL Vendor: "Android"
07-24 22:30:23.295 24560 24576 D cnfgtest: EGL Extensions: "EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_swap_buffers_with_damage EGL_ANDROID_create_native_client_buffer EGL_ANDROID_front_buffer_auto_refresh EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_KHR_create_context EGL_KHR_config_attribs EGL_KHR_surfaceless_context EGL_EXT_create_context_robustness EGL_ANDROID_image_native_buffer EGL_KHR_wait_sync EGL_ANDROID_recordable EGL_KHR_partial_update "
07-24 22:30:23.295 24560 24576 D cnfgtest: Config: 1
07-24 22:30:23.295 24560 24576 D cnfgtest: Creating Context
07-24 22:30:23.299 24560 24576 D cnfgtest: Context Created 0xb1d24500
07-24 22:30:23.299 24560 24576 D cnfgtest: Getting Surface 0xab97e008
07-24 22:30:23.301 24560 24576 D cnfgtest: Width/Height: 720x1280
07-24 22:30:23.304 24560 24576 D cnfgtest: Got Surface: 0x958fc060
07-24 22:30:23.304 24560 24576 D cnfgtest: GL Vendor: "ARM"
07-24 22:30:23.305 24560 24576 D cnfgtest: GL Renderer: "Mali-T860"
07-24 22:30:23.305 24560 24576 D cnfgtest: GL Version: "OpenGL ES 3.2 v1.r12p0-04rel0.44f2946824bb8739781564bffe2110c9"
07-24 22:30:23.305 24560 24576 D cnfgtest: GL Extensions: "GL_EXT_debug_marker GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjoint_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_clamp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader_multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_shader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_exte
07-24 22:30:23.305 24560 24576 D cnfgtest: nsion_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_EXT_copy_image GL_OES_copy_image GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_elements_base_vertex GL_OES_draw_elements_base_vertex "
07-24 22:30:23.328  1158  1230 I ActivityManager: Displayed org.yourorg.cnfgtest/android.app.NativeActivity: +274ms (total +15m25s592ms)
07-24 22:30:23.332  1158  1230 V WindowManager: Not removing Window{3bc34ff u0 Starting org.yourorg.cnfgtest EXITING} due to exit animation 
07-24 22:30:23.359 24593 24593 I AEE_AED : check process 24560 name:ourorg.cnfgtest
07-24 22:30:23.361 24593 24593 I AEE_AED : [preset_info] pid: 24560, tid: 24577, name: Thread-3  >>> org.yourorg.cnfgtest <<<
07-24 22:30:23.434 24593 24593 I AEE_AED : pid: 24560, tid: 24577, name: Thread-3  >>> org.yourorg.cnfgtest <<<
07-24 22:30:23.436 24593 24593 I AEE_AED :     #02 pc 00004570  /data/app/org.yourorg.cnfgtest-1/lib/arm/libcnfgtest.so
07-24 22:30:24.486 24593 24593 V AEE_AED : dashboard_record_update() : rec->module = org.yourorg.cnfgtest 
07-24 22:30:24.487  1158 24594 W ActivityManager:   Force finishing activity org.yourorg.cnfgtest/android.app.NativeActivity
07-24 22:30:24.503  1158 24594 D InputDispatcher: Focus left window: Window{7ee26fc u0 org.yourorg.cnfgtest/android.app.NativeActivity}
07-24 22:30:24.525  1158  1447 W InputDispatcher: channel '7ee26fc org.yourorg.cnfgtest/android.app.NativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
07-24 22:30:24.525  1158  1447 E InputDispatcher: channel '7ee26fc org.yourorg.cnfgtest/android.app.NativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
07-24 22:30:24.526  1158  4613 I WindowManager: WIN DEATH: Window{7ee26fc u0 org.yourorg.cnfgtest/android.app.NativeActivity}
07-24 22:30:24.526  1158  4613 W InputDispatcher: Attempted to unregister already unregistered input channel '7ee26fc org.yourorg.cnfgtest/android.app.NativeActivity (server)'
07-24 22:30:24.529  1158  4613 D InputDispatcher: Window went away: Window{7ee26fc u0 org.yourorg.cnfgtest/android.app.NativeActivity}
07-24 22:30:24.552  1158  1908 I ActivityManager: Process org.yourorg.cnfgtest (pid 24560) has died
07-24 22:30:24.613  1158  1210 D InputDispatcher: Focus entered window: Window{af4f2b4 u0 Application Error: org.yourorg.cnfgtest}
07-24 22:30:24.705  1158  1230 I WindowManager: Window{af4f2b4 u0 Application Error: org.yourorg.cnfgtest} start dimming: flags=1820002 effectFlags=0, layer=111000
07-24 22:30:24.717  1158  1230 I WindowManager: Window{af4f2b4 u0 Application Error: org.yourorg.cnfgtest} start dimming: flags=1820002 effectFlags=0, layer=111000

make uninstall; make push run Prints:

(adb uninstall org.yourorg.cnfgtest)||true
Success
mkdir -p makecapk/assets
echo "Test asset file" > makecapk/assets/asset.txt
rm -rf temp.apk
/home/emmanuel/Android/Sdk/build-tools/30.0.1/aapt package -f -F temp.apk -I ~/Android/Sdk/platforms/android-29/android.jar -M AndroidManifest.xml -S Sources/res -A makecapk/assets -v --target-sdk-version 29
Found 1 custom asset file in makecapk/assets
Configurations:
 (default)

Files:
  assets/asset.txt
    Src: () makecapk/assets/asset.txt
  mipmap/icon.png
    Src: () Sources/res/mipmap/icon.png
  values/strings.xml
    Src: () Sources/res/values/strings.xml
  AndroidManifest.xml
    Src: () AndroidManifest.xml

Resource Dirs:
  Type mipmap
    mipmap/icon.png
      Src: () Sources/res/mipmap/icon.png
  Type values
    values/strings.xml
      Src: () Sources/res/values/strings.xml
Including resources from package: /home/emmanuel/Android/Sdk/platforms/android-29/android.jar
applyFileOverlay for drawable
applyFileOverlay for layout
applyFileOverlay for anim
applyFileOverlay for animator
applyFileOverlay for interpolator
applyFileOverlay for transition
applyFileOverlay for xml
applyFileOverlay for raw
applyFileOverlay for color
applyFileOverlay for menu
applyFileOverlay for font
applyFileOverlay for mipmap
Processing image: Sources/res/mipmap/icon.png
    (processed image Sources/res/mipmap/icon.png: 100% size of source)
    (new resource id icon from mipmap/icon.png #generated)
Creating 'temp.apk'
Writing all files...
      'AndroidManifest.xml' (compressed 63%)
      'assets/asset.txt' (not compressed)
      'res/mipmap/icon.png' (not compressed)
      'resources.arsc' (not compressed)
Generated 4 files
Included 0 files from jar/zip files.
Checking for deleted files
Done!
unzip -o temp.apk -d makecapk
Archive:  temp.apk
  inflating: makecapk/AndroidManifest.xml  
 extracting: makecapk/assets/asset.txt  
 extracting: makecapk/res/mipmap/icon.png  
 extracting: makecapk/resources.arsc  
rm -rf makecapk.apk
cd makecapk && zip -D9r ../makecapk.apk .
  adding: AndroidManifest.xml (deflated 63%)
  adding: res/mipmap/icon.png (deflated 8%)
  adding: lib/arm64-v8a/libcnfgtest.so (deflated 59%)
  adding: lib/armeabi-v7a/libcnfgtest.so (deflated 52%)
  adding: assets/asset.txt (stored 0%)
  adding: resources.arsc (deflated 73%)
jarsigner -sigalg SHA1withRSA -digestalg SHA1 -verbose -keystore my-release-key.keystore -storepass password makecapk.apk standkey
   adding: META-INF/MANIFEST.MF
   adding: META-INF/STANDKEY.SF
   adding: META-INF/STANDKEY.RSA
  signing: AndroidManifest.xml
  signing: res/mipmap/icon.png
  signing: lib/arm64-v8a/libcnfgtest.so
  signing: lib/armeabi-v7a/libcnfgtest.so
  signing: assets/asset.txt
  signing: resources.arsc

>>> Signer
    X.509, CN=example.com, OU=ID, O=Example, L=Doe, ST=John, C=GB
    [trusted certificate]

jar signed.

Warning: 
The signer's certificate is self-signed.
rm -rf cnfgtest.apk
/home/emmanuel/Android/Sdk/build-tools/30.0.1/zipalign -v 4 makecapk.apk cnfgtest.apk
Verifying alignment of cnfgtest.apk (4)...
      50 META-INF/MANIFEST.MF (OK - compressed)
     439 META-INF/STANDKEY.SF (OK - compressed)
     898 META-INF/STANDKEY.RSA (OK - compressed)
    2078 AndroidManifest.xml (OK - compressed)
    3023 res/mipmap/icon.png (OK - compressed)
    3194 lib/arm64-v8a/libcnfgtest.so (OK - compressed)
   19422 lib/armeabi-v7a/libcnfgtest.so (OK - compressed)
   35916 assets/asset.txt (OK)
   36000 resources.arsc (OK - compressed)
Verification succesful
rm -rf temp.apk
rm -rf makecapk.apk
-rw-rw-r-- 1 emmanuel emmanuel 37045 jul 24 22:14 cnfgtest.apk
Installing org.yourorg.cnfgtest
adb install cnfgtest.apk
Success
adb shell am start -n org.yourorg.cnfgtest/android.app.NativeActivity
Starting: Intent { cmp=org.yourorg.cnfgtest/android.app.NativeActivity }

I know C and Android (Java/Kotlin/Flutter), how should I go about fixing this?

dreua commented 4 years ago

Thanks for the log, unfortunately I don't know what the problem is :disappointed: Here is a good log from my phone in case it could be of any use: good-run.log

The startup looks quite similar (your log):

07-24 22:14:43.035 23662 23679 D cnfgtest: Starting with Android SDK Version: 25Starting Main
07-24 22:14:43.036 23662 23679 D cnfgtest: Start: 0xab9179e0
07-24 22:14:43.036 23662 23679 D cnfgtest: activityState=10
07-24 22:14:43.041 23662 23679 D cnfgtest: event not handled: 10Resume: 0xab9179e0
07-24 22:14:43.041 23662 23679 D cnfgtest: activityState=11
07-24 22:14:43.067 23662 23679 D cnfgtest: event not handled: 11InputQueueCreated: 0xab9179e0 -- 0xab917b20
07-24 22:14:43.068 23662 23679 D cnfgtest: APP_CMD_INPUT_CHANGED
07-24 22:14:43.080 23662 23679 D cnfgtest: Attaching input queue to looperevent not handled: 0Pause: 0xab9179e0
07-24 22:14:43.080 23662 23679 D cnfgtest: activityState=13
07-24 22:14:43.106 23662 23679 D cnfgtest: event not handled: 13NativeWindowCreated: 0xab9179e0 -- 0xab96f008
07-24 22:14:43.106 23662 23679 D cnfgtest: APP_CMD_INIT_WINDOW
07-24 22:14:43.106 23662 23679 D cnfgtest: Got start event
07-24 22:14:43.108 23662 23679 D cnfgtest: SaveInstanceState: 0xab9179e0
07-24 22:14:43.126 23662 23679 D cnfgtest: EGL Version: "1.4 Android META-EGL"
07-24 22:14:43.126 23662 23679 D cnfgtest: EGL Vendor: "Android"
07-24 22:14:43.126 23662 23679 D cnfgtest: EGL Extensions: "EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_swap_buffers_with_damage EGL_ANDROID_create_native_client_buffer EGL_ANDROID_front_buffer_auto_refresh EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_KHR_create_context EGL_KHR_config_attribs EGL_KHR_surfaceless_context EGL_EXT_create_context_robustness EGL_ANDROID_image_native_buffer EGL_KHR_wait_sync EGL_ANDROID_recordable EGL_KHR_partial_update "
07-24 22:14:43.127 23662 23679 D cnfgtest: Config: 1
07-24 22:14:43.127 23662 23679 D cnfgtest: Creating Context
07-24 22:14:43.138 23662 23679 D cnfgtest: Context Created 0xb1d24500
07-24 22:14:43.139 23662 23679 D cnfgtest: Getting Surface 0xab96f008
07-24 22:14:43.139 23662 23679 D cnfgtest: Width/Height: 720x1280
07-24 22:14:43.140 23662 23679 D cnfgtest: Got Surface: 0x958fb060
07-24 22:14:43.141 23662 23679 D cnfgtest: GL Vendor: "ARM"
07-24 22:14:43.141 23662 23679 D cnfgtest: GL Renderer: "Mali-T860"
07-24 22:14:43.141 23662 23679 D cnfgtest: GL Version: "OpenGL ES 3.2 v1.r12p0-04rel0.44f2946824bb8739781564bffe2110c9"
07-24 22:14:43.141 23662 23679 D cnfgtest: GL Extensions: "GL_EXT_debug_marker GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjoint_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_clamp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader_multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_shader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_extension_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_
07-24 22:14:43.141 23662 23679 D cnfgtest: EXT_copy_image GL_OES_copy_image GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_elements_base_vertex GL_OES_draw_elements_base_vertex "

But then on your phone this happens:

07-24 22:14:43.221 23696 23696 I AEE_AED : check process 23662 name:ourorg.cnfgtest
07-24 22:14:43.225 23696 23696 I AEE_AED : [preset_info] pid: 23662, tid: 23680, name: Thread-3  >>> org.yourorg.cnfgtest <<<
07-24 22:14:43.313 23696 23696 I AEE_AED : pid: 23662, tid: 23680, name: Thread-3  >>> org.yourorg.cnfgtest <<<
07-24 22:14:43.316 23696 23696 I AEE_AED :     #02 pc 00004570  /data/app/org.yourorg.cnfgtest-1/lib/arm/libcnfgtest.so
07-24 22:14:44.161 23696 23696 V AEE_AED : dashboard_record_update() : rec->module = org.yourorg.cnfgtest 
07-24 22:14:44.164  1158 23697 W ActivityManager:   Force finishing activity org.yourorg.cnfgtest/android.app.NativeActivity
07-24 22:14:44.214  1158 15598 I ActivityManager: Process org.yourorg.cnfgtest (pid 23662) has died

As I understand it, the ActivityManager kills the app for some undisclosed reason. Could be out of memory or something else. Maybe it's worth to have another look at the full log at this point to find clues about what is going on.

EmmanuelMess commented 4 years ago

The issue seems to be this "AEE_AED" developed by Mediatek.

EmmanuelMess commented 4 years ago

After removing all the code at rawdraw.c:main() the error keeps happening

NVM comenting all code in main() fixes it had to make clean uninstall push run.

EmmanuelMess commented 4 years ago

Logcat without grep:

07-25 13:14:34.121 24717 24733 D cnfgtest: Starting with Android SDK Version: 25Starting Main
07-25 13:14:34.123 24717 24733 D cnfgtest: Start: 0xab9179e0
07-25 13:14:34.125 24717 24733 D cnfgtest: activityState=10
07-25 13:14:34.129 24717 24733 D cnfgtest: event not handled: 10Resume: 0xab9179e0
07-25 13:14:34.129 24717 24733 D cnfgtest: activityState=11
07-25 13:14:34.138  1801  1801 W ResourceType: ResTable_typeSpec entry count inconsistent: given 1955, previously 2338
07-25 13:14:34.138  1801  1801 W ResourceType: ResTable_typeSpec entry count inconsistent: given 1532, previously 1537
07-25 13:14:34.140  1801  1801 W ResourceType: ResTable_typeSpec entry count inconsistent: given 289, previously 1802
07-25 13:14:34.156 24717 24733 D cnfgtest: event not handled: 11InputQueueCreated: 0xab9179e0 -- 0xab917b20
07-25 13:14:34.157 24717 24733 D cnfgtest: APP_CMD_INPUT_CHANGED
07-25 13:14:34.161  1801  1801 W ResourceType: ResTable_typeSpec entry count inconsistent: given 1, previously 382
07-25 13:14:34.173  1542  1542 D PhoneStatusBar: setSystemUiVisibility vis=160f mask=ffffffff oldVal=408 newVal=160f diff=1207
07-25 13:14:34.177  1542  1542 I PhoneStatusBar: updateMediaMetaData(false): mMediaMetadata = null
07-25 13:14:34.178  1542  1542 I PhoneStatusBar: sbModeChanged = true, mStatusBarMode = MODE_LIGHTS_OUT_TRANSPARENT, nbModeChanged = true, mNavigationBarMode = MODE_LIGHTS_OUT
07-25 13:14:34.179  1158  4340 I chatty  : uid=1000(system) Binder:1158_D expire 4 lines
07-25 13:14:34.181  1158  1520 I chatty  : uid=1000(system) WifiWatchdogSta expire 2 lines
07-25 13:14:34.190  1158  1908 I chatty  : uid=1000(system) Binder:1158_A expire 1 line
07-25 13:14:34.197 24717 24733 D cnfgtest: Attaching input queue to looperevent not handled: 0NativeWindowCreated: 0xab9179e0 -- 0xab979008
07-25 13:14:34.197 24717 24733 D cnfgtest: APP_CMD_INIT_WINDOW
07-25 13:14:34.197 24717 24733 D cnfgtest: Got start event
07-25 13:14:34.204   679   730 I GBMv2   : GBM state [1]
07-25 13:14:34.208 24717 24733 D cnfgtest: WindowFocusChanged: 0xab9179e0 -- 1
07-25 13:14:34.213 18151 18163 D ViewRootImpl: onChangedNavigationGuardColor(), color: ff000000
07-25 13:14:34.214 18151 18151 D DecorView: updateNavigationGuardColor navigationGuardColor=0xff000000
07-25 13:14:34.218 24717 24733 D cnfgtest: EGL Version: "1.4 Android META-EGL"
07-25 13:14:34.218 24717 24733 D cnfgtest: EGL Vendor: "Android"
07-25 13:14:34.218 24717 24733 D cnfgtest: EGL Extensions: "EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_swap_buffers_with_damage EGL_ANDROID_create_native_client_buffer EGL_ANDROID_front_buffer_auto_refresh EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_KHR_create_context EGL_KHR_config_attribs EGL_KHR_surfaceless_context EGL_EXT_create_context_robustness EGL_ANDROID_image_native_buffer EGL_KHR_wait_sync EGL_ANDROID_recordable EGL_KHR_partial_update "
07-25 13:14:34.218 24717 24733 D cnfgtest: Config: 1
07-25 13:14:34.218 24717 24733 D cnfgtest: Creating Context
07-25 13:14:34.221 24717 24733 D cnfgtest: Context Created 0xb1d24500
07-25 13:14:34.221 24717 24733 D cnfgtest: Getting Surface 0xab979008
07-25 13:14:34.222 24717 24733 D cnfgtest: Width/Height: 720x1280
07-25 13:14:34.225 24717 24734 D mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000
07-25 13:14:34.225 24717 24733 D cnfgtest: Got Surface: 0x958fc060
07-25 13:14:34.226 24717 24733 D cnfgtest: GL Vendor: "ARM"
07-25 13:14:34.226 18151 18151 I GoogleInputMethodServic: GoogleInputMethodService.onFinishInput():3138 
07-25 13:14:34.226 24717 24733 D cnfgtest: GL Renderer: "Mali-T860"
07-25 13:14:34.226 24717 24733 D cnfgtest: GL Version: "OpenGL ES 3.2 v1.r12p0-04rel0.44f2946824bb8739781564bffe2110c9"
07-25 13:14:34.226 24717 24733 D cnfgtest: GL Extensions: "GL_EXT_debug_marker GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjoint_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_clamp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader_multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_shader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_exte
07-25 13:14:34.226 24717 24733 D cnfgtest: nsion_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_EXT_copy_image GL_OES_copy_image GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_elements_base_vertex GL_OES_draw_elements_base_vertex "
07-25 13:14:34.228 24717 24717 I Timeline: Timeline: Activity_idle id: android.os.BinderProxy@d7ae51b time:848164162
07-25 13:14:34.229 18151 18151 I GoogleInputMethodServic: GoogleInputMethodService.onStartInput():1808 
07-25 13:14:34.238  1801  2059 I DeprecatedPowerHint: [PH] dai 1, 60, 0, 0
07-25 13:14:34.238  1801  2059 I LGE PowerHAL: ph_handle_starting_app_info::mode = 1 isgame=0  tuner_fps=60  ofvalue=0
07-25 13:14:34.239  1158  1230 D PowerManagerServiceEx: acquireWakeLockInternal: lock=14493292, flags=0x2000000a, tag="WindowManager", ws=WorkSource{10412}, historyTag=null, uid=1000, pid=1158
07-25 13:14:34.239   405   405 D MALI    : eglCreateImageKHR:513: [Crop] 0 0 0 0  img[720 1280] 
07-25 13:14:34.246  1158  1230 I chatty  : uid=1000(system) android.display expire 2 lines
07-25 13:14:34.250  1158  1230 D WindowManager: remove transit: 5
07-25 13:14:34.251  1158  1230 V WindowManager: Not removing Window{59a5bdb u0 Starting org.yourorg.cnfgtest EXITING} due to exit animation 
07-25 13:14:34.283 24717 24734 E Looper  : Invalid attempt to set NULL callback but not allowed for this looper.
07-25 13:14:34.287 24717 24734 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 24734 (Thread-3)
07-25 13:14:34.292  1801 24716 E MTKHandlerNative: [PH] perfServiceDisable handle 22
07-25 13:14:34.293  1801 24716 I libPerfService: 22: set max: -1, -1, 
07-25 13:14:34.293  1801 24716 I libPerfService: 22: set: -1, -1, 
07-25 13:14:34.294  1801 24716 I libPerfService: 22: set freq: -1, -1, 
07-25 13:14:34.294  1801 24716 I libPerfService: 22: set freq max: -1, -1, 
07-25 13:14:34.294 14941 15076 D skia    : --- SkAndroidCodec::NewFromStream returned null
07-25 13:14:34.295 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:34.299   715   715 D AEE_AED : $===AEE===AEE===AEE===$
07-25 13:14:34.299   715   715 D AEE_AED : p 2 poll events 1 revents 1
07-25 13:14:34.303   715   715 D AEE_AED : PPM cpu cores:8, online:7
07-25 13:14:34.304   715   715 D AEE_AED : aed_main_fork_worker: generator 0xaa18c6b8, worker 0xbec76924, recv_fd 0
07-25 13:14:34.310 24750 24750 I AEE_AED : handle_request(0)
07-25 13:14:34.313 24750 24750 I AEE_AED : check process 24717 name:ourorg.cnfgtest
07-25 13:14:34.313 24750 24750 I AEE_AED : tid 24734 abort msg address:0x00000000, si_code:1 (request from 24717:10412)
07-25 13:14:34.313 24750 24750 W AEE_AED : debuggerd: handling request: pid=24717 uid=10412 gid=10412 tid=24734
07-25 13:14:34.318 24750 24750 I AEE_AED : [preset_info] pid: 24717, tid: 24734, name: Thread-3  >>> org.yourorg.cnfgtest <<<
07-25 13:14:34.339  6243  6243 D wpa_supplicant: wlan0: Control interface command22 'SIGNAL_POLL'
07-25 13:14:34.339  6243  6243 D wpa_supplicant: wlan0: Control interface command 'SIGNAL_POLL'
07-25 13:14:34.364 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:34.432 24750 24750 D AEE_AED : debuggerd: drop privileges
07-25 13:14:34.488 24750 24750 I AEE_AED : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-25 13:14:34.489 24750 24750 I AEE_AED : Build fingerprint: 'lge/mcv3_lao_com/mcv3:7.1.2/N2G47H/192382341808a.F:user/release-keys'
07-25 13:14:34.489 24750 24750 I AEE_AED : Revision: '0'
07-25 13:14:34.490 24750 24750 I AEE_AED : ABI: 'arm'
07-25 13:14:34.490 24750 24750 I AEE_AED : pid: 24717, tid: 24734, name: Thread-3  >>> org.yourorg.cnfgtest <<<
07-25 13:14:34.490 24750 24750 I AEE_AED : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
07-25 13:14:34.490 24750 24750 I AEE_AED :     r0 00000000  r1 00000000  r2 00000002  r3 00000001
07-25 13:14:34.491 24750 24750 I AEE_AED :     r4 958fc1e0  r5 b2d71e89  r6 ab925d28  r7 000000a2
07-25 13:14:34.491 24750 24750 I AEE_AED :     r8 ab917ad0  r9 ab917a80  sl aacc3e60  fp aabbe7e0
07-25 13:14:34.491 24750 24750 I AEE_AED :     ip b2d96c1c  sp aabbe7b0  lr b2d787fd  pc b2d5e5fc  cpsr a0050030
07-25 13:14:34.495 24750 24750 I AEE_AED : 
07-25 13:14:34.495 24750 24750 I AEE_AED : backtrace:
07-25 13:14:34.495 24750 24750 I AEE_AED :     #00 pc 000355fc  /system/lib/libgui.so
07-25 13:14:34.495 24750 24750 I AEE_AED :     #01 pc 0004f7f9  /system/lib/libgui.so (_ZNK7android16SensorEventQueue12enableSensorEPKNS_6SensorE+12)
07-25 13:14:34.495 24750 24750 I AEE_AED :     #02 pc 00004570  /data/app/org.yourorg.cnfgtest-1/lib/arm/libcnfgtest.so
07-25 13:14:34.560 14941 15076 D skia    : --- SkAndroidCodec::NewFromStream returned null
07-25 13:14:34.562 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:34.641   669   669 E thermal_src: ERROR, recvmsg expect 5, but get 5 
07-25 13:14:34.655   405   405 I DisplayDevice: [Built-in Screen (type:0)] fps:46.381268,dur:1013.34,max:249.46,min:13.15
07-25 13:14:34.687 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:34.725 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:34.750  1542  1542 I SystemServicesProxy: RecentApps has 13 item(s).
07-25 13:14:34.767 14941 15076 D skia    : --- SkAndroidCodec::NewFromStream returned null
07-25 13:14:34.768 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:34.808 14941 15076 D skia    : --- SkAndroidCodec::NewFromStream returned null
07-25 13:14:34.809 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.002  1158  1233 I AutomaticBrightnessControllerEx: [MultiALC] lux = 39.0, time = 848164936
07-25 13:14:35.059 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.139 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.206   679   730 I GBMv2   : GBM state [10]
07-25 13:14:35.235 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.279  1158  1431 I chatty  : uid=1000(system) SensorService expire 4 lines
07-25 13:14:35.279  1158  1233 I AutomaticBrightnessControllerEx: [MultiALC] lux = 40.0, time = 848165213
07-25 13:14:35.305 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.306   679   730 I GBMv2   : GBM state [0]
07-25 13:14:35.335 14941 15076 D skia    : --- SkAndroidCodec::NewFromStream returned null
07-25 13:14:35.336 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.364 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.455 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.486 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.518 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.556  1158  1233 I AutomaticBrightnessControllerEx: [MultiALC] lux = 39.0, time = 848165489
07-25 13:14:35.621 14941 15076 D skia    : --- SkAndroidCodec::NewFromStream returned null
07-25 13:14:35.622 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.654 14941 15076 D skia    : --- SkAndroidCodec::NewFromStream returned null
07-25 13:14:35.655 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.720 14941 15076 D skia    : --- SkAndroidCodec::NewFromStream returned null
07-25 13:14:35.732 14941 15076 I XmpUtil : XMP parse: only JPEG file is supported
07-25 13:14:35.779 24750 24750 I AEE_AED : request.action: 0
07-25 13:14:35.785 24750 24750 V AEE_AED : dashboard_record_update() : rec->module = org.yourorg.cnfgtest 
07-25 13:14:35.785 24750 24750 D AEE_AED : Duplicated exception, cnt = 23 
07-25 13:14:35.785 24750 24750 D AEE_AED : Last exception time: 1595683710 
07-25 13:14:35.785 24750 24750 D AEE_AED : cur time: 1595693675 
07-25 13:14:35.786 24750 24750 D AEE_AED : Skip for Exp level'0'
07-25 13:14:35.787  1158  1227 I BootReceiver: Copying /data/tombstones/tombstone_09 to DropBox (SYSTEM_TOMBSTONE)
07-25 13:14:35.794   392   392 I wmt_launcher: fw log ctrl flag has been set
07-25 13:14:35.794   392   392 I wmt_launcher: fw dynamic ctrl flag has been set
07-25 13:14:35.796   715   715 D AEE_AED : clear ppm settings
07-25 13:14:35.797   715   715 D AEE_AED : $===AEE===AEE===AEE===$
07-25 13:14:35.801  1158 24751 W ActivityManager:   Force finishing activity org.yourorg.cnfgtest/android.app.NativeActivity
07-25 13:14:35.802  1158 24751 D ActivityManager: setTaskToReturnTo : TaskRecord{e6343fb #10377 A=org.yourorg.cnfgtest U=0 StackId=1 sz=1} / mTaskToReturnTo = 1
07-25 13:14:35.803  1158 24751 D ActivityManager: setTaskToReturnTo : TaskRecord{d3d7f30 #10376 A=com.discord U=0 StackId=1 sz=2} / mTaskToReturnTo = 0
07-25 13:14:35.804  1158  1227 W DropBoxManagerService: Dropping: SYSTEM_TOMBSTONE (10 > 0 bytes)
07-25 13:14:35.809  1158 24751 I chatty  : uid=1000 system_server expire 23 lines
07-25 13:14:35.829  1158 24752 W DropBoxManagerService: Dropping: data_app_native_crash (954 > 0 bytes)
07-25 13:14:35.829  1158 12221 I WindowManager: WIN DEATH: Window{5d5fda8 u0 org.yourorg.cnfgtest/android.app.NativeActivity}
EmmanuelMess commented 4 years ago

The issue seems to come from "SetupIMU();" in tests.c:main, fullscreen might also have something to do.

EmmanuelMess commented 4 years ago

Ok, the crash goes away if I delete both SetupIMU(); and AccCheck();.

EmmanuelMess commented 4 years ago

The issue seems to be that ASensorManager_getDefaultSensor( sm, ASENSOR_TYPE_GYROSCOPE ); returns NULL.