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

Tons of different PySDL2 crashes when tabbing in/out of application during loading or right after it finished #1321

Closed
ghost opened this issue Aug 7, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 7, 2018

Testing around, my PySDL2 app crashed (I think it was when I tabbed out with the home button):

08-07 06:45:31.743  1770  1770 V pythonutil: Checking pattern libcrypto.*\.so against libpython3.5m.so
08-07 06:45:31.743  1770  1770 V pythonutil: Loading library: crystax
08-07 06:45:31.752  1770  1770 V pythonutil: Loading library: SDL2
08-07 06:45:31.800  1770  1770 V pythonutil: Loading library: SDL2_image
08-07 06:45:31.803  1770  1770 V pythonutil: Loading library: SDL2_mixer
08-07 06:45:31.805  1770  1770 V pythonutil: Loading library: SDL2_ttf
08-07 06:45:31.807  1770  1770 V pythonutil: Loading library: python2.7
08-07 06:45:31.817  1770  1770 V pythonutil: Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/base.apk"],nativeLibraryDirectories=[/mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm, /system/fake-libs, /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "libpython2.7.so"
08-07 06:45:31.817  1770  1770 V pythonutil: Loading library: python3.5m
08-07 06:45:31.822  1770  1770 V pythonutil: Loading library: main
08-07 06:45:31.826  1770  1770 V pythonutil: Failed to load _io.so or unicodedata.so...but that's okay.
08-07 06:45:31.827  1770  1770 V pythonutil: Unsatisfied linker when loading ctypes
08-07 06:45:31.827  1770  1770 V pythonutil: Loaded everything!
08-07 06:45:31.912  1770  1770 V PythonActivity: Setting env vars for start.c and Python to use
08-07 06:45:31.914  1770  1770 V PythonActivity: Access to our meta-data...
08-07 06:45:31.917  1770  1770 I PythonActivity: Surface will NOT be transparent
08-07 06:45:31.955  1802  1816 I ActivityManager: Killing 29503:at.bitfire.davdroid/u0a73 (adj 906): empty #17
08-07 06:45:31.967  1770  1770 V SDL     : onDestroy()
08-07 06:45:31.975  1802  5506 D ActivityManager: cleanUpApplicationRecord -- 29503
08-07 06:45:31.979  1770  1770 I art     : System.exit called, status: 0
08-07 06:45:31.980  1770  1770 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.
08-07 06:45:31.999  1802  1932 I ActivityManager: Process org.example.myapp (pid 1770) has died
08-07 06:45:31.999  1802  1932 D ActivityManager: cleanUpApplicationRecord -- 1770
08-07 06:45:32.000  1802  2645 D GraphicsStats: Buffer count: 8
08-07 06:45:32.000  1802  1860 W InputDispatcher: channel '15c8af1 org.example.myapp/org.kivy.android.PythonActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
08-07 06:45:32.000  1802  1860 E InputDispatcher: channel '15c8af1 org.example.myapp/org.kivy.android.PythonActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
08-07 06:45:32.005  1802 15925 I WindowManager: WIN DEATH: Window{15c8af1 u0 org.example.myapp/org.kivy.android.PythonActivity}
08-07 06:45:32.005  1802 15925 W InputDispatcher: Attempted to unregister already unregistered input channel '15c8af1 org.example.myapp/org.kivy.android.PythonActivity (server)'
08-07 06:45:32.005  1802 15925 W WindowManager: Force-removing child win Window{31bbf6a u0 SurfaceView - org.example.myapp/org.kivy.android.PythonActivity} from container Window{15c8af1 u0 org.example.myapp/org.kivy.android.PythonActivity}
08-07 06:45:32.052  1802  1813 W WindowManager: Failed looking up window
08-07 06:45:32.052  1802  1813 W WindowManager: java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@eba7955 does not exist
08-07 06:45:32.052  1802  1813 W WindowManager: 	at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9469)
08-07 06:45:32.052  1802  1813 W WindowManager: 	at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9460)
08-07 06:45:32.052  1802  1813 W WindowManager: 	at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1807)
08-07 06:45:32.052  1802  1813 W WindowManager: 	at android.os.BinderProxy.sendDeathNotice(Binder.java:688)
08-07 06:45:32.052  1802  1813 I WindowManager: WIN DEATH: null
08-07 06:45:32.408  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 06:45:33.409  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 06:45:33.816  1802 15917 I ActivityManager: Setting hasTopUi=true for pid=1916
08-07 06:45:33.818  1916  1916 D PhoneStatusBar: disable: < expand ICONS* alerts SYSTEM_INFO* back home recent clock search quick_settings >
08-07 06:45:34.408  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 06:45:35.408  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 06:45:36.410  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 06:45:37.408  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 06:45:38.410  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 06:45:39.408  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 06:45:40.408  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 06:45:40.531  1802  1816 I ActivityManager: Waited long enough for: ServiceRecord{6066274 u0 com.fsck.k9/.service.PollService}
08-07 06:45:41.408  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0

