Bug 16257

Summary: Kate or Kwrite crash when opening a newly created text file
Product: Mageia Reporter: Bernard MAUDRY <ramaspaceship>
Component: RPM PackagesAssignee: KDE maintainers <kde>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: mageia, mageia
Version: 5   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: kate-4.14.3-1.mga5.src.rpm CVE:
Status comment:
Attachments: Newly created text file with Dolphin

Description Bernard MAUDRY 2015-06-30 20:12:21 CEST
Description of problem:
Kate or Kwrite crash when opening a newly created text file

Version-Release number of selected component (if applicable):
4.14.3

How reproducible:
Allways

Steps to Reproduce:
1. Create a new text file with Dolphin
2. Open it with Kate or Kwrite
3. see the crash


Reproducible: 

Steps to Reproduce:
Comment 1 Bernard MAUDRY 2015-06-30 20:15:26 CEST
The thread stacks are:
Application: KWrite (kwrite), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7ff0e8358780 (LWP 25760))]

Thread 2 (Thread 0x7ff0cd7ea700 (LWP 25761)):
#0  0x00007ff0e322467f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007ff0d541273a in QTWTF::TCMalloc_PageHeap::scavengerThread() () at /lib64/libQtScript.so.4
#2  0x00007ff0d5412769 in  () at /lib64/libQtScript.so.4
#3  0x00007ff0e321f5bd in start_thread () at /lib64/libpthread.so.0
#4  0x00007ff0e7cbe5cd in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7ff0e8358780 (LWP 25760)):
[KCrash Handler]
#5  0x00007ff0e5a34141 in KSycocaEntry::name() const () at /lib64/libkdecore.so.5
#6  0x00007ff0d5a2538f in Kate::TextBuffer::load(QString const&, bool&, bool&, bool) () at /lib64/libkatepartinterfaces.so.4
#7  0x00007ff0d5a995b6 in KateBuffer::openFile(QString const&, bool) () at /lib64/libkatepartinterfaces.so.4
#8  0x00007ff0d5a8f32c in KateDocument::openFile() () at /lib64/libkatepartinterfaces.so.4
#9  0x00007ff0e7285bda in KParts::ReadOnlyPartPrivate::openLocalFile() () at /lib64/libkparts.so.4
#10 0x00007ff0e7287e2e in KParts::ReadOnlyPart::openUrl(KUrl const&) () at /lib64/libkparts.so.4
#11 0x00007ff0d5a7b1ae in KateDocument::openUrl(KUrl const&) () at /lib64/libkatepartinterfaces.so.4
#12 0x00007ff0e7f8a616 in KWriteApp::init() () at /lib64/libkdeinit4_kwrite.so
#13 0x00007ff0e7f8af17 in KWriteApp::KWriteApp(KCmdLineArgs*) () at /lib64/libkdeinit4_kwrite.so
#14 0x00007ff0e7f89843 in kdemain () at /lib64/libkdeinit4_kwrite.so
#15 0x00007ff0e7be6fd0 in __libc_start_main () at /lib64/libc.so.6
#16 0x000000000040074e in _start ()
Sander Lepik 2015-06-30 20:17:44 CEST

CC: (none) => lmenut, mageia, mageia

Comment 2 Samuel Verschelde 2015-07-01 12:52:18 CEST
Assigning to maintainer.

Assignee: bugsquad => mageia

Comment 3 David Walser 2015-07-01 17:07:37 CEST
It's not reproducible that easily.  Can you give more details on how to reproduce it?

Also, please enable the debug media and install qt4-debuginfo, kdelibs4-debuginfo, and kate-debuginfo and post the backtrace again.
Comment 4 Bernard MAUDRY 2015-07-01 19:53:54 CEST
Created attachment 6795 [details]
Newly created text file with Dolphin
Comment 5 Bernard MAUDRY 2015-07-01 19:54:10 CEST
- Step 1: in Dolphin, right click -> create a new -> text file
- Step 2: open the newly created file with Kate or Kwrite
- Step 3: see the crash


