Bug 158226 - [testcase] Kate doesn't respond after opening file in encoding CP1251. (QTextEngine::shapeTextWithHarfbuzz)
Summary: [testcase] Kate doesn't respond after opening file in encoding CP1251. (QText...
Status: RESOLVED UPSTREAM
Alias: None
Product: kate
Classification: Applications
Component: encoding (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-22 14:51 UTC by Eldar Insafutdinov
Modified: 2011-08-08 12:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eldar Insafutdinov 2008-02-22 14:51:41 UTC
Version:            (using KDE 4.0.1)
Installed from:    Ubuntu Packages
OS:                Linux

Kate doesn't respond after opening file in encoding CP-1251. If encoding is not specified (for example, when drag'n'drop from file manager - UTF-8 is by default). "Broken UTF-8 File Opened - Kate"-dialog appears. Application doesn't respond, it's nesessary to restart it.
Comment 1 Kay Abendroth 2008-04-06 20:23:59 UTC
I could not verify this behaviour with Kate 3.0.3 (KDE 4.0.3). Can you check this again with latest kate-kde4 Ubuntu package?
Comment 2 Eldar Insafutdinov 2008-04-09 07:36:57 UTC
With the last version - KDE 4.0.3 - everything is okey.
Comment 3 Dominik Haumann 2008-04-17 13:41:26 UTC
Well, if it works, close it. If you run into it again, please reopen.
Comment 4 Jonathan Thomas 2008-12-24 03:56:56 UTC
I can reproduce this in KDE 4.1.85 by opening the attached html file in the downstream bug (https://launchpad.net/bugs/269933) in kate.
Comment 5 Dario Andres 2009-01-01 04:24:38 UTC
Here using:

I can reproduce the hang with the testcase file (comment 4) when navigating to the middle of the file..

Here is the backtrace when I pressed Ctrl+C in GDB to stop the hang:

Starting program: /home/kde-devel/kde/bin/kwrite 
[Thread debugging using libthread_db enabled]
[New Thread 0x7f5c8197d750 (LWP 5638)]

Program received signal SIGINT, Interrupt.
[Switching to Thread 0x7f5c8197d750 (LWP 5638)]
0x00007f5c7dd93c39 in memset () from /lib/libc.so.6
#0  0x00007f5c7dd93c39 in memset () from /lib/libc.so.6
No symbol table info available.
#1  0x00007f5c7f1ac140 in QTextEngine::shapeTextWithHarfbuzz (this=0x11e06f0, item=<value optimized out>)
    at text/qtextengine.cpp:1225
	shaper_item = {string = 0x7f5c71cc202a, stringLength = 234258, item = {pos = 2069, length = 9, 
    script = HB_Script_Common, bidiLevel = 0 '\0'}, font = 0x114e900, face = 0x115a2b0, shaperFlags = 0, 
  glyphIndicesPresent = 1 '\001', initialGlyphCount = 9, num_glyphs = 349323, glyphs = 0x0, attributes = 0x0, 
  advances = 0x0, offsets = 0x0, log_clusters = 0x0, kerning_applied = 0 '\0'}
	engineIdx = 0
	g = <value optimized out>
	hb_glyphs = {a = 349323, s = 349323, ptr = 0x7f5c70f87010, {
    array = '\0' <repeats 21 times>, "@\217�\000\000\000\000\000@\217�\000\000\000\000\0008�@\000\000\000\000\000X�@��\032\001\000\000\000\000�ë\211�\177\000\0009\000 \003\000\000\000\000\220\001\000\000\000\000\000\000\000��\000\000\000\000\000\020\000\000\000\000\000\000\000\000��\000\000\000\000\000(\000\000\000\000\000\000\000`�\032\001\000\000\000\000���}\\\177\000\000\000��\000\000\000\000\000<j�~\\\177\000\000�l�~\\\177\000\000@3\036\001\000\000\000\000 c�\000\000\000\000\000P\223\036\001\000\000\000\000�c�\000\000\000\000\000\220̫\211�\177\000\000\001\000\000\000\000\000\000\000\235\027\026\177\\\177\000\000P\223\036"..., q_for_alignment_1 = 0, 
    q_for_alignment_2 = 0}}
	hb_attributes = {a = 349323, s = 349323, ptr = 0x7f5c70e31010, {
    array = '\0' <repeats 16 times>, "\001\000\000\000\000\000\000\0000�\233", '\0' <repeats 19 times>, "3@\001", '\0' <repeats 20 times>, "�\210@\000\000\000\000\000\0003@\001\000\000\000\000\000\000\0000�\233\000\000\000\000\000\000\000\000\000\000�\210@ �\027\001\000\000\000\000\001\000\000\000\000\000\000\000@\027\036\001\000\000\000\000\001\000\000\000\000\000\000\000 ǫ\211�\177\000\000�H�\000\000\000\000\000Pƫ\211�\177\000\000\001\000\000\000\000\000\000\000���}\\\177\000\000�ʫ\211�\177\000\000�P\026\177\\\177\000\000\002\000\000\000\000\000\000\000\220�\233\000\000\000\000\000p��\211�\177\000\000\000\000\000\000\000\000\000\000p"..., 
    q_for_alignment_1 = 0, q_for_alignment_2 = 0}}
	hb_advances = {a = 349323, s = 349323, ptr = 0x7f5c70cdb010, {
    array = "\001\000\000\000��\000\000\000\000\000\000\000\000\000\000��\211�\177\000\000p��\211�\177\000\000\000\000\000\000\000\222�@\000\000\000\000\000\000*@\000\000\000\000\000\000\000\000�?�q\\\177\000\000��\211�\177\000\000\r�\r\177\\\177\000\000\000�\211�\177\000\000XU\v\177\\\177\000\000��\211�\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000��\000\000\020e\006\001", '\0' <repeats 20 times>, "�?�q\\\177\000\000\222\032\000\000\000\000\000\000\220\n�q\\\177\000\000���}\\\177\000\000��\211�\177\000\000\214\202\033\177\\\177\000\000\000\000\000\000\000\000)@\037\205�Q�\032{@H�"..., q_for_alignment_1 = 281470681743361, 
    q_for_alignment_2 = 1.3906499416090962e-309}}
	hb_offsets = {a = 349323, s = 349323, ptr = 0x7f5c70a30010, {
    array = " c�", '\0' <repeats 13 times>, "\001\000\000\000\000\000\000\000\020��\211�\177\000\000\000\001\000\000\005\000\000\000\020��\211�\177\000\000\000\000\000\000\000\000;@\000\000\000\000\000p{@\000\000\000\000\000�\211@\000\000\000\000\000p{@\000\000\000\000\000�\211@\000\000\000\000\000�|@\000\000\000\000\000\000;@\000\000\000\000\000�|@\000\000\000\000\000\000;@\000\000\000\000\000p{@�H�\000\000\000\000\000\002", '\0' <repeats 15 times>, "\200��\000\000\000\000\000\000\001\000\000\r\000\000\000\220��\211�\177\000\000�\v\000\000�\v\000\000�\v\000\000�\v\000\000�\v\000\000�\v\000\000�\v\000\000�\v\000\000"..., q_for_alignment_1 = 13460256, 
    q_for_alignment_2 = 6.6502500738285138e-317}}
	actualFontEngine = <value optimized out>
	k = <value optimized out>
	si = (QScriptItem &) @0x1300e40: {position = 2069, analysis = {script = 0, bidiLevel = 0, flags = 0}, 
  num_glyphs = 0, descent = {val = 320}, ascent = {val = 832}, width = {val = -64}, glyph_data_offset = 2069}
	font = (class QFontEngine *) 0x114e490
	kerningEnabled = true
	upperCased = {0, 0, 0, 0, 0, 0, 0, 0, 60608, 32651, 32604, 0, 0, 0, 0, 0, 27840, 32483, 32604, 0, 0, 
  0, 0, 16368, 19776, 279, 0, 0, 0, 0, 0, 0, 27840, 32483, 32604, 0, 0, 0, 0, 0, 60752, 255, 0, 0, 53248, 
  35243, 32767, 0, 60608, 32651, 32604, 0, 0, 0, 0, 0, 5952, 286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65136, 286, 
  0, 0, 528, 0, 0, 0, 1024, 0, 0, 0, 528, 0, 0, 0, 62052, 32221, 32604, 0, 528, 0, 0, 0, 27232, 32262, 32604, 
  0, 16384, 2, 0, 0, 62441, 32216, 32604, 0, 1040, 0, 0, 0, 50997, 32216, 32604, 0, 1, 2, 0, 0, 27248, 32262, 
  32604, 0, 64, 0, 0, 0, 48, 2, 0, 0, 1, 2, 0, 0, 40208, 1, 0, 0, 27840, 32483, 32604, 0, 4095, 0, 0, 0, 
  53040, 35243, 32767, 0, 1776, 286, 0, 0, 40088, 341, 0, 0, 57454, 32539, 32604, 0, 65535, 32767, 0, 0, 
  53216, 35243, 32767, 0, 89, 0, 0, 0, 52896, 35243, 32767, 0, 52800, 35243, 32767, 0, 16216, 33095, 32604, 
  0, 44112, 33128, 32604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0...}
	hb_initial_glyphs = {a = 349323, s = 349323, ptr = 0x13ffe00, {
    array = "\000\000\000\000\000\000\000\000�h�x\\\177\000\000\000\000\000\000\000\000\000\0000�\233", '\0' <repeats 13 times>, "\220ɫ\211�\177\000\000�ɫ\211�\177\000\000Rv�x\\\177\000\000\001\000\000\000\000\000\000\000Rv�x", '\0' <repeats 20 times>, "�ɫ\211�\177\000\000\000\000\000\000\000\000\000\000�ɫ\211�\177\000\0000�\233", '\0' <repeats 13 times>, "0ʫ\211�\177\000\000H�\233", '\0' <repeats 21 times>, "�h�x\\\177\000\000�ɫ\211�\177\000\0000�\233", '\0' <repeats 13 times>, "0ʫ\211�\177\000\000`ʫ\211�\177\000\000Rv�x\\\177\000\000\001\000\000\000\000\000"..., q_for_alignment_1 = 0, q_for_alignment_2 = 0}}
	itemBoundaries = {a = 256, s = 2, ptr = 0x7fff89abc460, {
    array = "\025\b", '\0' <repeats 14 times>, "0ū\211�\177\000\000\000\000\000\000\000\000\000\000@ū\211�\177\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\220�\233\000\000\000\000\000 ū\211�\177\000\000\000\000\000\000\000\000\000\000 ū\211�\177\000\000\027!�|\\\177\000\0000ū\211�\177\000\000Pū\211�\177\000\000 ū\211�\177\000\0000ū\211�\177\000\000@ū\211�\177\000\000\020ū\211�\177\000\000Pū\211�\177\000\000 ū\211�\177\000\000`ū\211�\177\000\0000ū\211�\177", '\0' <repeats 18 times>, "�p\235\000\000\000\000\0000�\233\000\000\000\000\000�\217\233\000"..., q_for_alignment_1 = 2069, 
    q_for_alignment_2 = 1.0222218212455391e-320}}
	initial_glyph_pos = 0
	glyph_pos = 0
#2  0x00007f5c7f1acc6f in QTextEngine::shapeText (this=0x11e06f0, item=148) at text/qtextengine.cpp:864
	glyphs = <value optimized out>
	end = <value optimized out>
	font = {static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x7f5c7f581540 "QFont", 
      data = 0x7f5c7f581600, extradata = 0x0}}, d = 0xe04a00, resolve_mask = 0}
	letterSpacingIsAbsolute = <value optimized out>
