Bug 329023 - Kate(part) crashes on typing a word then a colon in an existing text document
Summary: Kate(part) crashes on typing a word then a colon in an existing text document
Status: RESOLVED DUPLICATE of bug 328271
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: 3.12.0
Platform: Kubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-20 05:22 UTC by Saurav Sengupta
Modified: 2013-12-21 14:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Backtrace information generated with kate-dbg installed (3.44 KB, text/plain)
2013-12-21 05:17 UTC, Saurav Sengupta
Details
Sample file to reproduce crash (14 bytes, text/plain)
2013-12-21 05:29 UTC, Saurav Sengupta
Details
Sample file tarball to reproduce crash (123 bytes, application/gzip)
2013-12-21 05:34 UTC, Saurav Sengupta
Details
fix_try_01 (887 bytes, patch)
2013-12-21 12:54 UTC, Michal Humpula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Saurav Sengupta 2013-12-20 05:22:45 UTC
I am using Kubuntu 13.10 amd64 with KDE SC 4.12.

After opening an existing plain text document that does not contain programming language source code, typing a word on a new (blank) line and typing a colon (:) immediately following the word causes Kate(part) to crash with a segmentation fault.

The following plugins are enabled in my Kate: Backtrace Browser, Build Plugin, Close Except/Like, GDB, Multiline Tab Bar, Open Header, Project Plugin, Search & Replace, Symbol Viewer, Terminal tool view, Text Filter, XML Completion; and the following extensions are enabled: Exporter, Highlight Selection.

Reproducible: Always

Steps to Reproduce:
1. Open an existing plain text document that does not contain programming language source code.
2. On a new line, type a word followed immediately by a colon symbol (:).
Actual Results:  
Kate(part) crashes.

Expected Results:  
Kate or Katepart should not crash.

Backtrace information generated by the system:-

Application: Kate (kate), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f99b5d037c0 (LWP 3122))]

Thread 3 (Thread 0x7f99a02ec700 (LWP 3123)):
#0  0x00007f99b5630f7d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f99b277d6a4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f99b277d7ac in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f99b3552a76 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007f99b35245ef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x00007f99b35248e5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6  0x00007f99b342388f in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007f99b3505d13 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007f99b3425f2f in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007f99b2c55f6e in start_thread (arg=0x7f99a02ec700) at pthread_create.c:311
#10 0x00007f99b563d9cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 2 (Thread 0x7f999fa55700 (LWP 3125)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f99a31c406b in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#2  0x00007f99a31c40a9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#3  0x00007f99b2c55f6e in start_thread (arg=0x7f999fa55700) at pthread_create.c:311
#4  0x00007f99b563d9cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7f99b5d037c0 (LWP 3122)):
[KCrash Handler]
#5  0x00007f99a38144e0 in KateDocument::defStyleNum(int, int) () from /usr/lib/libkatepartinterfaces.so.4
#6  0x00007f99a383c1b9 in KateScriptDocument::isString(int, int) () from /usr/lib/libkatepartinterfaces.so.4
#7  0x00007f99a37b8f99 in ?? () from /usr/lib/libkatepartinterfaces.so.4
#8  0x00007f99a37ba033 in KateScriptDocument::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkatepartinterfaces.so.4
#9  0x00007f99a322fcc6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#10 0x00007f99a3230e09 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#11 0x00007f99a3231099 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#12 0x00007f99a3136228 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#13 0x00007f99a31140c0 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#14 0x00007f99180bd8a3 in ?? ()
#15 0x0000000000000000 in ?? ()
Comment 1 Michal Humpula 2013-12-20 20:00:57 UTC
Hi Saurav, 

this seems strangly familiar to #328271. So, can you please tell us what highlighting is selected, when you edit the file?
Comment 2 Saurav Sengupta 2013-12-20 20:23:01 UTC
(In reply to comment #1)
> Hi Saurav, 
> 
> this seems strangly familiar to #328271. So, can you please tell us what
> highlighting is selected, when you edit the file?

Highlighting is automatically set to 'None' since the document is a plain text document containing no programming language source code or other markup code.
Comment 3 Michal Humpula 2013-12-20 21:35:36 UTC
Ok, again, we get nowhere:) So I would like to ask two favours of you
1) seems like you have kate from kubuntu repo, so please install the "kate-dbg" package, rerun the crash scenario a repost the backtrace
2) please attach the edited file (whatever causes the crash is good) and ideally describe exact way, where a what type, to cause the crash. I will try to reproduce it again.

And out of curiosity, does this happen in kwrite too?
Comment 4 Saurav Sengupta 2013-12-21 05:17:33 UTC
Created attachment 84209 [details]
Backtrace information generated with kate-dbg installed

Attached the backtrace that was generated by my system with the kate-dbg package (and its dependencies) installed.
Comment 5 Saurav Sengupta 2013-12-21 05:29:42 UTC
Created attachment 84210 [details]
Sample file to reproduce crash

This is a sample file that you can use to reproduce the crash, although the crash will occur with any plain text file.

To reproduce the crash: -
1. Go to the blank line (line no. 2) between Line 1 and Line 3. Make sure there is no whitespace there.
2. Type any word (single word, i.e., character string with no whitespace), e.g., Hello, and immediately at the end of the word type a colon symbol (:), so that the final result ought to be, e.g., Hello:
3. The colon character does not appear/stay. Instead, as soon as you type the colon symbol, the editor crashes.
Comment 6 Saurav Sengupta 2013-12-21 05:34:38 UTC
Created attachment 84211 [details]
Sample file tarball to reproduce crash

I'm sorry, I didn't know that this KDE Bug system does not provide a downloadable file if a text file is attached. So, I am attaching a tarball containing the same text file, though I don't know if even this will be downloadable (but it should be).
Comment 7 Saurav Sengupta 2013-12-21 05:42:10 UTC
(In reply to comment #3)
> Ok, again, we get nowhere:) So I would like to ask two favours of you
> 1) seems like you have kate from kubuntu repo, so please install the
> "kate-dbg" package, rerun the crash scenario a repost the backtrace

Done, but I'm not sure if there's any difference in the backtraces.

> 2) please attach the edited file (whatever causes the crash is good) and
> ideally describe exact way, where a what type, to cause the crash. I will
> try to reproduce it again.

Please download the tarball from Comment #6 and extract the sample text file from it, then follow the procedure given in Comment #5.

> And out of curiosity, does this happen in kwrite too?

Yes, this happens in KWrite too. It happens in any application that uses the same editor as Kate, including KDevelop.
Comment 8 Michal Humpula 2013-12-21 12:53:30 UTC
Hm, I couldn't reproduce the your crash, but found another one few lines after your place:) Seems like the hightlight is a little bit on sloppy side.

But, looking at the code with your backtrace I think I found an error, which proves that saying "I don't need to write tests, I have compiled language" is totaly wrong.

So, attached you find a patch, which should fix your crash. You still might hit the one I'm hitting (but I had to do some crazy switching to get there). If that's the case, please post new backtrace:)

You can compile from source repository (see http://kate-editor.org/get-it/) or do it the Debian way:
apt-get source kate
sudo apt-get build-dep kate
cd kate-4*
patch -p1 < path_to_patch.patch
dpkg-buildpackage -us -uc -b
sudo dpkg -i ../katepart_*.deb
Comment 9 Michal Humpula 2013-12-21 12:54:52 UTC
Created attachment 84213 [details]
fix_try_01
Comment 10 Dominik Haumann 2013-12-21 14:34:17 UTC
Can we move the discussion to  bug #328271 ?

*** This bug has been marked as a duplicate of bug 328271 ***