Summary: | Crash when replacing new lines with spaces | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | John Salatas <jsalatas> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | kdebugs, nate, samjnaa, simonandric5 |
Priority: | NOR | Keywords: | drkonqi |
Version: | 17.04.2 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/ktexteditor/c90064799dfb9afa7e5da20eb15856f486a171a3 | Version Fixed In: | 5.50 |
Sentry Crash Report: |
Description
John Salatas
2017-06-10 22:08:39 UTC
I could reproduce with 'kwrite' but not with 'kate'. After closing the replace bar using Esc, the statusbar still says 'Line 5', despite the cursor forcefully being moved to line 1 (the only line remaining after the replace). (In reply to Christoph Feck from comment #1) > I could reproduce with 'kwrite' but not with 'kate'. > > After closing the replace bar using Esc, the statusbar still says 'Line 5', > despite the cursor forcefully being moved to line 1 (the only line remaining > after the replace). It still happens to me. Please notice the following: 1) if mode is in "regular expression" it works ok (aka no crash). The crash happens only in "Escape Sequences" mode. 2) the crash happens when there at least on empty line in the end of the document. So (visualizing new line characters) a\n b\n c\n d\n crashes a\n b\n c\n d doesn't crash I confirm that it also happens in kwrite as well. Just created a patch review which tries to fix it https://phabricator.kde.org/D6473 Confirmed, with an empty line at the end of the document. Backtrace: Thread 1 (Thread 0x7fc97eaec980 (LWP 8039)): [KCrash Handler] #9 0x00007fc978deb7d9 in qt_assert(char const*, char const*, int) () from /usr/lib64/libQt5Core.so.5 #10 0x00007fc97e4843a4 in KateViewInternal::cursorUp (this=0x11ca5f0, sel=false) at /home/dh/kde/kf5/src/frameworks/ktexteditor/src/view/kateviewinternal.cpp:1587 #11 0x00007fc97e47644a in KTextEditor::ViewPrivate::up (this=0xc3e1f0) at /home/dh/kde/kf5/src/frameworks/ktexteditor/src/view/kateview.cpp:2846 Indeed, the cursor is at an invalid text position. Fixed for KDE Frameworks 5.50. - https://phabricator.kde.org/D14847 - https://phabricator.kde.org/R39:c90064799dfb9afa7e5da20eb15856f486a171a3 - https://commits.kde.org/ktexteditor/c90064799dfb9afa7e5da20eb15856f486a171a3 Git commit c90064799dfb9afa7e5da20eb15856f486a171a3 by Dominik Haumann. Committed on 14/08/2018 at 16:24. Pushed by dhaumann into branch 'master'. Fix crash when replacing \n around empty lines Summary: The problem is that QString("").startsWith("") returns false. Similarly, QString("").endsWith("") also returns false. However, the code previously was assuming that both cases return true. This is now fixed, and verified through unit tests. This deprecates patch D6473 Test Plan: make && make test Reviewers: jsalatas, ltoscano, kfunk, cullmann, anthonyfieroni, mwolff Reviewed By: cullmann Subscribers: kwrite-devel, kde-frameworks-devel Tags: #kate, #frameworks Differential Revision: https://phabricator.kde.org/D14847 M +40 -1 autotests/src/searchbar_test.cpp M +3 -0 autotests/src/searchbar_test.h M +7 -2 src/search/kateplaintextsearch.cpp https://commits.kde.org/ktexteditor/c90064799dfb9afa7e5da20eb15856f486a171a3 *** Bug 394545 has been marked as a duplicate of this bug. *** *** Bug 386512 has been marked as a duplicate of this bug. *** *** Bug 365642 has been marked as a duplicate of this bug. *** |