Summary: | Crash on various occasions | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Stefan Nikolaus <stefan.nikolaus> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | abyss.7, sgh |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
A cpp file that causes kate to crash.
a valgrind log showing the crash. possible fix |
Description
Stefan Nikolaus
2006-10-03 15:29:07 UTC
> On 2006-09-10: SVN commit 582742 by amantia:
>
> Commit the QXIMInputContext crash workaround at higher level, so not only
> KDevelop is protected, but other katepart using applications as well.
This bug may be fixed, but I'm unsure as you use kde-devel version (bug report says kate 2.5.5, 3.5 branch). When did you svn up the last time? Before or after 10th of september?
SVN rev. 591511. That's after 2006-10-02. Before going to bed yesterday night started an overnight updated with kdesvn-build. And got the crash since then. Kate 2.5.5 I use kdevelop and kate every day. This is a new bug. Also, It only crashes on certain files. I can send in the crashy cpp-file for you if you like. Just give me an adress. Jonas, can you attach the test file to this bug report? Otherwise, just send me a mail. If you know exactly how to reproduce, please tell us. A valgrind trace would help, too. Created attachment 18017 [details]
A cpp file that causes kate to crash.
I'll attach a valgrind trace when it's ready.
Also, I am not sure what revision number I am running right now because I
updated to kdebase that doesn't compile. I'll report later.
Created attachment 18018 [details]
a valgrind log showing the crash.
This is:
URL: svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kdebase/kate
Repository Root: svn://anonsvn.kde.org/home/kde
Repository UUID: 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Revision: 592671
And the crash is 100% consistently reproduced like this:
I have a default session including ONLY parsergrammar.cpp
I click with the mouse anywhere in that document, which always leads to the
crash.
Happy hunting ;)
I got some more crash reproduction info. The crash occurs if you save a file starting with a blank line, close the file reopen it. Click it somewhere (not on the first line) or navigate with keyboard somewhere off that first blank line, and kate crashes. It doesn't happen if there is at least one character on the first line. just for your information, the same crash occurs in kwrite too: ==22741== Invalid read of size 2 ==22741== at 0x40527C6: QChar::QChar(QChar const&) (qstring.h:270) ==22741== by 0x7034E1F: KateRenderer::textWidth(KSharedPtr<KateTextLine> const&, int) (katerenderer.cpp:766) ==22741== by 0x7015BAE: KateViewInternal::updateMicroFocusHint() (kateviewinternal.cpp:886) ==22741== by 0x7018A34: KateViewInternal::updateCursor(KateTextCursor const&, bool, bool, bool) (kateviewinternal.cpp:2169) ==22741== by 0x701A0CB: KateViewInternal::placeCursor(QPoint const&, bool, bool) (kateviewinternal.cpp:2377) ==22741== by 0x701A791: KateViewInternal::mousePressEvent(QMouseEvent*) (kateviewinternal.cpp:2699) ==22741== by 0x4E79F32: QWidget::event(QEvent*) (in /home/jonas/kdesvn/build/qt-copy/lib/libqt-mt.so.3.3.6) ==22741== by 0x4DE3666: QApplication::internalNotify(QObject*, QEvent*) (in /home/jonas/kdesvn/build/qt-copy/lib/libqt-mt.so.3.3.6) ==22741== by 0x4DE4548: QApplication::notify(QObject*, QEvent*) (in /home/jonas/kdesvn/build/qt-copy/lib/libqt-mt.so.3.3.6) ==22741== by 0x4977728: KApplication::notify(QObject*, QEvent*) (kapplication.cpp:550) ==22741== by 0x4D835C8: QETWidget::translateMouseEvent(_XEvent const*) (in /home/jonas/kdesvn/build/qt-copy/lib/libqt-mt.so.3.3.6) ==22741== by 0x4D824D6: QApplication::x11ProcessEvent(_XEvent*) (in /home/jonas/kdesvn/build/qt-copy/lib/libqt-mt.so.3.3.6) ==22741== Address 0x0 is not stack'd, malloc'd or (recently) free'd I CANNOT confirm, that the crash does not occur, if there's one character in the first line at least. And I was able to keep working all day and night without problems as long as the first line isn't blank. Created attachment 18033 [details]
possible fix
can you please try the attached patch? I can not reproduce this crash at all,
so there is no way for me to try this...
*** Bug 135169 has been marked as a duplicate of this bug. *** It's 100% reproductible bug - kate crashes when the first line of opened file is empty - no matter if it's html, txt or something else. If you put some characters (even one) in the first line then kate doesn't crash, even when you delete all the characters from the first line later. Kate crashes only when you open the file with empty first line of file and you try to search through file or navigate with arrows to the end of lines or to lines which are wrapped to the next line. gdb points to KateRenderer::textWidth() And it's KDE 3.5.5 related. I've observed crashes also for files not beginning with an empty line. Anyway, since I installed the patch (17:45), I haven't encountered one. I can reproduce the crash and the patch seems to be correct. SVN commit 593300 by dhaumann: fix crash that makes katepart pretty unusable. Please retag for KDE 3.5.5 - thanks & sorry for the hassle. BUG: 135045 M +1 -1 katerenderer.cpp --- branches/KDE/3.5/kdelibs/kate/part/katerenderer.cpp #593299:593300 @@ -763,7 +763,7 @@ x += width; - if (unicode[z] == QChar('\t')) + if (z < len && unicode[z] == QChar('\t')) x -= x % width; } *** Bug 136451 has been marked as a duplicate of this bug. *** |