#3  0x00007f5c7f1acfe5 in QTextEngine::shape (this=0x11e06f0, item=148) at text/qtextengine.cpp:1359
No locals.
#4  0x00007f5c7f1b40a9 in QTextLine::layout_helper (this=0x7fff89abd1e0, maxGlyphs=2147483647)
    at text/qtextlayout.cpp:1588
	line = (QScriptLine &) @0x114f500: {descent = {val = 320}, ascent = {val = 832}, x = {val = 0}, y = {
    val = 0}, width = {val = 536870848}, textWidth = {val = 1058816}, from = 0, length = 2068, justified = 0, 
  gridfitted = 0, hasTrailingSpaces = 0}
	wrapMode = <value optimized out>
	breakany = false
	manualWrap = false
	item = 1048576
	newItem = 148
	minw = {val = 30208}
	glyphCount = 2069
	tmpData = {descent = {val = 320}, ascent = {val = 832}, x = {val = 0}, y = {val = 0}, width = {
    val = 0}, textWidth = {val = 0}, from = 0, length = 0, justified = 0, gridfitted = 0, 
  hasTrailingSpaces = 0}
	attributes = (const <anonymous struct> *) 0x7f5c710dd010
	pos = 2069
	end = 2069
	glyphs = (const QGlyphLayout *) 0x7f5c7124249c
	logClusters = (const short unsigned int *) 0x7f5c711c1c60
#5  0x00007f5c7f1b4ce9 in QTextLayout::createLine (this=0x11534a0) at text/qtextlayout.cpp:746
	l = 1
	from = <value optimized out>
	strlen = <value optimized out>
#6  0x00007f5c769232b6 in KateRenderer::layoutLine (this=0xbecfa0, lineLayout={d = 0x7fff89abd3a0}, 
    maxwidth=-1, cacheLayout=<value optimized out>)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/render/katerenderer.cpp:808
	line = {i = 0, eng = 0x11e06f0}
	textLine = {d = 0xcb0600}
	l = <value optimized out>
	opt = {align = 1, wordWrap = 4, design = 0, direction = 0, unused = 0, f = 2147483648, tab = 64, 
  d = 0x0}
	height = 19
	shiftX = 0
	needShiftX = false
#7  0x00007f5c7692a8b5 in KateLayoutCache::line (this=0xbef390, realLine=27, virtualLine=27)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/render/katelayoutcache.cpp:303
	l = {d = 0x109dc60}
#8  0x00007f5c7692ba33 in KateLayoutCache::updateViewCache (this=0xbef390, startPos=@0x114d8d0, 
    newViewLineCount=19, viewLinesScrolled=1)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/render/katelayoutcache.cpp:258
	virtualLine = 27
	i = 18
	oldViewLineCount = 19
	realLine = 27
	_viewLine = 1
	l = {d = 0x114d8d0}
