Summary: | Assert in screen emulation | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Christoph Feck <cfeck> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | aacid, kde, nalvarez |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Christoph Feck
2011-06-29 00:30:41 UTC
There is indeed a problem when rendering the Name[th] for that file This patch seems like it would be the correct thing to do diff --git a/src/Screen.cpp b/src/Screen.cpp index 03a4bbd..acb0303 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -660,10 +660,28 @@ void Screen::displayCharacter(unsigned short c) charToCombineWithY = cuY; } Character& currentChar = screenLines[charToCombineWithY][charToCombineWithX]; - Q_ASSERT((currentChar.rendition & RE_EXTENDED_CHAR) == 0); - const ushort chars[2] = { currentChar.character, c }; - currentChar.rendition |= RE_EXTENDED_CHAR; - currentChar.character = ExtendedCharTable::instance.createExtendedChar(chars, 2); + if ((currentChar.rendition & RE_EXTENDED_CHAR) == 0) + { + const ushort chars[2] = { currentChar.character, c }; + currentChar.rendition |= RE_EXTENDED_CHAR; + currentChar.character = ExtendedCharTable::instance.createExtendedChar(chars, 2); + } + else + { + ushort extendedCharLength; + const ushort* oldChars = ExtendedCharTable::instance.lookupExtendedChar(currentChar.character, extendedCharLength); + Q_ASSERT(oldChars); + if (oldChars) + { + Q_ASSERT(extendedCharLength > 1); + Q_ASSERT(extendedCharLength < 65535); + ushort *chars = new ushort[extendedCharLength + 1]; + memcpy (chars, oldChars, sizeof(ushort) * extendedCharLength); + chars[extendedCharLength] = currentChar.character; + currentChar.character = ExtendedCharTable::instance.createExtendedChar(chars, extendedCharLength); + delete[] chars; + } + } return; } But actually gives a somewhat worse rendering than the old konsole so i have to research a bit how th works and what kind of characters are trying to be composed. I'm a bit busy the coming days so not sure i'll be able of having a look before next monday Booo, the patch is obviously wrong chars[extendedCharLength] = currentChar.character; should be chars[extendedCharLength] = c; Maybe with that it will work better but can not say since i'm away from my compilation machine right now Amarok Master: grep -i nepomuk ./src/core-impl/collections/nepomukcollection/amarok_collection-nepomukcollection.desktop triggers the bug for me. The patch fixes the problem. kate has problems showing that file too. I don't have a debug konsole to test, but this might be enough to crash it: /usr/bin/printf '\u0e2a\u0e37\u0e48\n' It may be worth noting that it seems to be the only character in that .desktop file that has *two* combining diacritics composed over the base character, and the second diacritic is which causes the assertion (I see c=3656 in the backtrace, which is 0x0e48). Nicolas, it was pretty obvious that it was the second combining character causing the assertion ;-) Anyway, i've commited the patch to trunk now, it should be working again, sorry for the delay. |