You are not logged in.

#1 2022-01-04 09:31:49

Whaleyy
Member
Registered: 2021-12-25
Posts: 13

X Error of failed request: BadLength

Hello,

The error that I received from trying to open a png image...

X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  239 ()
  Minor opcode of failed request:  0
  Serial number of failed request:  43
  Current serial number in output stream:  43

I don't really have a clue on what's going on with this error because there wasn't a specific error display inside the parentheses. This is from VSCode using TKinter.

import tkinter as tk

root = tk.Tk()
root.iconphoto(True, tk.PhotoImage(file="soundwave.png"))
root.mainloop()

I was told it's got something to do with TKinter can't reference images, and so splitting it would work, but it didn't, so I guess it's got something to do with Nvidia, though I'm still unsure...

Offline

#2 2022-01-04 10:03:14

seth
Member
Registered: 2012-09-03
Posts: 26,449

Re: X Error of failed request: BadLength

How big is that image and how much did you split it?

xdpyinfo | grep "maximum request size"

It's likely ~16MB and you need to stay below that for some control overhead.

Online

#3 2022-01-04 10:20:55

Whaleyy
Member
Registered: 2021-12-25
Posts: 13

Re: X Error of failed request: BadLength

seth wrote:

How big is that image and how much did you split it?

xdpyinfo | grep "maximum request size"

It's likely ~16MB and you need to stay below that for some control overhead.

Oh no, I meant splitting as in, the code:

import tkinter as tk

root = tk.Tk()
icon = tk.PhotoImage(file="icons/soundwave.png")
root.iconphoto(True, icon)
root.mainloop()

As for the size of the image, it's just a regular png image, the size is "135.5 KiB (138,734 bytes)".

For xdpyinfo | grep "maximum request size": maximum request size:  16777212 bytes

Last edited by Whaleyy (2022-01-04 10:23:39)

Offline

#4 2022-01-04 13:21:56

seth
Member
Registered: 2012-09-03
Posts: 26,449

Re: X Error of failed request: BadLength

Are you sure it's related to the iconphoto call and the image inside?
google has several hits for tcl/tk and badlength and like eg. https://core.tcl-lang.org/tk/tktview/3767882e06 or https://bugzilla.redhat.com/show_bug.cgi?id=1498269most seem to be related to certain fonts.

Online

#5 2022-01-04 13:46:53

Whaleyy
Member
Registered: 2021-12-25
Posts: 13

Re: X Error of failed request: BadLength

seth wrote:

Are you sure it's related to the iconphoto call and the image inside?
google has several hits for tcl/tk and badlength and like eg. https://core.tcl-lang.org/tk/tktview/3767882e06 or https://bugzilla.redhat.com/show_bug.cgi?id=1498269most seem to be related to certain fonts.

No I don't think it's related to Tkinter, but then I'm also not too sure because unlike the error reported, mine doesn't state that it's "RenderAddGlyphs", I tried uninstalled the emoji fonts packages but to no avail.

Offline

#6 2022-01-04 13:49:55

seth
Member
Registered: 2012-09-03
Posts: 26,449

Re: X Error of failed request: BadLength

Do you have the highly suspicious noto or otherwise emoji fonts installed?

Online

#7 2022-01-04 14:26:57

Whaleyy
Member
Registered: 2021-12-25
Posts: 13

Re: X Error of failed request: BadLength

seth wrote:

Do you have the highly suspicious noto or otherwise emoji fonts installed?

No, I've uninstalled it, I also tried installing ttf-unifont since there were others reporting that it worked for them but it didn't work on my end. In addition to noto-fonts-emoji, I only
had this as my emoji font - "error: target not found: noto-fonts-emoji" (after removing).

Offline

#8 2022-01-05 08:41:20

seth
Member
Registered: 2012-09-03
Posts: 26,449

Re: X Error of failed request: BadLength

The redhat bug says every font w/ color bitmaps is affected, you could try

while read FONT; do echo "$FONT"; xfd -fa "$FONT" & PID=$!; sleep 0.3; kill $PID;  done < <(fc-list -f "%{family}\n")

to see whether any of them throws an error.

Online

#9 2022-01-05 10:18:38

Whaleyy
Member
Registered: 2021-12-25
Posts: 13

