Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when my Python program starts to load #1299

Closed
om26er opened this issue Jun 13, 2018 · 4 comments
Closed

Crash when my Python program starts to load #1299

om26er opened this issue Jun 13, 2018 · 4 comments

Comments

@om26er
Copy link
Contributor

om26er commented Jun 13, 2018

I have been trying to fix the dependencies for Crossbar to run Android and today I hit a point where I am no longer seeing errors/crashes from the Python side. (I fixed/worked around recipes).

Though now the crash comes from the C side and I am not sure what causes that as the stacktrace looks useless, is there a way to get a more useful stacktrace ?

06-13 06:26:17.328 6500-6521/com.om26er.test I/python: world <kivy.uix.label.Label object at 0xcbc8cfb8>
06-13 06:26:18.628 6500-6521/com.om26er.test I/python: [INFO   ] [Base        ] Leaving application in progress...
    INFO:kivy:[Base        ] Leaving application in progress...
    [INFO   ] [Support     ] Shutting down twisted reactor
06-13 06:26:18.629 6500-6521/com.om26er.test I/python: INFO:kivy:[Support     ] Shutting down twisted reactor
06-13 06:26:18.851 6500-6521/com.om26er.test I/python: Python for android ended.
06-13 06:26:18.860 1528-3565/? D/ActivityTrigger: ActivityTrigger activityPauseTrigger 
06-13 06:26:18.861 6500-6500/com.om26er.test V/SDL: onWindowFocusChanged(): false
06-13 06:26:18.862 6500-6500/com.om26er.test V/PythonActivity: onPause()
06-13 06:26:18.862 6500-6500/com.om26er.test V/SDL: onPause()
    nativePause()
06-13 06:26:18.862 6500-6500/com.om26er.test A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 6500 (com.om26er.test)
06-13 06:26:18.864 1528-5911/? I/OpenGLRenderer: Initialized EGL, version 1.4
06-13 06:26:18.864 1528-5911/? D/OpenGLRenderer: Swap behavior 2
06-13 06:26:18.896 6586-6586/? W/crash_dump32: type=1400 audit(0.0:675): avc: denied { search } for name="com.om26er.test" dev="sda17" ino=1474561 scontext=u:r:crash_dump:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
06-13 06:26:18.933 6586-6586/? I/crash_dump32: obtaining output fd from tombstoned
06-13 06:26:18.934 954-954/? I//system/bin/tombstoned: received crash request for pid 6500
06-13 06:26:18.935 6586-6586/? I/crash_dump32: performing dump of process 6500 (target tid = 6500)
06-13 06:26:18.936 6586-6586/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build fingerprint: 'Xiaomi/chiron/chiron:8.0.0/OPR1.170623.027/V9.5.8.0.ODEMIFA:user/release-keys'
    Revision: '0'
    ABI: 'arm'
    pid: 6500, tid: 6500, name: com.om26er.test  >>> com.om26er.test <<<
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    Cause: null pointer dereference
        r0 00000000  r1 00000001  r2 ffffffff  r3 ffffffff
        r4 00000000  r5 ffffffff  r6 00000000  r7 ec1ed1c8
        r8 ffffffff  r9 00000000  sl ff99d3e8  fp ff99d504
        ip cdb3dc94  sp ff99d2d0  lr cd980e41  pc ec177340  cpsr a00f0030
06-13 06:26:18.938 6586-6586/? A/DEBUG: backtrace:
        #00 pc 00021340  /system/lib/libc.so (sem_wait+11)
        #01 pc 0006be3d  /data/app/com.om26er.test-TsHaEKzB-lUZgUA_YkOGbA==/lib/arm/libpython3.6m.so (PyThread_acquire_lock_timed+140)
        #02 pc 0006bee9  /data/app/com.om26er.test-TsHaEKzB-lUZgUA_YkOGbA==/lib/arm/libpython3.6m.so (PyThread_acquire_lock+20)
        #03 pc 000592a7  /data/app/com.om26er.test-TsHaEKzB-lUZgUA_YkOGbA==/lib/arm/libpython3.6m.so
06-13 06:26:18.939 6586-6586/? A/DEBUG:     #04 pc 00059ba3  /data/app/com.om26er.test-TsHaEKzB-lUZgUA_YkOGbA==/lib/arm/libpython3.6m.so (PyGILState_Ensure+26)
        #05 pc 0000302b  /data/data/com.om26er.test/files/app/crystax_python/site-packages/kivy/core/window/_window_sdl2.so
06-13 06:26:19.275 1528-1607/? I/BootReceiver: Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
06-13 06:26:19.277 2479-2523/? I/octvm_klo: summary:[signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    ]
    summary: [/system/lib/libc.so (sem_wait+11)]
    summary: [/data/app/com.om26er.test-TsHaEKzB-lUZgUA_YkOGbA==/lib/arm/libpython3.6m.so (PyThread_acquire_lock_timed+140)]
    start gathering logcat log...
06-13 06:26:19.280 2479-2523/? I/octvm_klo: gethering logcat log done
    klo unlock
06-13 06:26:19.293 775-775/? E/lowmemorykiller: Error writing /proc/6500/oom_score_adj; errno=22
06-13 06:26:19.310 1528-1827/? W/InputDispatcher: channel 'd27c2ea com.om26er.test/org.kivy.android.PythonActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
06-13 06:26:19.310 1528-1827/? E/InputDispatcher: channel 'd27c2ea com.om26er.test/org.kivy.android.PythonActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
06-13 06:26:19.311 776-2389/? E/SurfaceFlinger: Failed to find layer (SurfaceView - com.om26er.test/org.kivy.android.PythonActivity#0) in layer parent (no-parent).
06-13 06:26:19.311 776-843/? E/SurfaceFlinger: Failed to find layer (Background for - SurfaceView - com.om26er.test/org.kivy.android.PythonActivity#0) in layer parent (no-parent).
06-13 06:26:19.312 1528-2109/? I/WindowManager: WIN DEATH: Window{d27c2ea u0 com.om26er.test/org.kivy.android.PythonActivity}
06-13 06:26:19.312 1528-2109/? W/InputDispatcher: Attempted to unregister already unregistered input channel 'd27c2ea com.om26er.test/org.kivy.android.PythonActivity (server)'
06-13 06:26:19.312 618-618/? I/Zygote: Process 6500 exited due to signal (11)
06-13 06:26:19.314 1528-1559/? D/CompatibilityInfo: mCompatibilityFlags - 10
    applicationDensity - 440
    applicationScale - 1.0
06-13 06:26:19.315 1528-1916/? I/ActivityManager: Process com.om26er.test (pid 6500) has died: vis  +99TOP 
@AndreMiras
Copy link
Member

Clearly trying to access a ptr = null (Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 6500 (com.om26er.test)).
But still that can be a pain to debug. I would recommend you to try to compile with debug symbols and enable core dumps.
Also try to make to reproduce with the simplest case reducing the crash demo code to the minimum and share it. Doing so may also help you to find the issue yourself.
Good luck! 🤞

@om26er
Copy link
Contributor Author

om26er commented Jun 20, 2018

But still that can be a pain to debug. I would recommend you to try to compile with debug symbols and enable core dumps.

How to do that in Android/P4A world ? :-)

@AndreMiras
Copy link
Member

Ahah indeed for the core dump on Android that's a good question.
But for the debug symbols I would add the -g or other compiler flags you need in the recipe compilation environment. Also killing the NDEBUG preprocessor flag could be a plus.

@AndreMiras
Copy link
Member

We're dropping crystax support, so we invite you to try again with the pure python3 recipe.
Please reopen if you still have the issue with python3 (no crystax).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants