Android GC Error: Uncaught exception: Null access

Open
#589 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, c

Research direction

Start with the linked HashLink issue comment and the supplied Android log, then inspect the reported entry points zygame/core/Start.hx:39, zygame/core/Start.hx:91, zygame/core/Start.hx:121, and MainScene.hx:62. Done means identifying the cause of the Android Null access and confirming that the example starts without the exception.

Written by the indexing model from the issue text.

Description

See : https://github.com/HaxeFoundation/hashlink/issues/586#issuecomment-1454689560

2023-03-04 21:07:46.193 6382-6382/com.example.heapsandroid.helloworld W/re-initialized>: type=1400 audit(0.0:53): avc: granted { execute } for path="/data/data/com.example.heapsandroid.helloworld/code_cache/startup_agents/fafda4ce-agent.so" dev="dm-29" ino=8007 scontext=u:r:untrusted_app:s0:c150,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c150,c256,c512,c768 tclass=file app=com.example.heapsandroid.helloworld
2023-03-04 21:07:46.195 6382-6382/com.example.heapsandroid.helloworld V/studio.deploy: Startup agent attached to VM
2023-03-04 21:07:46.195 6382-6382/com.example.heapsandroid.helloworld V/studio.deploy: No existing instrumentation found. Loading instrumentation from instruments-2ca9b3e0.jar
2023-03-04 21:07:46.197 6382-6382/com.example.heapsandroid.helloworld W/roid.helloworl: DexFile /data/data/com.example.heapsandroid.helloworld/code_cache/.studio/instruments-2ca9b3e0.jar is in boot class path but is not in a known location
2023-03-04 21:07:46.142 6382-6382/? I/roid.helloworl: Late-enabling -Xcheck:jni
2023-03-04 21:07:46.198 6382-6382/com.example.heapsandroid.helloworld V/studio.deploy: Applying transforms with cached classes
2023-03-04 21:07:46.203 6382-6382/com.example.heapsandroid.helloworld W/roid.helloworl: Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled.
2023-03-04 21:07:46.203 6382-6382/com.example.heapsandroid.helloworld W/roid.helloworl: Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled.
2023-03-04 21:07:46.207 6382-6382/com.example.heapsandroid.helloworld D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10150; state: ENABLED
2023-03-04 21:07:46.297 6382-6382/com.example.heapsandroid.helloworld V/GraphicsEnvironment: ANGLE Developer option for 'com.example.heapsandroid.helloworld' set to: 'default'
2023-03-04 21:07:46.297 6382-6382/com.example.heapsandroid.helloworld V/GraphicsEnvironment: ANGLE GameManagerService for com.example.heapsandroid.helloworld: false
2023-03-04 21:07:46.297 6382-6382/com.example.heapsandroid.helloworld V/GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
2023-03-04 21:07:46.299 6382-6382/com.example.heapsandroid.helloworld D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2023-03-04 21:07:46.299 6382-6382/com.example.heapsandroid.helloworld D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2023-03-04 21:07:46.305 6382-6408/com.example.heapsandroid.helloworld D/libEGL: loaded /vendor/lib64/egl/libEGL_emulation.so
2023-03-04 21:07:46.306 6382-6408/com.example.heapsandroid.helloworld D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2023-03-04 21:07:46.308 6382-6408/com.example.heapsandroid.helloworld D/libEGL: loaded /vendor/lib64/egl/libGLESv2_emulation.so
2023-03-04 21:07:46.317 6382-6382/com.example.heapsandroid.helloworld V/SDL: Device: emulator64_arm64
2023-03-04 21:07:46.318 6382-6382/com.example.heapsandroid.helloworld V/SDL: Model: sdk_gphone64_arm64
2023-03-04 21:07:46.318 6382-6382/com.example.heapsandroid.helloworld V/SDL: onCreate()
2023-03-04 21:07:46.322 6382-6382/com.example.heapsandroid.helloworld V/SDL: nativeSetupJNI()
2023-03-04 21:07:46.323 6382-6382/com.example.heapsandroid.helloworld V/SDL: AUDIO nativeSetupJNI()
2023-03-04 21:07:46.324 6382-6382/com.example.heapsandroid.helloworld V/SDL: CONTROLLER nativeSetupJNI()
2023-03-04 21:07:46.334 6382-6382/com.example.heapsandroid.helloworld V/JNI: initAssets
2023-03-04 21:07:46.335 6382-6382/com.example.heapsandroid.helloworld V/SDL: onResume()
2023-03-04 21:07:46.360 6382-6406/com.example.heapsandroid.helloworld D/HostConnection: createUnique: call
2023-03-04 21:07:46.361 6382-6406/com.example.heapsandroid.helloworld D/HostConnection: HostConnection::get() New Host Connection established 0xb400006f2b00eb90, tid 6406
2023-03-04 21:07:46.363 6382-6406/com.example.heapsandroid.helloworld D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
2023-03-04 21:07:46.364 6382-6382/com.example.heapsandroid.helloworld V/SDL: surfaceCreated()
2023-03-04 21:07:46.364 6382-6382/com.example.heapsandroid.helloworld V/SDL: surfaceChanged()
2023-03-04 21:07:46.364 6382-6382/com.example.heapsandroid.helloworld V/SDL: pixel format RGB_565
2023-03-04 21:07:46.365 6382-6382/com.example.heapsandroid.helloworld V/SDL: Window size: 1440x2904
2023-03-04 21:07:46.365 6382-6406/com.example.heapsandroid.helloworld W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2023-03-04 21:07:46.366 6382-6406/com.example.heapsandroid.helloworld W/OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_SUCCESS
2023-03-04 21:07:46.366 6382-6406/com.example.heapsandroid.helloworld D/EGL_emulation: eglCreateContext: 0xb400006f2b00fcd0: maj 3 min 0 rcv 3
2023-03-04 21:07:46.367 6382-6406/com.example.heapsandroid.helloworld D/EGL_emulation: eglMakeCurrent: 0xb400006f2b00fcd0: ver 3 0 (tinfo 0x713c0b7080) (first time)
2023-03-04 21:07:46.367 6382-6382/com.example.heapsandroid.helloworld V/SDL: nativeResume()
2023-03-04 21:07:46.367 6382-6409/com.example.heapsandroid.helloworld V/SDL: Running main function main from library libheapsapp.so
2023-03-04 21:07:46.368 6382-6409/com.example.heapsandroid.helloworld V/SDL: nativeRunMain()
2023-03-04 21:07:46.376 6382-6406/com.example.heapsandroid.helloworld I/Gralloc4: mapper 4.x is not supported
2023-03-04 21:07:46.376 6382-6406/com.example.heapsandroid.helloworld D/HostConnection: createUnique: call
2023-03-04 21:07:46.377 6382-6406/com.example.heapsandroid.helloworld D/HostConnection: HostConnection::get() New Host Connection established 0xb400006f2b011710, tid 6406
2023-03-04 21:07:46.377 6382-6406/com.example.heapsandroid.helloworld D/goldfish-address-space: allocate: Ask for block of size 0x100
2023-03-04 21:07:46.377 6382-6406/com.example.heapsandroid.helloworld D/goldfish-address-space: allocate: ioctl allocate returned offset 0x1ebff8000 size 0x8000
2023-03-04 21:07:46.378 6382-6406/com.example.heapsandroid.helloworld W/Gralloc4: allocator 4.x is not supported
2023-03-04 21:07:46.381 6382-6406/com.example.heapsandroid.helloworld D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
2023-03-04 21:07:46.382 6382-6409/com.example.heapsandroid.helloworld D/hl: zygame/core/Start.hx:39: Start.initApp
2023-03-04 21:07:46.382 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.390 6382-6409/com.example.heapsandroid.helloworld E/libEGL: validate_display:537 error 3008 (EGL_BAD_DISPLAY)
2023-03-04 21:07:46.390 6382-6409/com.example.heapsandroid.helloworld V/SDL: setOrientation() orientation=-1 width=800 height=600 resizable=true hint=
2023-03-04 21:07:46.390 6382-6409/com.example.heapsandroid.helloworld D/HostConnection: createUnique: call
2023-03-04 21:07:46.391 6382-6409/com.example.heapsandroid.helloworld D/HostConnection: HostConnection::get() New Host Connection established 0xb400006f2b011050, tid 6409
2023-03-04 21:07:46.395 6382-6409/com.example.heapsandroid.helloworld D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
2023-03-04 21:07:46.408 6382-6409/com.example.heapsandroid.helloworld D/EGL_emulation: eglCreateContext: 0xb400006f2b0117d0: maj 3 min 0 rcv 3
2023-03-04 21:07:46.412 6382-6409/com.example.heapsandroid.helloworld D/EGL_emulation: eglMakeCurrent: 0xb400006f2b0117d0: ver 3 0 (tinfo 0x713c0b7100) (first time)
2023-03-04 21:07:46.415 6382-6409/com.example.heapsandroid.helloworld E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glEnable:4894 GL error 0x500 condition [!GLESv2Validation::allowedEnable(ctx->majorVersion(), ctx->minorVersion(), what)]
2023-03-04 21:07:46.425 6382-6409/com.example.heapsandroid.helloworld E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glRenderbufferStorage:2953 GL error 0x500 condition [!GLESv2Validation::rboFormat(ctx, internalformat)]
2023-03-04 21:07:46.429 6382-6409/com.example.heapsandroid.helloworld D/hl: zygame/core/Start.hx:91: Hashlink version:, 1.12.0
2023-03-04 21:07:46.429 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.437 6382-6382/com.example.heapsandroid.helloworld V/SDL: onWindowFocusChanged(): true
2023-03-04 21:07:46.445 6382-6409/com.example.heapsandroid.helloworld D/hl: zygame/core/Start.hx:121: Start.initScale=1.333333
2023-03-04 21:07:46.445 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.445 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.445 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.446 6382-6414/com.example.heapsandroid.helloworld D/hl: Uncaught exception: Null access
2023-03-04 21:07:46.446 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.446 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.446 6382-6415/com.example.heapsandroid.helloworld D/hl: Uncaught exception: Null access
2023-03-04 21:07:46.447 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.447 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.447 6382-6416/com.example.heapsandroid.helloworld D/hl: Uncaught exception: Null access
2023-03-04 21:07:46.447 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.447 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.447 6382-6417/com.example.heapsandroid.helloworld D/hl: Uncaught exception: Null access
2023-03-04 21:07:46.448 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.448 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.448 6382-6418/com.example.heapsandroid.helloworld D/hl: Uncaught exception: Null access
2023-03-04 21:07:46.448 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.448 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.448 6382-6419/com.example.heapsandroid.helloworld D/hl: Uncaught exception: Null access
2023-03-04 21:07:46.448 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.448 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.450 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.450 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.450 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.450 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.451 6382-6422/com.example.heapsandroid.helloworld D/hl: Uncaught exception: Null access
2023-03-04 21:07:46.451 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0
2023-03-04 21:07:46.451 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.451 6382-6409/com.example.heapsandroid.helloworld D/hl: MainScene.hx:62: loading, 0.111111111111111
2023-03-04 21:07:46.451 6382-6409/com.example.heapsandroid.helloworld D/hl: 
2023-03-04 21:07:46.452 6382-6423/com.example.heapsandroid.helloworld D/hl: Uncaught exception: Null access
2023-03-04 21:07:48.168 6382-6394/com.example.heapsandroid.helloworld W/System: A resource failed to call close. 

I define GC_DEBUG to get log Uncaught exception: Null access.

Dominant language
C
Stars
911
Forks
207
Avg merge
1d 21h
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HaxeFoundation/hashlink

All issues in HaxeFoundation/hashlink

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.