#9  0x00007f5c76980a1c in KateViewInternal::doUpdateView (this=0xbee3d0, changed=false, viewLinesScrolled=1)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/view/kateviewinternal.cpp:568
	blocked = false
	maxStart = {_vptr.Cursor = 0x0, m_line = 2124976690, m_column = 32604, m_range = 0x8}
	maxLineScrollRange = <value optimized out>
#10 0x00007f5c769811fc in KateViewInternal::updateView (this=0xbee3d0, changed=false, viewLinesScrolled=1)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/view/kateviewinternal.cpp:547
	lock = {{mtx = 0xba2eb1, val = 12201649}}
#11 0x00007f5c76982ce1 in KateViewInternal::scrollPos (this=0xbee3d0, c=@0x7fff89abd780, 
    force=<value optimized out>, calledExternally=false)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/view/kateviewinternal.cpp:501
	scrollHeight = <value optimized out>
	lines = 18
	limit = {_vptr.Cursor = 0x7f5c8168ac50, m_line = 14, m_column = 0, m_range = 0x0}
	viewLinesScrolled = 1
#12 0x00007f5c769833ba in KateViewInternal::scrollLines (this=0xbee3d0, line=<value optimized out>)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/view/kateviewinternal.cpp:375
	newPos = {_vptr.Cursor = 0x7f5c8168ac50, m_line = 8, m_column = 0, m_range = 0x0}
#13 0x00007f5c76987dab in KateViewInternal::qt_metacall (this=0xbee3d0, _c=QMetaObject::InvokeMetaMethod, 
    _id=<value optimized out>, _a=0x7fff89abd8d0)
    at /home/kde-devel/kde/build/KDE/kdelibs/kate/kateviewinternal.moc:124
No locals.

---

Seems to be a QT bug. Should this be reported upstream?
Comment 6 Matthew Woehlke 2009-01-14 02:54:03 UTC
I notice both this and bug 178789 talk about cp1251... might they be related?
Comment 7 Dario Andres 2009-05-08 23:22:44 UTC
Seems to be still valid here using:

Qt: 4.5.1 (qt-copy  960517)
KDE: 4.2.71 (KDE 4.2.71 (KDE 4.3 >= 20090428))
kdelibs svn rev. 963904 / kdebase svn rev. 963904
on ArchLinux i686 - Kernel 2.6.29.1
Comment 8 Milian Wolff 2010-10-31 13:40:33 UTC
shouldn't this be reported upstream to Qt/Nokia?
Comment 9 Dominik Haumann 2011-08-08 12:51:06 UTC
This works for me in the development version.
The problem in this file is that it has one very loooong line. And Qt has to completely layout this line (due to bidi suppoert) in order to be able to display it.

We have a workaround for that in the development version: Here, lines are automatically wrapped at column ~1024 and the user is notified in KDE >=4.8.

Then, nothing crashes and Kate/KWrite keeps to be responsive, especially when dynamic word wrap is turned off.

As it's a known issue and partly solved through these workarounds, and since it's partly a known issue in Qt, we close this report.