Alternatively, you can open the attached file
Comment 6 Bernard MAUDRY 2015-07-01 20:14:58 CEST
Debug stack trace:
Application: Kate (kate), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fe714056780 (LWP 19932))]

Thread 2 (Thread 0x7fe6f1206700 (LWP 19934)):
#0  0x00007fe7128ee67f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fe704e1e73a in QTWTF::TCMalloc_PageHeap::scavengerThread() (this=0x7fe705121f80 <QTWTF::pageheap_memory>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#2  0x00007fe704e1e769 in QTWTF::TCMalloc_PageHeap::runScavengerThread(void*) (context=<optimized out>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#3  0x00007fe7128e95bd in start_thread () at /lib64/libpthread.so.0
#4  0x00007fe7116625cd in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7fe714056780 (LWP 19932)):
[KCrash Handler]
#6  0x00007fe7131df141 in KSycocaEntry::name() const (this=0x0) at /usr/src/debug/kdelibs-4.14.5/kdecore/sycoca/ksycocaentry.h:154
#7  0x00007fe7131df141 in KSycocaEntry::name() const (this=0x0) at /usr/src/debug/kdelibs-4.14.5/kdecore/sycoca/ksycocaentry.cpp:159
#8  0x00007fe6f618c38f in Kate::TextBuffer::load(QString const&, bool&, bool&, bool) (proberType=<optimized out>, filename=..., this=0x7ffdaafd6090) at /usr/src/debug/kate-4.14.3/part/buffer/katetextloader.h:72
#9  0x00007fe6f618c38f in Kate::TextBuffer::load(QString const&, bool&, bool&, bool) (this=0x1d43e60, filename=..., encodingErrors=@0x1d43f28: false, tooLongLinesWrapped=@0x1d43f29: false, enforceTextCodec=false) at /usr/src/debug/kate-4.14.3/part/buffer/katetextbuffer.cpp:529
#10 0x00007fe6f62005b6 in KateBuffer::openFile(QString const&, bool) (this=0x1d43e60, m_file=..., enforceTextCodec=enforceTextCodec@entry=false) at /usr/src/debug/kate-4.14.3/part/document/katebuffer.cpp:214
#11 0x00007fe6f61f632c in KateDocument::openFile() (this=0x1d43690) at /usr/src/debug/kate-4.14.3/part/document/katedocument.cpp:1970
#12 0x00007fe707ff0bda in KParts::ReadOnlyPartPrivate::openLocalFile() (this=this@entry=0x1d43910) at /usr/src/debug/kdelibs-4.14.5/kparts/part.cpp:591
#13 0x00007fe707ff2e2e in KParts::ReadOnlyPart::openUrl(KUrl const&) (this=this@entry=0x1d43690, url=...) at /usr/src/debug/kdelibs-4.14.5/kparts/part.cpp:555
#14 0x00007fe6f61e21ae in KateDocument::openUrl(KUrl const&) (this=0x1d43690, url=...) at /usr/src/debug/kate-4.14.3/part/document/katedocument.cpp:2332
#15 0x00007fe6fbfc368f in KateDocManager::openUrl(KUrl const&, QString const&, bool, KateDocumentInfo const&) (this=this@entry=0x1b817b0, url=..., encoding=..., isTempFile=isTempFile@entry=false, docInfo=...) at /usr/src/debug/kate-4.14.3/kate/app/katedocmanager.cpp:253
#16 0x00007fe6fbfc3b4c in KateDocManager::openUrls(QList<KUrl> const&, QString const&, bool, KateDocumentInfo const&) (this=0x1b817b0, urls=..., encoding=..., isTempFile=isTempFile@entry=false, docInfo=...) at /usr/src/debug/kate-4.14.3/kate/app/katedocmanager.cpp:228
#17 0x00007fe6fbfd23e1 in KateViewManager::openUrls(QList<KUrl> const&, QString const&, bool, KateDocumentInfo const&) (this=0x1de5f50, urls=..., encoding=..., isTempFile=isTempFile@entry=false, docInfo=...) at /usr/src/debug/kate-4.14.3/kate/app/kateviewmanager.cpp:337
#18 0x00007fe6fbfbbc79 in KateApp::startupKate() (this=0x7ffdaafd6aa0) at /usr/src/debug/kate-4.14.3/kate/app/kateapp.cpp:225
#19 0x00007fe6fbfbcb25 in KateApp::initKate() (this=this@entry=0x7ffdaafd6aa0) at /usr/src/debug/kate-4.14.3/kate/app/kateapp.cpp:135
#20 0x00007fe6fbfbcf30 in KateApp::KateApp(KCmdLineArgs*) (this=0x7ffdaafd6aa0, args=<optimized out>) at /usr/src/debug/kate-4.14.3/kate/app/kateapp.cpp:72
#21 0x00007fe6fc2187b4 in kdemain(int, char**) (argc=-1426235280, argv=0x0) at /usr/src/debug/kate-4.14.3/kate/app/katemain.cpp:377
#22 0x000000000040819a in launch(int, char const*, char const*, char const*, int, char const*, bool, char const*, bool, char const*) (argc=argc@entry=3, _name=_name@entry=0x199da68 "/usr/bin/kate", args=0x199da92 "\001", args@entry=0x199da76 "-b", cwd=cwd@entry=0x199dad6 "/home/bernard", envc=envc@entry=1, envs=<optimized out>, envs@entry=0x199da9a "DISPLAY=:0", reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x199daad "Rama;1435774386;711988;3156_TIME32445985") at /usr/src/debug/kdelibs-4.14.5/kinit/kinit.cpp:726
#23 0x0000000000409021 in handle_launcher_request(int, char const*) (sock=8, who=<optimized out>) at /usr/src/debug/kdelibs-4.14.5/kinit/kinit.cpp:1218
#24 0x000000000040972a in handle_requests(pid_t) (waitForPid=waitForPid@entry=0) at /usr/src/debug/kdelibs-4.14.5/kinit/kinit.cpp:1411
#25 0x0000000000405303 in main(int, char**, char**) (argc=4, argv=<optimized out>, envp=<optimized out>) at /usr/src/debug/kdelibs-4.14.5/kinit/kinit.cpp:1899
Comment 7 Nicolas Lécureuil 2015-08-05 18:44:16 CEST
can you install the debug packages and paste a new backtrace ? this is a null pointer sleeping somewhere.
Comment 8 Bernard MAUDRY 2015-08-09 19:11:54 CEST
Which debug packages?
I already installed the debug packages requested above in comment #3 and put the new stack in comment #6.
Are you able to reproduce this bug with attached file 6795?
Comment 9 Bernard MAUDRY 2015-08-09 20:29:16 CEST
It seems that KMimeType::findByContent (&testMime) return null in that case.
Samuel Verschelde 2016-08-25 16:24:38 CEST

Assignee: mageia => kde

Luc Menut 2016-08-25 16:42:35 CEST

CC: lmenut => (none)

Comment 10 Bernard MAUDRY 2016-11-03 18:16:23 CET
I try by myself to progress on this issue.
I was able to rebuild kate with -O0 -g, but not kdelibs4 (optflags is overwritten in c++ command line).
Can you please tell me what to add in the spec file to build kdelibs4 with -O0 -g?

In addition, can you tell me why Dolphin creates a non empty text file (it contains "\n ") when using the right click menu "Create a new"-> "text file"?
Comment 11 Bernard MAUDRY 2017-02-14 23:13:27 CET
Disappeared

Status: NEW => RESOLVED
Resolution: (none) => FIXED