craftos2
craftos2 copied to clipboard
Crash on resize
Describe the bug Sometimes, when resizing CraftOS-PC, it throws an X11 protocol error and crashes.
To Reproduce Steps to reproduce the behavior:
- Launch CraftOS-PC from the command-line.
- Grab the bottom-right corner of the window, and move the mouse cursor in circles.
- See error
Expected behavior I expect CraftOS-PC to not crash.
Screenshots This is all the error information it gives.
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 130 (MIT-SHM)
Minor opcode of failed request: 3 (X_ShmPutImage)
Value in failed request: 0x1ac
Serial number of failed request: 1281
Current serial number in output stream: 1282
Environment (please complete the following information):
- OS: Arch Linux
- OS Version: N/A
- CraftOS-PC Version: v2.6.2
- Compiled from source? Yes (from AUR)
Additional context I'm running CraftOS-PC in XWayland under Plasma Wayland, if that helps; I believe I've come across this issue under X11 also.
Are you using the hardware renderer? When resizing, the renderer context gets invalidated and has to be regenerated; this is not easy to detect since it may happen in the middle of rendering, and the resize event has to be sent to the renderer before it attempts to call any rendering function on the context. I try to make it as unlikely as possible for it to crash while resizing, but in certain tight circumstances it's still possible to crash it.
No, I am not using the hardware renderer.
When using SDL's native wayland mode, resizing is horribly slow and stuttery but doesn't cause a crash.
On Tue, Nov 2, 2021 at 4:20 PM JackMacWindows @.***> wrote:
Are you using the hardware renderer? When resizing, the renderer context gets invalidated and has to be regenerated; this is not easy to detect since it may happen in the middle of rendering, and the resize event has to be sent to the renderer before it attempts to call any rendering function on the context. I try to make it as unlikely as possible for it to crash while resizing, but in certain tight circumstances it's still possible to crash it.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MCJack123/craftos2/issues/225#issuecomment-958137033, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMD5KRQCVYCBRMP5CEHKF63UKBI3RANCNFSM5HHJG42Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
I also got this, it also had some weird aspect-ratio-resize thing, but it didn't obey aspect ratio at all.
Alright, so I finally managed to get an error similar to this, and I decided to "fix" it by just ignoring errors (printing them to console without exiting). Hopefully this doesn't cause many issues, but if there's a critical error in X11 then it'll have to crash spectacularly to stop itself.