Re: X Error of failed request: BadLength

seth wrote:

The redhat bug says every font w/ color bitmaps is affected, you could try

while read FONT; do echo "$FONT"; xfd -fa "$FONT" & PID=$!; sleep 0.3; kill $PID;  done < <(fc-list -f "%{family}\n")

to see whether any of them throws an error.

May I know what error am I scanning for? So far there's "exit 127" from some of the command. Other than that, most of them were listed out as "xfd -fa $FONT". It printed out like this:

[1]+  Exit 127                xfd -fa "$FONT"
bash: kill: (45145) - No such process
Noto Serif Georgian
[1] 45147
bash: xfd: command not found
[1]+  Exit 127                xfd -fa "$FONT"
bash: kill: (45147) - No such process

Offline

#10 2022-01-05 10:55:21

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 9,776

Re: X Error of failed request: BadLength


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#11 2022-01-05 14:05:36

Whaleyy
Member
Registered: 2021-12-25
Posts: 13

Re: X Error of failed request: BadLength

Lone_Wolf wrote:

Okay I've installed that and ran it again. But, how do I know if the font has color bitmaps? These were what returned when I ran the command (and alot more).

[221]-  Terminated              xfd -fa "$FONT"
DejaVu Sans

[223] 70565
Warning: Missing charsets in String to FontSet conversion

[222]-  Terminated              xfd -fa "$FONT"
Noto Sans Mono CJK SC

Last edited by Whaleyy (2022-01-05 14:05:59)

Offline

#12 2022-01-05 15:22:44

seth
Member
Registered: 2012-09-03
Posts: 26,449

Re: X Error of failed request: BadLength

You're looking for an X11 error similar to yours - the other bugs blame xft's inability to deal w/ certain fonts and xfd would cause the same error for relevant fonts.
If there's not, ew know that you're facing a different bug.

Online

#13 2022-01-06 03:21:31

Whaleyy
Member
Registered: 2021-12-25
Posts: 13

Re: X Error of failed request: BadLength

seth wrote:

You're looking for an X11 error similar to yours - the other bugs blame xft's inability to deal w/ certain fonts and xfd would cause the same error for relevant fonts.
If there's not, ew know that you're facing a different bug.

I was gonna say I couldn't find the error until at the very end it printed out a similar error to mine, except this time, there's something in the parentheses which is about the font. Then uninstalling it enabled the test to continue until completion.

[451]-  Terminated              xfd -fa "$FONT"
Warning: Missing charsets in String to FontSet conversion
Noto Sans Display
[453] 5643
[452]-  Terminated              xfd -fa "$FONT"
Warning: Missing charsets in String to FontSet conversion
Source Code Pro,Source Code Pro Semibold
[454] 5645

[453]-  Terminated              xfd -fa "$FONT"
Warning: Missing charsets in String to FontSet conversion

Noto Color Emoji
[455] 5647
Warning: Missing charsets in String to FontSet conversion
X 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:  228
  Current serial number in output stream:  486
[454]-  Terminated              xfd -fa "$FONT"

The problem is, even after uninstalling it, the problem still persist...

Offline

#14 2022-01-06 07:49:14

seth
Member
Registered: 2012-09-03
Posts: 26,449

Re: X Error of failed request: BadLength

Didn't you suggest to have uninstalled it in #5 already?

fc-list | grep -i emoji

Other than that, can you share the actual png?

Online

#15 2022-01-07 15:15:28

Whaleyy
Member
Registered: 2021-12-25
Posts: 13

Re: X Error of failed request: BadLength

seth wrote:

Didn't you suggest to have uninstalled it in #5 already?

fc-list | grep -i emoji

Other than that, can you share the actual png?

I did uninstalled it, there wasn't a similar error when I ran that command, so I reinstalled it to check it and it returned a specific error, so at least I know it is the emoji font. Also, I think I know why I'm getting that error, I was trying to change an icon that is part of my DE's window manager. In other words, I was trying to change icon of the title bar, that doesn't always work but it was worth giving it a try. The problem is not exactly fixed yet but it's something that doesn't bother me since I was just trying to test out changing the icon and thought it's because of the font as reported in several posts.

Offline

Board footer

Powered by FluxBB