@ghost
Copy link
Author

ghost commented Aug 7, 2018

Another one when tabbing out before loading finished:

08-07 09:30:44.544  1802  1816 I ActivityManager: Killing 2730:net.etuldan.sparss.floss/u0a94 (adj 906): empty for 6199s
08-07 09:30:44.565  1802 15925 D ActivityManager: cleanUpApplicationRecord -- 2730
08-07 09:30:44.778  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:45.778  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:46.021  1802  1860 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.cyanogenmod.trebuchet/com.android.launcher3.Launcher (has extras)} from uid 1000 on display 0
08-07 09:30:46.030  4473  4473 V SDL     : onWindowFocusChanged(): false
08-07 09:30:46.032  4473  4473 V PythonActivity: onPause()
08-07 09:30:46.032  4473  4473 V SDL     : onPause()
08-07 09:30:46.173  1802  1932 I ActivityManager: Killing 2835:com.android.cellbroadcastreceiver/u0a9 (adj 906): empty for 6197s
08-07 09:30:46.195  1802  1814 D ActivityManager: cleanUpApplicationRecord -- 2835
08-07 09:30:46.351  1802  1812 I art     : Background partial concurrent mark sweep GC freed 40097(2MB) AllocSpace objects, 6(120KB) LOS objects, 33% free, 11MB/17MB, paused 2.197ms total 301.052ms
08-07 09:30:46.669 28897  1115 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
08-07 09:30:46.669 28897  1115 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
08-07 09:30:46.778  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:47.778  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:48.164  1667  4450 D InstalledAppProviderSer: insertAppIntoDb org.example.myapp
08-07 09:30:48.373  1802  1816 I ProcessStatsService: Prepared write state in 2ms
08-07 09:30:48.778  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:49.779  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:50.778  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:51.000  1436  1475 I ThermalDaemon: Sensor 'tsens_tz_sensor0' - alarm cleared 1 at 47.0 degC
08-07 09:30:51.158  4473  4489 I art     : Waiting for a blocking GC DisableMovingGc
08-07 09:30:51.177  4473  4489 I art     : WaitForGcToComplete blocked for 18.495ms for cause DisableMovingGc
08-07 09:30:51.177  4473  4489 I art     : Starting a blocking GC DisableMovingGc
08-07 09:30:51.778  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:52.778  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:53.086  1436  1475 I ThermalDaemon: Sensor 'tsens_tz_sensor0' - alarm raised 1 at 52.0 degC
08-07 09:30:53.539  1802  1813 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.example.myapp/org.kivy.android.PythonActivity (has extras)} from uid 10030 on display 0
08-07 09:30:53.584  4473  4473 V PythonActivity: My oncreate running
08-07 09:30:53.584  4473  4473 V PythonActivity: About to do super onCreate
08-07 09:30:53.584  4473  4473 V SDL     : Device: serranoltexx
08-07 09:30:53.584  4473  4473 V SDL     : Model: GT-I9195
08-07 09:30:53.586  4473  4473 V SDL     : onCreate():org.kivy.android.PythonActivity@479a39b
08-07 09:30:53.586  4473  4473 V PythonActivity: Did super onCreate
08-07 09:30:53.603  4473  4473 D AndroidRuntime: Shutting down VM
08-07 09:30:53.646  4473  4473 E AndroidRuntime: FATAL EXCEPTION: main
08-07 09:30:53.646  4473  4473 E AndroidRuntime: Process: org.example.myapp, PID: 4473
08-07 09:30:53.646  4473  4473 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.example.myapp/org.kivy.android.PythonActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2684)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2751)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.app.ActivityThread.-wrap12(ActivityThread.java)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1496)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6186)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.view.ViewGroup.addViewInner(ViewGroup.java:4417)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.view.ViewGroup.addView(ViewGroup.java:4258)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.view.ViewGroup.addView(ViewGroup.java:4230)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:443)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:424)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.app.Activity.setContentView(Activity.java:2435)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at org.kivy.android.PythonActivity.showLoadingScreen(PythonActivity.java:451)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at org.kivy.android.PythonActivity.onCreate(PythonActivity.java:71)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:6684)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2637)
08-07 09:30:53.646  4473  4473 E AndroidRuntime: 	... 9 more
08-07 09:30:53.660  1802  2205 W ActivityManager:   Force finishing activity org.example.myapp/org.kivy.android.PythonActivity
08-07 09:30:53.778  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:30:53.817  1802  5510 I OpenGLRenderer: Initialized EGL, version 1.4

