Summary: | Python code, paste method class, modify a little, collapse it, try to reload file, crash | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Tomasz Narloch <tomas.h> |
Component: | folding | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | adrian.lungu89, tomas.h |
Priority: | VHI | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.8.2 | |
Sentry Crash Report: | |||
Attachments: |
New crash information added by DrKonqi
./run.sh valgrind --track-origins=yes --num-callers=25 kate 2>~/katelogs3.txt File that I open by fish protocol and genarate a problem on reload |
Description
Tomasz Narloch
2012-02-29 15:32:24 UTC
can you reproduce this? please give us some code snippets that trigger this behavior btw: kate bug Note: compiled from soruces: so this is basically Kate from KDE 4.8. A way to reproduce is *very* important. Created attachment 69187 [details]
New crash information added by DrKonqi
kate (3.6.5) on KDE Platform 4.6.5 (4.6.5) using Qt 4.7.2
- What I was doing when the application crashed:
Open file by fish protocol, collapsed one method of python class and tried to reload file, then crash
-- Backtrace (Reduced):
#11 0x00007fe6e7883bf1 in KateCodeFoldingTree::applyFoldingState (this=0x26efc00) at /home/tomek2/kde/kate/part/syntax/katecodefolding.cpp:1636
#12 0x00007fe6e777ac34 in KateCodeFoldingTree::qt_metacall (this=0x26efc00, _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7fffc4add7c0) at /home/tomek2/kde/build/part/moc_katecodefolding.cpp:106
[...]
#14 0x00007fe6f52d9277 in KTextEditor::Document::reloaded (this=0x26ef070, _t1=0x26ef070) at /home/tomek2/kde/build/ktexteditor/document.moc:236
#15 0x00007fe6e77fa281 in KateDocument::documentReload (this=0x26ef070) at /home/tomek2/kde/kate/part/document/katedocument.cpp:3972
#16 0x00007fe6e7893f61 in KateView::reloadFile (this=0x298a780) at /home/tomek2/kde/kate/part/view/kateview.cpp:1087
Created attachment 69188 [details]
./run.sh valgrind --track-origins=yes --num-callers=25 kate 2>~/katelogs3.txt
Created attachment 69189 [details]
File that I open by fish protocol and genarate a problem on reload
When I copy this file to my disk then the problem not exists.
When I use this file by fish protocol, then after click on reload => CRASH.
This is because the file loading is asynchronous: For a certain amount of time, the document is empty. At this time, the folding tree tries to apply the saved folding state. And this hits the Q_ASSERT. Somehow, the delay needs to be taken into account. Git commit daf0b4b637d9a7ecf83b3c143d90b11fef53c46f by Dominik Haumann. Committed on 20/03/2012 at 20:40. Pushed by dhaumann into branch 'master'. do not crash if restoring the folding state is impossible FIXED-IN: 4.8.2 M +6 -4 part/syntax/katecodefolding.cpp http://commits.kde.org/kate/daf0b4b637d9a7ecf83b3c143d90b11fef53c46f The solution is not to simply not restore the folding state, if there is a delay due to remove file loading. This also fixes the following problem: 1. fold nodes 2. close kate 3. delete some lines of the file 4. open kate again in 4. Kate always crashes, as it tries to restore the folds, but this is not possible, as the file changed... |