question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apk (kivy's example 3d rotation monkey)crashes on start

See original GitHub issue

Versions:

  • Python: python3
  • OS: Android
  • Kivy: v1.11.1
  • Kivy installation method: buildozer

On Linux(Ubuntu) and Windows 7 application works fine, but when I compile in apk and try to run on Android phone its crashes! Another app without shader(OpenGL2) works on android after compilation in apk, but this one don’t( Maybe the problem in shaider? How to configurate it? In buildozer.spec I add sgls, and obj extensions

This what adb logcat shows:

popo11-29 14:49:51.980 32376 32411 V PythonActivity: appConfirmedActive() -> preparing loading screen removal
11-29 14:49:51.980 32376 32411 V SDL     : nativeRunMain()
11-29 14:49:51.981 32376 32411 I python  : Initializing Python for Android
11-29 14:49:51.981 32376 32411 I python  : Setting additional env vars from p4a_env_vars.txt
11-29 14:49:51.981 32376 32411 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
11-29 14:49:51.981 32376 32411 I python  : /data/user/0/org.test.myapp/files/app
11-29 14:49:51.981 32376 32411 I python  : Preparing to initialize python
11-29 14:49:51.981 32376 32411 I python  : _python_bundle dir exists
11-29 14:49:51.981 32376 32411 I python  : calculated paths to be...
11-29 14:49:51.981 32376 32411 I python  : /data/user/0/org.test.myapp/files/app/_python_bundle/stdlib.zip:/data/user/0/org.test.myapp/files/app/_pyth
on_bundle/modules
11-29 14:49:51.982 32376 32411 I python  : set wchar paths...
11-29 14:49:51.984 32376 32406 I zygote  : android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
11-29 14:49:51.985 32376 32406 I OpenGLRenderer: Initialized EGL, version 1.4
11-29 14:49:51.985 32376 32406 D OpenGLRenderer: Swap behavior 2
11-29 14:49:52.005 32376 32406 D vndksupport: Loading /vendor/lib/hw/android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sp
hal namespace.
11-29 14:49:52.006 32376 32406 D vndksupport: Loading /vendor/lib/hw/gralloc.msm8953.so from current namespace instead of sphal namespace.
11-29 14:49:52.018 32376 32376 V SDL     : onWindowFocusChanged(): true
11-29 14:49:52.024  1589  1652 I ActivityManager: Displayed org.test.myapp/org.kivy.android.PythonActivity: +886ms
11-29 14:49:52.024  1589  1652 E ANDR-PERF-JNI: com_qualcomm_qtiperformance_native_perf_io_prefetch_start
11-29 14:49:52.025  3699  4041 D PowerKeeper.Event: notifyActivityLaunchTime: org.test.myapp/org.kivy.android.PythonActivity totalTime: 886
11-29 14:49:52.039 32376 32411 I python  : Initialized python
11-29 14:49:52.039 32376 32411 I python  : AND: Init threads
11-29 14:49:52.040 32376 32411 I python  : testing python print redirection
11-29 14:49:52.042 32376 32411 I python  : Android path ['.', '/data/user/0/org.test.myapp/files/app/_python_bundle/stdlib.zip', '/data/user/0/org.tes
t.myapp/files/app/_python_bundle/modules', '/data/user/0/org.test.myapp/files/app/_python_bundle/site-packages']
11-29 14:49:52.043 32376 32411 I python  : os.environ is environ({'PATH': '/sbin:/system/sbin:/system/bin:/system/xbin:/vendor/bin:/vendor/xbin', 'DOW
NLOAD_CACHE': '/data/cache', 'ANDROID_BOOTLOGO': '1', 'ANDROID_ROOT': '/system', 'ANDROID_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_ST
ORAGE': '/storage', 'EXTERNAL_STORAGE': '/sdcard', 'ASEC_MOUNTPOINT': '/mnt/asec', 'BOOTCLASSPATH': '/system/framework/com.qualcomm.qti.camera.jar:/sy
stem/framework/QPerformance.jar:/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okht
tp.jar:/system/framework/bouncycastle.jar:/system/framework/apache-xml.jar:/system/framework/legacy-test.jar:/system/framework/ext.jar:/system/framewo
rk/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/org.apach
e.http.legacy.boot.jar:/system/framework/android.hidl.base-V1.0-java.jar:/system/framework/android.hidl.manager-V1.0-java.jar:/system/framework/tcmifa
ce.jar:/system/framework/WfdCommon.jar:/system/framework/oem-services.jar:/system/framework/qcom.fmradio.jar:/system/framework/telephony-ext.jar:/syst
em/app/miui/miui.apk:/system/app/miuisystem/miuisystem.apk', 'SYSTEMSERVERCLASSPATH': '/system/framework/services.jar:/system/framework/ethernet-servi
ce.jar:/system/framework/wifi-service.jar:/system/framework/com.android.location.provider.jar', 'ANDROID_SOCKET_zygote_secondary': '10', 'ANDROID_ENTR
YPOINT': 'main.pyc', 'ANDROID_ARGUMENT': '/data/user/0/org.test.myapp/files/app', 'ANDROID_APP_PATH': '/data/user/0/org.test.myapp/files/app', 'ANDROI
D_PRIVATE': '/data/user/0/org.test.myapp/files', 'ANDROID_UNPACK': '/data/user/0/org.test.myapp/files/app', 'PYTHONHOME': '/data/user/0/org.test.myapp
/files/app', 'PYTHONPATH': '/data/user/0/org.test.myapp/files/app:/data/user/0/org.test.myapp/files/app/lib', 'PYTHONOPTIMIZE': '2', 'P4A_BOOTSTRAP':
'SDL2', 'PYTHON_NAME': 'python', 'P4A_IS_WINDOWED': 'True', 'P4A_ORIENTATION': 'landscape', 'P4A_NUMERIC_VERSION': 'None', 'P4A_MINSDK': '21', 'LC_CTY
PE': 'C.UTF-8'})
11-29 14:49:52.043 32376 32411 I python  : Android kivy bootstrap done. __name__ is __main__
11-29 14:49:52.043 32376 32411 I python  : AND: Ran string
11-29 14:49:52.043 32376 32411 I python  : Run user program, change dir and execute entrypoint
11-29 14:49:52.058  1589  2050 D ActivityTrigger: ActivityTrigger activityStopTrigger
11-29 14:49:52.243 32376 32411 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.test.myapp/files/app/.kivy/logs/kivy_19-11-29_2.txt

11-29 14:49:52.244 32376 32411 I python  : [INFO   ] [Kivy        ] v1.11.1
11-29 14:49:52.244 32376 32411 I python  : [INFO   ] [Kivy        ] Installed at "/data/user/0/org.test.myapp/files/app/_python_bundle/site-packages/k
ivy/__init__.pyc"
11-29 14:49:52.244 32376 32411 I python  : [INFO   ] [Python      ] v3.7.1 (default, Nov 28 2019, 23:47:24)
11-29 14:49:52.244 32376 32411 I python  : [Clang 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55
11-29 14:49:52.245 32376 32411 I python  : [INFO   ] [Python      ] Interpreter at "android_python"
11-29 14:49:52.431   816   847 D         : DpmQmiUtils::parseNfConnTrackFile: 0x7f97e6ed48
11-29 14:49:52.432   816   847 I chatty  : uid=1000(system) HwBinder:816_1 identical 16 lines
11-29 14:49:52.432   816   847 D         : DpmQmiUtils::parseNfConnTrackFile: 0x7f97e6ed48
11-29 14:49:52.436   816   847 D         : DpmDfsTracker::addDfsFilters: add 18 DFS filters
11-29 14:49:52.754  1907  1907 D KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED
11-29 14:49:52.755  2905  2905 I BatteryInfoReceiver: ACTION_BATTERY_CHANGED
11-29 14:49:52.755  3699  4127 D PowerCheckerService: onBatteryChanged, mBatteryLevel = 53, status = 2, level = 53, plug = 2
11-29 14:49:52.755  1907  1907 D KeyguardUpdateMonitor: handleBatteryUpdate
11-29 14:49:53.274 32376 32411 I python  : [INFO   ] [Factory     ] 184 symbols loaded
11-29 14:49:53.763  1589  1652 I zygote64: Explicit concurrent copying GC freed 94803(6MB) AllocSpace objects, 78(2MB) LOS objects, 42% free, 25MB/45M
B, paused 152us total 330.110ms
11-29 14:49:53.854 32376 32411 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
11-29 14:49:53.963 32376 32411 I python  : [INFO   ] [Window      ] Provider: sdl2
11-29 14:49:53.995 32376 32411 E libEGL  : validate_display:92 error 3008 (EGL_BAD_DISPLAY)
11-29 14:49:53.995 32376 32411 V SDL     : setOrientation() orientation=-1 width=800 height=600 resizable=true hint=
11-29 14:49:54.002 32376 32411 I python  : [INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
11-29 14:49:54.005 32376 32411 I python  : [INFO   ] [GL          ] Backend used <sdl2>
11-29 14:49:54.006 32376 32411 I python  : [INFO   ] [GL          ] OpenGL version <b'OpenGL ES 3.2 V@269.0 (GIT@8e3df98, Ie4790512f3) (Date:04/11/18)
'>
11-29 14:49:54.006 32376 32411 I python  : [INFO   ] [GL          ] OpenGL vendor <b'Qualcomm'>
11-29 14:49:54.007 32376 32411 I python  : [INFO   ] [GL          ] OpenGL renderer <b'Adreno (TM) 506'>
11-29 14:49:54.007 32376 32411 I python  : [INFO   ] [GL          ] OpenGL parsed version: 3, 2
11-29 14:49:54.008 32376 32411 I python  : [INFO   ] [GL          ] Texture max size <16384>
11-29 14:49:54.009 32376 32411 I python  : [INFO   ] [GL          ] Texture max units <16>
11-29 14:49:54.043 32376 32411 I python  : [INFO   ] [Window      ] auto add sdl2 input provider
11-29 14:49:54.045 32376 32411 I python  : [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
11-29 14:49:54.052 32376 32411 I python  : [INFO   ] [Shader      ] Read </data/data/org.test.myapp/files/app/simple.glsl>
11-29 14:49:54.391 32376 32411 I python  : [WARNING] [Base        ] Unknown <android> provider
11-29 14:49:54.391 32376 32411 I python  : [INFO   ] [Base        ] Start application main loop
11-29 14:49:54.402 32376 32411 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x34 in tid 32411 (SDLThread), pid 32376 (org.test.myapp)
11-29 14:49:54.422 32376 32392 I zygote  : Do partial code cache collection, code=30KB, data=22KB
11-29 14:49:54.423 32376 32392 I zygote  : After code cache collection, code=30KB, data=22KB
11-29 14:49:54.423 32376 32392 I zygote  : Increasing code cache capacity to 128KB
11-29 14:49:54.491 32417 32417 W crash_dump32: type=1400 audit(0.0:1261): avc: denied { search } for name="org.test.myapp" dev="dm-1" ino=415598 scont
ext=u:r:crash_dump:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
11-29 14:49:54.501 32417 32417 I chatty  : uid=10140(org.test.myapp) crash_dump32 identical 18 lines
11-29 14:49:54.501 32417 32417 W crash_dump32: type=1400 audit(0.0:1280): avc: denied { search } for name="org.test.myapp" dev="dm-1" ino=415598 scont
ext=u:r:crash_dump:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
11-29 14:49:54.533 32417 32417 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
11-29 14:49:54.534   927   927 I /system/bin/tombstoned: received crash request for pid 32376
11-29 14:49:54.535 32417 32417 I crash_dump32: performing dump of process 32376 (target tid = 32411)
11-29 14:49:54.536 32417 32417 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-29 14:49:54.536 32417 32417 F DEBUG   : Build fingerprint: 'xiaomi/vince/vince:8.1.0/OPM1.171019.019/V10.0.4.0.OEGMIFH:user/release-keys'
11-29 14:49:54.536 32417 32417 F DEBUG   : Revision: '0'
11-29 14:49:54.536 32417 32417 F DEBUG   : ABI: 'arm'
11-29 14:49:54.536 32417 32417 F DEBUG   : pid: 32376, tid: 32411, name: SDLThread  >>> org.test.myapp <<<
11-29 14:49:54.536 32417 32417 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
11-29 14:49:54.536 32417 32417 F DEBUG   : Cause: null pointer dereference
11-29 14:49:54.536 32417 32417 F DEBUG   :     r0 00000001  r1 00000034  r2 d1fac600  r3 00000001
11-29 14:49:54.536 32417 32417 F DEBUG   :     r4 d1f97d80  r5 00000000  r6 00000000  r7 d1fac600
11-29 14:49:54.536 32417 32417 F DEBUG   :     r8 d1fac654  r9 00008be7  sl 0000002c  fp d1fac654
11-29 14:49:54.536 32417 32417 F DEBUG   :     ip df979065  sp d2b3fd70  lr dfc0cf4b  pc dfc0d200  cpsr 000f0030
11-29 14:49:54.561 32417 32417 F DEBUG   :
11-29 14:49:54.561 32417 32417 F DEBUG   : backtrace:
11-29 14:49:54.561 32417 32417 F DEBUG   :     #00 pc 00392200  /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::DrawParamValidate(unsigned int
, int, int, int, int)+831)
11-29 14:49:54.561 32417 32417 F DEBUG   :     #01 pc 000fe0b9  /system/vendor/lib/egl/libGLESv2_adreno.so (EsxGlApiParamValidate::GlDrawElements(EsxD
ispatch*, unsigned int, int, unsigned int, void const*)+84)
11-29 14:49:54.561 32417 32417 F DEBUG   :     #02 pc 0009e401  /system/vendor/lib/egl/libGLESv2_adreno.so (glDrawElements+40)
11-29 14:49:54.561 32417 32417 F DEBUG   :     #03 pc 000081ff  /data/data/org.test.myapp/files/app/_python_bundle/site-packages/kivy/graphics/vbo.so

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
AndiEckercommented, Feb 8, 2021

Wrote a glsl tester app - tested on Linux and Android.

While playing with shaders I experienced that even simple shaders that run fine on Linux are crashing on Android in vbo.so (w/o any python traceback) if the texture did not get fetched within the pixel/fragment shader.

So the good news is that I got all of them running by adding the following statement into the shader code::

vec4 tex = texture2D(texture0, tex_coord0);

So even if you do not use the texture in your shader it seems that you have to fetch it at least to prevent the vbo.so crash.

0reactions
humanusacommented, Sep 10, 2022

Wrote a glsl tester app - tested on Linux and Android.

While playing with shaders I experienced that even simple shaders that run fine on Linux are crashing on Android in vbo.so (w/o any python traceback) if the texture did not get fetched within the pixel/fragment shader.

So the good news is that I got all of them running by adding the following statement into the shader code::

vec4 tex = texture2D(texture0, tex_coord0);

So even if you do not use the texture in your shader it seems that you have to fetch it at least to prevent the vbo.so crash.

Can you tell in which module - need to add this line of the rotating monkey code ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kivy's 3D rendering (monkey rotation) apk crashes on start
I took Kivy's example 3D Rendering (rotation monkey head) app, on Linux(Ubuntu) and Windows 7 application works fine, (run it from python ......
Read more >
Gallery of Examples — Kivy 2.1.0 documentation
Gallery of Examples. Gallery · 3D Rotating Monkey Head · Widget animation · Suite of Application Builders · Application example using build() +...
Read more >
Graphics — Kivy 2.1.0 documentation
Starting from 1.2.0, we have introduced a mechanism for reloading all the graphics resources using the GPU: Canvas, FBO, Shader, Texture, VBO, ...
Read more >
Create a package for Android — Kivy 2.1.0 documentation
This page explains how to download and use it directly on your own machine (see Packaging your application into APK or AAB) or...
Read more >
Application — Kivy 2.1.0 documentation
To initialize your app with a widget tree, override the build() method in your app class and return the widget tree you constructed....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found