App crashes on IFP devices with Option::unwrap() error in wgpu-core
We have developed an app that runs successfully on mobile and tablet devices. However, when we install the APK on Interactive Flat Panel (IFP) devices, the app stops working and crashes. The error logs indicate a panic in the wgpu-core library.
Environment Details:
Device: Interactive Flat Panel (IFP) Working Platforms: Mobile, Tablet wgpu-core Version: 23.0.1 Rust Version: (if applicable) APK Details: Target SDK: (e.g., 33) Minimum SDK: (e.g., 21) Development Tools: Android Studio Ladybug 2024.2.1 Patch 2
The app crashes on IFP devices with the following error:
ruffle E Handling panic: thread 'Option::unwrap() on a None value': /Users/achlesh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-23.0.1/src/device/resource.rs:185
Could someone guide us on resolving this issue?
- Is this a known limitation or bug with wgpu-core?
- Are there specific configurations or fallback mechanisms to handle IFP devices?
- Any recommended debugging steps or patches?
Thank you for your time and support!
Hey,
I'm looking into this now - it looks like a bug in wgpu, you're right. I suspect, though, that it's actually just a symptom of another bug - I think you'd only really encounter this if the application shut down in a weird state? I'm not sure yet. It might be worth seeing if something else happened in the logs before this.
As for IFP - we don't have anything specific for it, our primary audience right now is just handhelds, but we're more than happy to help with debugging and figuring out anything that's needed to make that work!
I'll let you know when I've figured out the wgpu bug.
I've opened https://github.com/gfx-rs/wgpu/issues/6676 for the panic here, but if I'm correct, you should only really experience it when the application is closing down. If you're not intentionally closing the application, it's likely this is masking the real crash :(
Hi @Dinnerbone ,
Thanks for looking into this. Just to clarify, I’m not shutting down the application—I’m simply launching the Activity to load the .swf file. I’ll check the logs for any other events leading up to this issue and let you know if anything unusual pops up.
However, Attached the recent log for the error.
MainActivity D SWF_FILE_PATH : https://samples.mplayerhq.hu/SWF/test.swf
rs.ruffle W Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
Compatibil...geReporter D Compat change id reported: 210923482; UID 10108; state: ENABLED
rs.ruffle I Explicit concurrent copying GC freed 6828(748KB) AllocSpace objects, 1(20KB) LOS objects, 49% free, 2015KB/4030KB, paused 48us,39us total 38.099ms
rs.ruffle I Explicit concurrent copying GC freed 3085(135KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 2468KB/4936KB, paused 52us,40us total 41.728ms
GameActivity I Looking for library libruffle_sample.so
GameActivity I Found library libruffle_sample.so. Loading...
GameActivity D GameActivity_register
GameActivity V Registering com/google/androidgamesdk/GameActivity's 22 native methods...
threaded_app V Creating: 0xb400007b07500f50
threaded_app V Callbacks set: 0xb400007b07500fa0
threaded_app V Launching android_app_entry in a thread
threaded_app V android_app_entry called
threaded_app V android_app = 0xb400007ae7509790
threaded_app V config = 0xb400007a574e4090
threaded_app V activity = 0xb400007b07500f50
threaded_app V assetmanager = 0xb400007b074d49f0
threaded_app V Config: mcc=0 mnc=0 lang=en cnt=US orien=2 touch=3 dens=640 keys=2 nav=3 keysHid=1 navHid=0 sdk=33 size=3 long=2 modetype=4 modenight=1
ruffle I ruffle_sample: Starting android_main...
ruffle I ruffle_sample: Starting event loop...
GameActivity V onStart_native
threaded_app V Start: 0xb400007b07500f50
threaded_app V activityState=10
threaded_app V Resume: 0xb400007b07500f50
threaded_app V activityState=11
threaded_app V WindowInsetsChanged: 0xb400007b07500f50
OpenGLRenderer E Unable to match the desired swap behavior.
threaded_app V ContentRectChanged: 0xb400007b07500f50 -- (0 0) (3840 944)
GameActivity V onSurfaceCreated_native
threaded_app V NativeWindowCreated: 0xb400007b07500f50 -- 0xb400007b975b38b0
threaded_app V android_app_set_window called
threaded_app V APP_CMD_INIT_WINDOW
threaded_app V NativeWindowResized: 0xb400007b07500f50 -- 0xb400007b975b38b0 ( 3840 x 944 )
ruffle I ruffle_sample: Init window: 3840 x 944 (is existing: false)
ruffle W ruffle_render_wgpu::backend: Open GL graphics backend support may not be fully supported.
threaded_app V NativeWindowRedrawNeeded: 0xb400007b07500f50 -- 0xb400007b975b38b0
SurfaceSyncer E Failed to find sync for id=0
ruffle W wgpu_hal::gles::egl: EGL_MESA_platform_surfaceless not available. Using default platform
ruffle W wgpu_hal::gles::egl: EGL says it can present to the window but not natively
ruffle E ruffle_sample: thread 'Result::unwrap() on an Err value: RequestDeviceError { inner: Core(LimitsExceeded(FailedLimit { name: "max_color_attachments", requested: 8, allowed: 4 })) }': src/lib.rs:221
0: Result::unwrap() on an Err value: RequestDeviceError { inner: Core(LimitsExceeded(FailedLimit { name: "max_color_attachments", requested: 8, allowed: 4 })) }': src/lib.rs:221
0: Result::unwrap() on an Err value: RequestDeviceError { inner: Core(LimitsExceeded(FailedLimit { name: "max_color_attachments", requested: 8, allowed: 4 })) }
threaded_app V android_app_destroy!
Parcel W Expecting binder but got null!
GameActivity D ************** mainWorkCallback *********
threaded_app V Pause: 0xb400007b07500f50
Here is my device detals:
Looking forward to hearing back about the wgpu bug. Thanks again for your support!