Konsole/kwrite/other freeze when trying to display certain international character (e.g. \u0acb) #58
Offen
vor 2 Jahren von vasekj geöffnet
·
6 Kommentare
Laden…
In neuem Issue referenzieren
Hier gibt es bis jetzt noch keinen Inhalt.
Branch „%!s(<nil>)“ löschen
Das Löschen eines Branches ist permanent. Es KANN NICHT rückgängig gemacht werden. Fortfahren?
Basic information
Description
At least konsole and kwrite freeze when trying to display characters like \u0acb (in UTF-8 \xe0\xab\x8b). It does not apply to all indic characters, for example \u0ab5 works well. Try (in bash in trinity konsole):
Change of the font did not change the situation.
It is not that unprobable to get to that situation even for people not using that language - for example I was investigating, why TDE panel launcher for "pavucontrol" stopped displaying icon after an upgrade from buster to bullseye. During that, I opened the file pavucontrol.desktop, and konsole freezed. The problem was with the line 15 of that file containg Name[gu]
(The same freeze did not happen in KDE konsole 20.12.3 using Qt 5.15.2).
To me it seems suspocious around the line
kernel/qfontengine_x11.cpp:2626 in bool TQOpenType::positionAndAdd
otl_buffer_in_length is always 3 in this case
item->num_glyphs is rewritten to 2 in TQFontEngineXft::stringToCMap
qfontengine_x11.cpp:1702
in static bool indic_shape in qscriptengine_x11.cpp:1848
is infinitely increasing item.num_glyphs by 2 (without any effect on the condition in bool TQOpenType::positionAndAdd, because of bool TQOpenType::positionAndAdd reassignment in bool TQOpenType::positionAndAdd)
Steps to reproduce
It freezes.
Backtrace
of suspicious line
Input:
I use TDE 14.1 on buster
With Dejavu Sans Mono font konsole CPU usage went up to 100%
I changed the font to Noto Mono and it printed fine
For me (on bullseye) it freezes even after switching to Noto Mono. However according to the code, it is probably font dependent. Maybe there is some relevant change to the font between debian releases.
Uhm... Debian bookworm, TDE 14.1-dev, locale utf-8, encoding utf-8. I can't reproduce the problem, I tried 5 or 6 different fonts. All works fine.
Quick try:
Upgraded konsole-trinity and its dependencies to 14.1 (testing repository):
restarted TDE,
still freezes
I forgot to write, that during the freeze, it was looping in
TQTextEngine::shape in kernel/qtextengine_unix.cpp:98-110
where
shape
was returning false because of the line in the backtrace above whereitem->num_glyphs
was always 2 and(int)otl_buffer->in_length
was always 3 as described in the original post. However(int)otl_buffer->in_length
in qtextengine was increasing in each loop.@vasekj thanks for the detailed explanation, I had a look through the backtrace and the code.
We should try to understand why item->num_glyphs is less than (int)otl_buffer->in_length in order to come up with a proper fix. Are you able to dig deeper into this?
If we can't find anything, we may need to bail out from the while loop after too many passes, but we need to understand the effect of it correctly.
I occasionally have konsole freeze when I am in mc and I press some "wrong" key, although I can't yet identify why and what triggers it. It may be the same root cause.