@ghost
Copy link
Author

ghost commented Aug 7, 2018

It seems there is a large amount of race conditions around the loading screen. Will this be fixed?

@ghost
Copy link
Author

ghost commented Aug 7, 2018

And yet another:

08-07 09:32:29.906  4501  4501 V pythonutil: Loading library: python3.5m
08-07 09:32:29.906  4501  4501 V pythonutil: Loading library: main
08-07 09:32:29.910  4501  4501 V pythonutil: Failed to load _io.so or unicodedata.so...but that's okay.
08-07 09:32:29.911  4501  4501 V pythonutil: Unsatisfied linker when loading ctypes
08-07 09:32:29.911  4501  4501 V pythonutil: Loaded everything!
08-07 09:32:29.921  4501  4501 V PythonActivity: Setting env vars for start.c and Python to use
08-07 09:32:29.921  4501  4501 V PythonActivity: Access to our meta-data...
08-07 09:32:29.923  4501  4501 I PythonActivity: Surface will NOT be transparent
08-07 09:32:30.154  4564  4564 W debuggerd: type=1400 audit(0.0:105): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:32:29.925  1802  1823 I ActivityManager: Displayed org.example.myapp/org.kivy.android.PythonActivity: +195ms
08-07 09:32:29.955  4501  4501 V SDL     : surfaceCreated()
08-07 09:32:29.955  4501  4501 V SDL     : surfaceChanged()
08-07 09:32:29.955  4501  4501 V SDL     : pixel format RGB_565
08-07 09:32:29.956  4501  4501 V SDL     : Window size:540x924
08-07 09:32:29.964  1802  2377 D Sensors : setDelay: acc_delay=20000000, mag_delay=200000000
08-07 09:32:29.964  1802  2377 D Sensors : setDelay: handle=0, delay=20000000
08-07 09:32:30.010  4501  4562 I SDL     : SDL_Android_Init()
08-07 09:32:30.010  4501  4562 I SDL     : SDL_Android_Init() finished!
08-07 09:32:30.010  4501  4562 I python  : Initialize Python for Android
08-07 09:32:30.010  4501  4562 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
08-07 09:32:30.010  4501  4562 I python  : /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/user/0/org.example.myapp/files/app
08-07 09:32:30.010  4501  4562 I python  : Preparing to initialize python
08-07 09:32:30.010  4501  4562 I python  : crystax_python exists
08-07 09:32:30.010  4501  4562 I python  : calculated paths to be...
08-07 09:32:30.010  4501  4562 I python  : /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/user/0/org.example.myapp/files/app/crystax_python/stdlib.zip:/mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/user/0/org.example.myapp/files/app/crystax_python/modules
08-07 09:32:30.010  4501  4562 I python  : set wchar paths...
08-07 09:32:30.010  4501  4562 I python  : Initialized python
08-07 09:32:30.010  4501  4562 I python  : AND: Init threads
08-07 09:32:30.011  4501  4562 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 4562 (SDLThread)
08-07 09:32:30.013   176   176 W         : debuggerd: handling request: pid=4501 uid=10115 gid=10115 tid=4562
08-07 09:32:30.334  4564  4564 W debuggerd: type=1400 audit(0.0:106): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:32:30.348  4564  4564 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-07 09:32:30.351  4564  4564 F DEBUG   : LineageOS Version: '14.1-20180624-NIGHTLY-serranoltexx'
08-07 09:32:30.351  4564  4564 F DEBUG   : Build fingerprint: 'samsung/serranoltexx/serranolte:4.4.2/KOT49H/I9195XXUCNE6:user/release-keys'
08-07 09:32:30.351  4564  4564 F DEBUG   : Revision: '0'
08-07 09:32:30.351  4564  4564 F DEBUG   : ABI: 'arm'
08-07 09:32:30.352  4564  4564 F DEBUG   : pid: 4501, tid: 4562, name: SDLThread  >>> org.example.myapp <<<
08-07 09:32:30.352  4564  4564 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
08-07 09:32:30.352  4564  4564 F DEBUG   :     r0 9b8feef8  r1 00000008  r2 26105147  r3 00000000
08-07 09:32:30.352  4564  4564 F DEBUG   :     r4 b6ccc4a6  r5 9b8feef8  r6 b66fd008  r7 9aa7de0c
08-07 09:32:30.344  4564  4564 W debuggerd: type=1400 audit(0.0:107): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:32:30.354  4564  4564 W debuggerd: type=1400 audit(0.0:108): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:32:30.352  4564  4564 F DEBUG   :     r8 9aa7df0c  r9 9b61d600  sl 00000000  fp 9aa7e080
08-07 09:32:30.352  4564  4564 F DEBUG   :     ip 9ce8fbdc  sp 9aa7ddc0  lr 9ccbe0d5  pc 9ccbdb7e  cpsr 600b0030
08-07 09:32:30.359  4564  4564 F DEBUG   : 
08-07 09:32:30.359  4564  4564 F DEBUG   : backtrace:
08-07 09:32:30.354  4564  4564 W debuggerd: type=1400 audit(0.0:109): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:32:30.359  4564  4564 F DEBUG   :     #00 pc 0004cb7e  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libpython3.5m.so
08-07 09:32:30.359  4564  4564 F DEBUG   :     #01 pc 0004d0d1  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libpython3.5m.so
08-07 09:32:30.359  4564  4564 F DEBUG   :     #02 pc 0004d3cb  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libpython3.5m.so
08-07 09:32:30.360  4564  4564 F DEBUG   :     #03 pc 00060b27  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libpython3.5m.so
08-07 09:32:30.360  4564  4564 F DEBUG   :     #04 pc 00001045  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libmain.so
08-07 09:32:30.360  4564  4564 F DEBUG   :     #05 pc 00000dfd  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libmain.so
08-07 09:32:30.360  4564  4564 F DEBUG   :     #06 pc 00000aa1  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/oat/arm/base.odex (offset 0x16000)
08-07 09:32:30.799  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:32:31.315  4564  4564 W debuggerd: type=1400 audit(0.0:110): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:32:31.315  4564  4564 W debuggerd: type=1400 audit(0.0:111): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:32:31.545  1802  4575 W ActivityManager:   Force finishing activity org.example.myapp/org.kivy.android.PythonActivity
08-07 09:32:31.549   176   176 W         : debuggerd: resuming target 4501
08-07 09:32:31.564  1802  1820 I BootReceiver: Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
08-07 09:32:31.614  1802  2643 I WindowManager: WIN DEATH: Window{4c64fc1 u0 SurfaceView - org.example.myapp/org.kivy.android.PythonActivity}
08-07 09:32:31.614  1802  1932 I ActivityManager: Process org.example.myapp (pid 4501) has died
08-07 09:32:31.618  1802  1932 D ActivityManager: cleanUpApplicationRecord -- 4501
08-07 09:32:31.619  1802  2645 D GraphicsStats: Buffer count: 9
08-07 09:32:31.623  1802 15917 I WindowManager: WIN DEATH: Window{62288cb u0 org.example.myapp/org.kivy.android.PythonActivity}
08-07 09:32:31.625  1802  1860 W InputDispatcher: channel '260561d org.example.myapp/org.kivy.android.PythonActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
08-07 09:32:31.625  1802  1860 E InputDispatcher: channel '260561d org.example.myapp/org.kivy.android.PythonActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
08-07 09:32:31.627  1802  2203 I WindowManager: WIN DEATH: Window{986da63 u0 SurfaceView - org.example.myapp/org.kivy.android.PythonActivity}
08-07 09:32:31.630  1802  5506 I WindowManager: WIN DEATH: Window{260561d u0 org.example.myapp/org.kivy.android.PythonActivity}
08-07 09:32:31.630  1802  5506 W InputDispatcher: Attempted to unregister already unregistered input channel '260561d org.example.myapp/org.kivy.android.PythonActivity (server)'
08-07 09:32:31.634  1802  1837 D Sensors : setDelay: acc_delay=66667000, mag_delay=200000000
08-07 09:32:31.634  1802  1837 D Sensors : setDelay: handle=0, delay=66667000

Basically I just need to tab in/out aggressively and I get a plethora of odd crashes.

@ghost ghost changed the title PySDL2 crash Tons of different PySDL2 crashes when tabbing in/out of application during loading or right after it finished Aug 7, 2018
@ghost
Copy link
Author

ghost commented Aug 7, 2018

Ok, part of those crashes were because I got a window close event and didn't handle it. Now that I do and free all resources of the window (along with SDL_DestroyWindow) once that happens, I am seeing this once I tab out and tab back in (crash happens when regaining focus / tabbing back in):

08-07 09:57:07.015  5677  5677 V pythonutil: Loaded everything!
08-07 09:57:07.019  5677  5677 V PythonActivity: Setting env vars for start.c and Python to use
08-07 09:57:07.019  5677  5677 V PythonActivity: Access to our meta-data...
08-07 09:57:07.021  5677  5677 I PythonActivity: Surface will NOT be transparent
08-07 09:57:07.051  5677  5677 V SDL     : surfaceCreated()
08-07 09:57:07.051  5677  5677 V SDL     : surfaceChanged()
08-07 09:57:07.051  5677  5677 V SDL     : pixel format RGB_565
08-07 09:57:07.053  5677  5677 V SDL     : Window size:540x924
08-07 09:57:07.083  1802  1814 D Sensors : setDelay: acc_delay=20000000, mag_delay=200000000
08-07 09:57:07.083  1802  1814 D Sensors : setDelay: handle=0, delay=20000000
08-07 09:57:07.088  5677  5752 I SDL     : SDL_Android_Init()
08-07 09:57:07.088  5677  5752 I SDL     : SDL_Android_Init() finished!
08-07 09:57:07.088  5677  5752 I python  : Initialize Python for Android
08-07 09:57:07.088  5677  5752 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
08-07 09:57:07.088  5677  5752 I python  : /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/user/0/org.example.myapp/files/app
08-07 09:57:07.088  5677  5752 I python  : Preparing to initialize python
08-07 09:57:07.088  5677  5752 I python  : crystax_python exists
08-07 09:57:07.088  5677  5752 I python  : calculated paths to be...
08-07 09:57:07.088  5677  5752 I python  : /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/user/0/org.example.myapp/files/app/crystax_python/stdlib.zip:/mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/user/0/org.example.myapp/files/app/crystax_python/modules
08-07 09:57:07.102  5677  5752 I python  : set wchar paths...
08-07 09:57:07.102  5677  5752 I python  : Initialized python
08-07 09:57:07.102  5677  5752 I python  : AND: Init threads
08-07 09:57:07.102  5677  5752 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 5752 (SDLThread)
08-07 09:57:07.103   176   176 W         : debuggerd: handling request: pid=5677 uid=10116 gid=10116 tid=5752
08-07 09:57:07.127  5754  5754 W debuggerd: type=1400 audit(0.0:197): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.127  5754  5754 W debuggerd: type=1400 audit(0.0:198): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.137  5754  5754 W debuggerd: type=1400 audit(0.0:199): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.137  5754  5754 W debuggerd: type=1400 audit(0.0:200): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.137  5754  5754 W debuggerd: type=1400 audit(0.0:201): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.137  5754  5754 W debuggerd: type=1400 audit(0.0:202): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.137  5754  5754 W debuggerd: type=1400 audit(0.0:203): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.137  5754  5754 W debuggerd: type=1400 audit(0.0:204): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.137  5754  5754 W debuggerd: type=1400 audit(0.0:205): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.137  5754  5754 W debuggerd: type=1400 audit(0.0:206): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.147  5754  5754 W debuggerd: type=1400 audit(0.0:207): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.157  5754  5754 W debuggerd: type=1400 audit(0.0:208): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.171  1802  1838 D Sensors : LightSensor readEvents x = 0.000000, raw = 0
08-07 09:57:07.172  1802  1825 D LuxLevels: bright hysteresis constant= 0.1, threshold=0.0, lux=0.0
08-07 09:57:07.172  1802  1825 D LuxLevels: dark hysteresis constant= 0.2, threshold=0.0, lux=0.0
08-07 09:57:07.176  5754  5754 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-07 09:57:07.176  5754  5754 F DEBUG   : LineageOS Version: '14.1-20180624-NIGHTLY-serranoltexx'
08-07 09:57:07.176  5754  5754 F DEBUG   : Build fingerprint: 'samsung/serranoltexx/serranolte:4.4.2/KOT49H/I9195XXUCNE6:user/release-keys'
08-07 09:57:07.176  5754  5754 F DEBUG   : Revision: '0'
08-07 09:57:07.176  5754  5754 F DEBUG   : ABI: 'arm'
08-07 09:57:07.176  5754  5754 F DEBUG   : pid: 5677, tid: 5752, name: SDLThread  >>> org.example.myapp <<<
08-07 09:57:07.176  5754  5754 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
08-07 09:57:07.176  5754  5754 F DEBUG   :     r0 9b72e3e0  r1 00000008  r2 26105147  r3 00000000
08-07 09:57:07.177  5754  5754 F DEBUG   :     r4 b6ccb4a6  r5 9b72e3e0  r6 b66fd008  r7 9ab6ee0c
08-07 09:57:07.177  5754  5754 F DEBUG   :     r8 9ab6ef0c  r9 9b676100  sl 00000000  fp 9ab6f080
08-07 09:57:07.177  5754  5754 F DEBUG   :     ip 9ce8fbdc  sp 9ab6edc0  lr 9ccbe0d5  pc 9ccbdb7e  cpsr 600e0030
08-07 09:57:07.177  5754  5754 W debuggerd: type=1400 audit(0.0:209): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.177  5754  5754 W debuggerd: type=1400 audit(0.0:210): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.177  5754  5754 W debuggerd: type=1400 audit(0.0:211): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.190  5754  5754 F DEBUG   : 
08-07 09:57:07.190  5754  5754 F DEBUG   : backtrace:
08-07 09:57:07.191  5754  5754 F DEBUG   :     #00 pc 0004cb7e  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libpython3.5m.so
08-07 09:57:07.191  5754  5754 F DEBUG   :     #01 pc 0004d0d1  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libpython3.5m.so
08-07 09:57:07.191  5754  5754 F DEBUG   :     #02 pc 0004d3cb  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libpython3.5m.so
08-07 09:57:07.191  5754  5754 F DEBUG   :     #03 pc 00060b27  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libpython3.5m.so
08-07 09:57:07.191  5754  5754 F DEBUG   :     #04 pc 00001045  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libmain.so
08-07 09:57:07.191  5754  5754 F DEBUG   :     #05 pc 00000dfd  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/lib/arm/libmain.so
08-07 09:57:07.191  5754  5754 F DEBUG   :     #06 pc 00000aa1  /mnt/expand/ccbe4e94-5878-4053-8382-d825486cc844/app/org.example.myapp-1/oat/arm/base.odex (offset 0x16000)
08-07 09:57:07.788  5754  5754 W debuggerd: type=1400 audit(0.0:212): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:07.788  5754  5754 W debuggerd: type=1400 audit(0.0:213): avc: denied { search } for name="expand" dev="tmpfs" ino=5981 scontext=u:r:debuggerd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
08-07 09:57:08.034  5754  5754 E         : debuggerd: failed to kill process 5677: No such process
08-07 09:57:08.034  1802  5760 W ActivityManager:   Force finishing activity org.example.myapp/org.kivy.android.PythonActivity
08-07 09:57:08.038  1802  1820 I BootReceiver: Copying /data/tombstones/tombstone_07 to DropBox (SYSTEM_TOMBSTONE)
08-07 09:57:08.041   176   176 W         : debuggerd: resuming target 5677
08-07 09:57:08.093  1802 28875 I WindowManager: WIN DEATH: Window{7a28119 u0 org.example.myapp/org.kivy.android.PythonActivity}
08-07 09:57:08.093  1802 28875 W WindowManager: Force-removing child win Window{cecca8c u0 SurfaceView - org.example.myapp/org.kivy.android.PythonActivity} from container Window{7a28119 u0 org.example.myapp/org.kivy.android.PythonActivity}
08-07 09:57:08.094  1802 15925 D GraphicsStats: Buffer count: 10
08-07 09:57:08.094  1802  2645 I ActivityManager: Process org.example.myapp (pid 5677) has died
08-07 09:57:08.094  1802  2645 D ActivityManager: cleanUpApplicationRecord -- 5677
08-07 09:57:08.106  1802  1860 W InputDispatcher: channel 'd3e485 org.example.myapp/org.kivy.android.PythonActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
08-07 09:57:08.106  1802  1860 E InputDispatcher: channel 'd3e485 org.example.myapp/org.kivy.android.PythonActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
08-07 09:57:08.108  1802  2203 W WindowManager: Failed looking up window
08-07 09:57:08.108  1802  2203 W WindowManager: java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@afe13bf does not exist
08-07 09:57:08.108  1802  2203 W WindowManager: 	at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9469)
08-07 09:57:08.108  1802  2203 W WindowManager: 	at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9460)
08-07 09:57:08.108  1802  2203 W WindowManager: 	at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1807)
08-07 09:57:08.108  1802  2203 W WindowManager: 	at android.os.BinderProxy.sendDeathNotice(Binder.java:688)
08-07 09:57:08.108  1802  2203 I WindowManager: WIN DEATH: null
08-07 09:57:08.108  1802  5506 I WindowManager: WIN DEATH: Window{866d30b u0 SurfaceView - org.example.myapp/org.kivy.android.PythonActivity}
08-07 09:57:08.117  1802  1932 I WindowManager: WIN DEATH: Window{d3e485 u0 org.example.myapp/org.kivy.android.PythonActivity}
08-07 09:57:08.117  1802  1932 W InputDispatcher: Attempted to unregister already unregistered input channel 'd3e485 org.example.myapp/org.kivy.android.PythonActivity (server)'

It works fine on the desktop by the way, where I can close the window, see the window close properly processed and nothing crashes.

Also, how is this supposed to work anyway? When I tab out and the window closes, now the app has no window - how will it ever open one when gaining focus again? After all, I didn't want to close it, I was forced to by python-for-android triggering a close event, so what is it supposed to show anyway once it regains focus...?

@ghost
Copy link
Author

ghost commented Aug 8, 2018

Well, it's most likely me doing something wrong. But it would be useful to document this somewhere, the minimum events that need to be handled through SDL2 to avoid crashes like this. (Because it's not really comparable on the desktop, where the program doesn't crash due to this.) Anyway, I'll close the issue for now

@ghost ghost closed this as completed Aug 8, 2018
This issue was closed.
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

0 participants