Discussion:
[dev] [st] libxft-bgra X Error
Luuk van Baal
2021-04-19 09:59:53 UTC
Permalink
I was looking for pointers in regards to this error I'm receiving when
using libxft-bgra(https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1). I explained the issue in (https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1#note_884325):

"This patch (installed through this AUR package) leads to

X Error of failed request: RenderBadPicture (invalid Picture parameter)
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 8 (RenderComposite)
Picture id in failed request: 0x3b84
Serial number of failed request: 15315
Current serial number in output stream: 15327

when scrolling through this file(https://raw.githubusercontent.com/luukvbaal/iconlookup/master/iconlookup) in suckless' simple terminal using a patched nerd font. Very peculiar I know but this is the only way I've been able to reproduce this error.
This sequence crashes the terminal every time:
open st -> open iconlookup in vim -> press 160gg to go to line 160(full size terminal showing 47 lines centered around line 160).
The same error does not happen when using different terminals but also does not happen in st when using the standard libxft from the arch repositories.
I'm interested in figuring this out but I'm not sure how to debug the
error. Would appreciate any pointers or thoughts regarding this."

I'm curious to know your thoughts on this as like I said the problem
does not occur with mainline libxft and st, does occur with libxft-bgra
and st, but does not occur with libxft-bgra and other terminals(tried
xterm/kitty/alacritty). Might this issue be fixed on st's side?

Best regards,
Luuk van Baal
Страхиња Радић
2021-04-19 17:06:53 UTC
Permalink
Post by Luuk van Baal
I was looking for pointers in regards to this error I'm receiving when
"This patch (installed through this AUR package) leads to
X Error of failed request: RenderBadPicture (invalid Picture parameter)
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 8 (RenderComposite)
Picture id in failed request: 0x3b84
Serial number of failed request: 15315
Current serial number in output stream: 15327
when scrolling through this file(https://raw.githubusercontent.com/luukvbaal/iconlookup/master/iconlookup) in suckless' simple terminal using a patched nerd font. Very peculiar I know but this is the only way I've been able to reproduce this error.
open st -> open iconlookup in vim -> press 160gg to go to line 160(full size terminal showing 47 lines centered around line 160).
The same error does not happen when using different terminals but also does not happen in st when using the standard libxft from the arch repositories.
I'm interested in figuring this out but I'm not sure how to debug the
error. Would appreciate any pointers or thoughts regarding this."
I'm curious to know your thoughts on this as like I said the problem
does not occur with mainline libxft and st, does occur with libxft-bgra
and st, but does not occur with libxft-bgra and other terminals(tried
xterm/kitty/alacritty). Might this issue be fixed on st's side?
Interesting, I'm not getting this error. I use Artix Linux, libxft-bgra
2.3.3.r7.7808631e-1 from AUR, vim 8.2.2653-1 and my modified st which I
regularly update from suckless repo[1]. Also ttf-nerd-fonts-symbols, *not*
ttf-nerd-fonts-symbols-mono, as the latter package has a bug with the uppercase
"E".[2] (Maybe related?)

Side note: I prefer :160 in vim to go to a particular line.

[1]: https://git.sr.ht/~strahinja/st
[2]: https://github.com/ryanoasis/nerd-fonts/issues/581
Страхиња Радић
2021-04-19 18:07:29 UTC
Permalink
Post by Страхиња Радић
Interesting, I'm not getting this error. I use Artix Linux, libxft-bgra
2.3.3.r7.7808631e-1 from AUR, vim 8.2.2653-1 and my modified st which I
regularly update from suckless repo[1]. Also ttf-nerd-fonts-symbols, *not*
ttf-nerd-fonts-symbols-mono, as the latter package has a bug with the uppercase
"E".[2] (Maybe related?)
After further testing, I can say that this bug does happen, but inconsistently,
and with no obvious way to reproduce. When it does happen, I get the following
output:

X Error of failed request: RenderBadPicture (invalid Picture parameter)
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 8 (RenderComposite)
Picture id in failed request: 0x1
Serial number of failed request: 4871
Current serial number in output stream: 5009

It also isn't tied to vim. I tried using joe -asis and less, with the same
result. Interestingly enough, cat iconlookup doesn't crash st, even when
scrolling back with tmux to the offending lines.
Luuk van Baal
2021-04-19 18:13:38 UTC
Permalink
From: Страхиња Радић<***@strahinja.org>
Sent:21/04/19 08:07pm
Subject:Re: [dev] [st] libxft-bgra X Error
Post by Страхиња Радић
Post by Страхиња Радић
Interesting, I'm not getting this error. I use Artix Linux, libxft-bgra
2.3.3.r7.7808631e-1 from AUR, vim 8.2.2653-1 and my modified st which I
regularly update from suckless repo[1]. Also ttf-nerd-fonts-symbols, *not*
ttf-nerd-fonts-symbols-mono, as the latter package has a bug with the uppercase
"E".[2] (Maybe related?)
After further testing, I can say that this bug does happen, but inconsistently,
and with no obvious way to reproduce. When it does happen, I get the following
X Error of failed request: RenderBadPicture (invalid Picture parameter)
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 8 (RenderComposite)
Picture id in failed request: 0x1
Serial number of failed request: 4871
Current serial number in output stream: 5009
It also isn't tied to vim. I tried using joe -asis and less, with the same
result. Interestingly enough, cat iconlookup doesn't crash st, even when
scrolling back with tmux to the offending lines.
Yeah this is what I experienced as well. Seems to depend on what exactly is rendered
on the screen but usually scrolling around line 160 in iconlookup seems to crash st.
On my system with font size 16 and full screen (1920 x 1080, showing 47 lines) it
crashes without fail when opening iconlookup and going to line 160 though.
Luuk van Baal
2021-04-19 17:58:04 UTC
Permalink
From: Страхиња Радић<***@strahinja.org>
Sent:21/04/19 07:06pm
Subject:Re: [dev] [st] libxft-bgra X Error
Post by Страхиња Радић
Post by Luuk van Baal
I was looking for pointers in regards to this error I'm receiving when
"This patch (installed through this AUR package) leads to
X Error of failed request: RenderBadPicture (invalid Picture parameter)
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 8 (RenderComposite)
Picture id in failed request: 0x3b84
Serial number of failed request: 15315
Current serial number in output stream: 15327
when scrolling through this file(https://raw.githubusercontent.com/luukvbaal/iconlookup/master/iconlookup) in suckless' simple terminal using a patched nerd font. Very peculiar I know but this is the only way I've been able to reproduce this error.
open st -> open iconlookup in vim -> press 160gg to go to line 160(full size terminal showing 47 lines centered around line 160).
The same error does not happen when using different terminals but also does not happen in st when using the standard libxft from the arch repositories.
I'm interested in figuring this out but I'm not sure how to debug the
error. Would appreciate any pointers or thoughts regarding this."
I'm curious to know your thoughts on this as like I said the problem
does not occur with mainline libxft and st, does occur with libxft-bgra
and st, but does not occur with libxft-bgra and other terminals(tried
xterm/kitty/alacritty). Might this issue be fixed on st's side?
Interesting, I'm not getting this error. I use Artix Linux, libxft-bgra
2.3.3.r7.7808631e-1 from AUR, vim 8.2.2653-1 and my modified st which I
regularly update from suckless repo[1]. Also ttf-nerd-fonts-symbols, *not*
ttf-nerd-fonts-symbols-mono, as the latter package has a bug with the uppercase
"E".[2] (Maybe related?)
Side note: I prefer :160 in vim to go to a particular line.
[1]: https://git.sr.ht/~strahinja/st
[2]: https://github.com/ryanoasis/nerd-fonts/issues/581
Taking a look at your st config led me to try to use the font2 patch and I can confirm that the error does not occor when using ttf-nerd-fonts-symbols in the font2 array and a regular font as the st font. Before this I was using a fontconfig setup like so:

<alias>
<family>monospace</family>
<prefer>
<family>FiraCode Nerd Font[1]</family>
<family>Noto Color Emoji</family>
</prefer>
</alias>

with the st font set to mono:

static char *font = "mono:pixelsize=16:antialias=true:autohint=true";

It seems the error is caused by something only present when using a patched nerd font, not when using a seperate font containing the nerd font symbols.

P.S. using the font2 patch with ttf-nerd-fonts-symbols leaves me with a misaligned shell prompt(powerlevel10k[2]) but I suppose this can be fixed.

[1]: https://aur.archlinux.org/packages/nerd-fonts-fira-code/
[2]: https://github.com/romkatv/powerlevel10k
Loading...