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

Project with extra large icon triggers X11 error: BadLength (poly request too large or internal Xlib length error) #19716

Closed
akien-mga opened this issue Jun 22, 2018 · 3 comments · Fixed by #21460

Comments

@akien-mga
Copy link
Member

Godot version:
3.0.3-stable and current master branch (80f7eac)

OS/device including version:
Linux (Mageia 6 x86_64) with X11 1.19.5
Nvidia GTX 670MX

Issue description:
The Godot jam entry Meltdown Hydrocooler Force by @DarrellWulff doesn't run on Linux X11 64-bit. The (custom) splash screen is shown, and then freezes on the splash screen with this error in the terminal:

OpenGL ES 3.0 Renderer: GeForce GTX 670MX/PCIe/SSE2
Boot splash path: res://DWLogo.png
X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  18 (X_ChangeProperty)
  Serial number of failed request:  242
  Current serial number in output stream:  242

This could be reproduced by another user too: https://itch.io/post/448272

Source code for the game is available, and I could confirm that the same issue happens when running from the source code with both Godot 3.0.3-stable and the current master branch.

Steps to reproduce:

Minimal reproduction project:
See above.

@akien-mga
Copy link
Member Author

CC @hpvb as X11 guru always up for a challenge :P

@akien-mga
Copy link
Member Author

The issue happens because of this line: https://github.com/DarrellWulff/Meltdown-Hydrocooler-Force-Godot-Game-Jam-/blob/14aaba438560cf9cc1556769529e3946398dec28/project.godot#L18

That project tries to load a 3072x2048 PNG (!) as project icon (!!), which X11 likely doesn't like: https://raw.githubusercontent.com/DarrellWulff/Meltdown-Hydrocooler-Force-Godot-Game-Jam-/master/UI/MainTitle.png

We likely need to add some icon validation logic on X11 to prevent such issues (might also be relevant on other platforms).

@akien-mga akien-mga changed the title Game doesn't run on X11: BadLength (poly request too large or internal Xlib length error), opcode 18 (X_ChangeProperty) Project with extra large icon triggers X11 error: BadLength (poly request too large or internal Xlib length error) Jun 22, 2018
@hpvb
Copy link
Member

hpvb commented Jun 23, 2018

Hmm, yeah, I don't think this should work, but we obviously also shouldn't just crash. I'll try to fix this.

@hpvb hpvb self-assigned this Jun 23, 2018
hpvb added a commit to hpvb/godot that referenced this issue Aug 26, 2018
When setting an icon that is too large previously Godot would die with a
X Error of failed request:  BadLength error. To avoid this we install an
error handler right before we set an icon. If the error handler triggers
we halve the icon size until it works or until we've reached a 0 size on
either width or height.

We print a warning when this happens to alert developers.

This fixes godotengine#19716
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants