How to fix BadLength (poly request too large) Xlib error

In some of Xorg Linux applications you might see the following error when you use certain Unicode characters, like “❔” (fancy question mark):

Error of failed request: BadLength (poly request too large or internal Xlib length error)
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 20 (RenderAddGlyphs)
Serial number of failed request: 6687
Current serial number in output stream: 6706

The numbers can be different, but the error persists. Typically, it crashes the application. There are various solutions to this problem, but I found the most optimal one. You just need to install GNU Unifont. On Debian-based Linux distributions, including Ubuntu, just open the terminal (usually, Ctrl+Alt+T) and run the command below.

sudo apt install unifont

It will install GNU Unifont glyphs on your system. After restarting the application, which issued a BadLength (poly request too large) error, it will work fine. If you use a system other than Debian/Ubuntu, run one of the commands below:

sudo apt install unifont  # Debian/Ubuntu
sudo dnf install unifont  # Fedora/RHEL
sudo pacman -S bdf-unifont  # Arch Linux
sudo emerge media-fonts/unifont  # Gentoo/Funtoo

I had that error with st terminal when I used an emoji, but after I installed Unifont, the problem disappeared. The solution I wrote is better than others, because other solutions include patching the source code of problematic applications or libXft. I do not think it is a user-friendly way.

What is Unifont

GNU Unifont is a free bitmap font which aims to support various Unicode symbols, from hieroglyphs to emojis. However, those fonts are not vector, which means they look “mosaic” when scaled up. But if you don’t need very high quality and want just to fix an error, Unifont is just fine.


Now you know how to fix BadLength (poly request too large or internal Xlib length error). In next post I will tell you about the other errors and how you can fix them.

Leave a Comment