Tons of different PySDL2 crashes when tabbing in/out of application during loading or right after it finished
See original GitHub issueTesting 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
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Why are some games more prone to crash when I Alt-Tab?
Noticed that with a lot of games, sometimes when you alt-tab during loading, or during gameplay, some games tend to crash, or even...
Read more >Game crashes when alt-tabbing during loading after a match ...
3: Alt tab during the loading screen, causing the crash. The game crashes in such a ... It cannot close via steam, alt+f4...
Read more >PC crashes after closing a game or alt tabbing
Whenever I finish closing a game or alt tabbing out of a game after playing for a while, the pc will go black...
Read more >Windows 11 'Freeze Issue' When Alt-Tabbing From Any Game
A very common problem that players are encountering is the notorious Windows 11 'freeze' issue when alt-tabbing from a game.
Read more >Alt-tab freezing - Technical Support - World of Warcraft Forums
Was directed here by BlizzCS on Twitter, hoping I can find some help. Recently the game has started freezing up when alt-tabbing back...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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):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…?