Bug 178789 - Editor crash while trying to open text file and selecting encoding: cyrilic autodetect (KateFileLoader::open)
Summary: Editor crash while trying to open text file and selecting encoding: cyrilic a...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: unspecified
Platform: unspecified Linux
: VHI crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 184646 187488 192107 193452 193833 194091 194783 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-26 11:05 UTC by Bazilio
Modified: 2009-05-31 22:33 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
file that crash editor (3.06 KB, text/plain)
2008-12-26 11:07 UTC, Bazilio
Details
krusader crash report (3.75 KB, application/octet-stream)
2008-12-27 11:30 UTC, Bazilio
Details
kate crash report (1.06 KB, application/octet-stream)
2008-12-27 11:32 UTC, Bazilio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bazilio 2008-12-26 11:05:12 UTC
Version:           3.1.85 (using 4.1.85 (KDE 4.1.85 (KDE 4.2 Beta2)), Kubuntu packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.27-11-generic

Using Kubuntu 8.10 Kde 4.2 beta2 with all updates. Editor (Kwrite, Kate) crash, while trying to open file for view or edit. (text file including php code) I can't attach this file, so i give a link to it: http://www.recast1.com/trash/file_that_crash_editor (Use 'save as' instead of click)
Comment 1 Bazilio 2008-12-26 11:07:24 UTC
Created attachment 29636 [details]
file that crash editor
Comment 2 Dario Andres 2008-12-26 12:41:52 UTC
Here using:

Qt: 4.4.3
KDE: 4.1.86 (KDE 4.1.86 (KDE 4.2 >= 20081221))
kdelibs svn rev. 901624 / kdebase svn rev. 901624
on ArchLinux x86_64 - Kernel 2.6.27.10

I can't reproduce the crash. Kate (and KWrite) only complains about the file being UTF-8 with some invalid encoded characters, but they don't crash.
Comment 3 FiNeX 2008-12-26 13:47:40 UTC
Hi! If you can reproduce the crash, you should install the debug enabled
packages and provide a backtrace too. Read this page for the instructions:

http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports

Thanks!

P.S: This bug is probably related to: bug #178788
Comment 4 Bazilio 2008-12-27 11:30:28 UTC
Created attachment 29669 [details]
krusader crash report

I instaled krusader-dbg and reproduce the bug
Comment 5 Bazilio 2008-12-27 11:32:59 UTC
Created attachment 29670 [details]
kate crash report

maybe it is the same as krusader crash report...
Comment 6 FiNeX 2008-12-27 11:59:27 UTC
Backtrace from comment #4:


Приложение: Krusader (krusader), сигнал SIGSEGV

Thread 1 (Thread 0xb5cea8d0 (LWP 10722)):
[KCrash Handler]
#6  0x8005759f in KateFileLoader::open (this=0xbff8bbec) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:180
#7  0x80053f4d in KateBuffer::openFile (this=0xa6c64c8, m_file=@0xbff8bf14) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:529
#8  0x80035dd5 in KateDocument::openFile (this=0x9d1ddf8) at /build/buildd/kde4libs-4.1.85/kate/document/katedocument.cpp:3366
#9  0xb7dfcb4a in KParts::ReadOnlyPart::openUrl (this=0x9d1ddf8, url=@0xa60ac00) at /build/buildd/kde4libs-4.1.85/kparts/part.cpp:558
#10 0x08202ce7 in PanelViewer::openUrl (this=0xa60abe0, url=@0xbff8c108, mode=KrViewer::Generic) at /build/buildd/krusader-2.0~svn6078/krusader/KViewer/panelviewer.cpp:98
#11 0x081fd4c0 in KrViewer::view (url={<QUrl> = {d = 0xbff8c108}, d = 0x0}, mode=KrViewer::Generic, new_window=<value optimized out>, parent=0xbff8d59c)
    at /build/buildd/krusader-2.0~svn6078/krusader/KViewer/krviewer.cpp:277
#12 0x081fd713 in KrViewer::view (url={<QUrl> = {d = 0xbff8c17c}, d = 0xbff8d59c}, parent=0xbff8d59c) at /build/buildd/krusader-2.0~svn6078/krusader/KViewer/krviewer.cpp:270
#13 0x080b7f7e in ListPanelFunc::view (this=0xa3308f8) at /build/buildd/krusader-2.0~svn6078/krusader/Panel/panelfunc.cpp:366
#14 0x080b19a3 in KRslots::qt_metacall (this=0x9d123d8, _c=QMetaObject::InvokeMetaMethod, _id=101, _a=0xbff8c2fc) at /build/buildd/krusader-2.0~svn6078/krusader/krslots.cpp:600
#15 0xb738da60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#16 0xb738de60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#17 0xb69f45f1 in QAction::triggered () from /usr/lib/libQtGui.so.4
#18 0xb69f4f5f in QAction::activate () from /usr/lib/libQtGui.so.4
#19 0xb69f84bb in QAction::event () from /usr/lib/libQtGui.so.4
#20 0xb7b41809 in KAction::event (this=0x9df4230, event=0xbff8c734) at /build/buildd/kde4libs-4.1.85/kdeui/actions/kaction.cpp:88
#21 0xb69fa8ec in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#22 0xb6a0272e in QApplication::notify () from /usr/lib/libQtGui.so.4
#23 0xb7c2bd3d in KApplication::notify (this=0xbff8d734, receiver=0x9df4230, event=0xbff8c734) at /build/buildd/kde4libs-4.1.85/kdeui/kernel/kapplication.cpp:307
#24 0xb7378e61 in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#25 0xb6a338e8 in ?? () from /usr/lib/libQtGui.so.4
#26 0xb6a352bf in ?? () from /usr/lib/libQtGui.so.4
#27 0xb6a039f0 in QApplication::notify () from /usr/lib/libQtGui.so.4
#28 0xb7c2bd3d in KApplication::notify (this=0xbff8d734, receiver=0xa360d10, event=0xbff8cacc) at /build/buildd/kde4libs-4.1.85/kdeui/kernel/kapplication.cpp:307
#29 0xb7378e61 in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#30 0xb6a5b3de in ?? () from /usr/lib/libQtGui.so.4
#31 0xb6a91bb0 in ?? () from /usr/lib/libQtGui.so.4
#32 0xb6a93d26 in ?? () from /usr/lib/libQtGui.so.4
#33 0xb6a6aaf5 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#34 0xb6a957aa in ?? () from /usr/lib/libQtGui.so.4
#35 0xb60306f8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#36 0xb6033da3 in ?? () from /usr/lib/libglib-2.0.so.0
#37 0xb6033f61 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#38 0xb73a3478 in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#39 0xb6a94ea5 in ?? () from /usr/lib/libQtGui.so.4
#40 0xb737752a in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#41 0xb73776ea in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#42 0xb7379da5 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#43 0xb69fa767 in QApplication::exec () from /usr/lib/libQtGui.so.4
#44 0x08090c92 in main (argc=5, argv=0xbff8dd04) at /build/buildd/krusader-2.0~svn6078/krusader/main.cpp:264

Comment 7 FiNeX 2008-12-27 12:01:21 UTC
Backtrace from comment #5:

Приложение: Kate (kate), сигнал SIGSEGV

Thread 1 (Thread 0xb5bb16c0 (LWP 20196)):
[KCrash Handler]
#6  0xb41df59f in KateFileLoader::open (this=0xbfd5a1cc) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:180
#7  0xb41dbf4d in KateBuffer::openFile (this=0x8a24658, m_file=@0xbfd5a4f4) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:529
#8  0xb41bddd5 in KateDocument::openFile (this=0x8a0fef0) at /build/buildd/kde4libs-4.1.85/kate/document/katedocument.cpp:3366
#9  0xb7f75b4a in KParts::ReadOnlyPart::openUrl (this=0x8a0fef0, url=@0xbfd5a648) at /build/buildd/kde4libs-4.1.85/kparts/part.cpp:558
#10 0xb7fcc2bf in ?? () from /usr/lib/libkateinterfaces.so.4
#11 0xb7fe5afc in ?? () from /usr/lib/libkateinterfaces.so.4
#12 0xb7fbf400 in KateApp::startupKate () from /usr/lib/libkateinterfaces.so.4
#13 0xb7fc0163 in KateApp::initKate () from /usr/lib/libkateinterfaces.so.4
#14 0xb7fc046c in KateApp::KateApp () from /usr/lib/libkateinterfaces.so.4
#15 0xb8021461 in kdemain () from /usr/lib/libkdeinit4_kate.so
#16 0x08048672 in _start ()

Comment 8 FiNeX 2008-12-27 12:03:48 UTC
Thanks Bazilio. Only one small nome: next time remember to paste the backtrace directly on bugzilla, not attach them. Thanks!

Comment 9 Dario Andres 2008-12-27 14:05:23 UTC
I suppose the original file have a ".php" extension, does it ? In every way do you open the file it crashes? (opening from Dolphin or Krusader using Kate, first opening Kate and then opening the document, launching Kate as "kate document.php") ? Thanks :)
Comment 10 Bazilio 2008-12-29 08:46:09 UTC
> I suppose the original file have a ".php" extension, does it ?
yes. index.php
> In every way do you open the file it crashes?
yes.

I use autodetect encoding (cyrilic).

> opening from Dolphin or Krusader using Kate
dolphin using kate:

Приложение: Kate (kate), сигнал SIGSEGV

Thread 1 (Thread 0xb5a696c0 (LWP 22883)):
[KCrash Handler]
#6  0xb411c59f in KateFileLoader::open (this=0xbf8143bc) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:180
#7  0xb4118f4d in KateBuffer::openFile (this=0x9b92810, m_file=@0xbf8146e4) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:529
#8  0xb40fadd5 in KateDocument::openFile (this=0x9bcd470) at /build/buildd/kde4libs-4.1.85/kate/document/katedocument.cpp:3366
#9  0xb7e2db4a in KParts::ReadOnlyPart::openUrl (this=0x9bcd470, url=@0xbf814838) at /build/buildd/kde4libs-4.1.85/kparts/part.cpp:558
#10 0xb7e842bf in ?? () from /usr/lib/libkateinterfaces.so.4
#11 0xb7e9dafc in ?? () from /usr/lib/libkateinterfaces.so.4
#12 0xb7e77400 in KateApp::startupKate () from /usr/lib/libkateinterfaces.so.4
#13 0xb7e78163 in KateApp::initKate () from /usr/lib/libkateinterfaces.so.4
#14 0xb7e7846c in KateApp::KateApp () from /usr/lib/libkateinterfaces.so.4
#15 0xb7ed9461 in kdemain () from /usr/lib/libkdeinit4_kate.so
#16 0x08048672 in _start ()

krusader using kate:
https://bugs.kde.org/show_bug.cgi?id=178789#c7

> first opening Kate and then opening the document
Приложение: Kate (kate), сигнал SIGSEGV

Thread 1 (Thread 0xb5b616c0 (LWP 24735)):
[KCrash Handler]
#6  0xb421459f in KateFileLoader::open (this=0xbff094cc) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:180
#7  0xb4210f4d in KateBuffer::openFile (this=0x87b3778, m_file=@0xbff097f4) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:529
#8  0xb41f2dd5 in KateDocument::openFile (this=0x893db98) at /build/buildd/kde4libs-4.1.85/kate/document/katedocument.cpp:3366
#9  0xb7f25b4a in KParts::ReadOnlyPart::openUrl (this=0x893db98, url=@0xbff09948) at /build/buildd/kde4libs-4.1.85/kparts/part.cpp:558
#10 0xb7f7c2bf in ?? () from /usr/lib/libkateinterfaces.so.4
#11 0xb7f95afc in ?? () from /usr/lib/libkateinterfaces.so.4
#12 0xb7f95f3f in ?? () from /usr/lib/libkateinterfaces.so.4
#13 0xb7f96390 in ?? () from /usr/lib/libkateinterfaces.so.4
#14 0xb6b04a60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#15 0xb6b04e60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#16 0xb6faf5f1 in QAction::triggered () from /usr/lib/libQtGui.so.4
#17 0xb6faff5f in QAction::activate () from /usr/lib/libQtGui.so.4
#18 0xb73d5612 in QToolButton::nextCheckState () from /usr/lib/libQtGui.so.4
#19 0xb72f8d53 in ?? () from /usr/lib/libQtGui.so.4
#20 0xb72f9026 in QAbstractButton::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#21 0xb73d5b0c in QToolButton::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#22 0xb700d962 in QWidget::event () from /usr/lib/libQtGui.so.4
#23 0xb72f703e in QAbstractButton::event () from /usr/lib/libQtGui.so.4
#24 0xb73d55d4 in QToolButton::event () from /usr/lib/libQtGui.so.4
#25 0xb6fb58ec in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#26 0xb6fbe0e1 in QApplication::notify () from /usr/lib/libQtGui.so.4
#27 0xb7ad5d3d in KApplication::notify (this=0xbff0ab88, receiver=0x88cb940, event=0xbff0a1a8) at /build/buildd/kde4libs-4.1.85/kdeui/kernel/kapplication.cpp:307
#28 0xb6aefe61 in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#29 0xb6fbd36e in QApplicationPrivate::sendMouseEvent () from /usr/lib/libQtGui.so.4
#30 0xb7027656 in ?? () from /usr/lib/libQtGui.so.4
#31 0xb70269e5 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#32 0xb70507aa in ?? () from /usr/lib/libQtGui.so.4
#33 0xb5f5e6f8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#34 0xb5f61da3 in ?? () from /usr/lib/libglib-2.0.so.0
#35 0xb5f61f61 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#36 0xb6b1a478 in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#37 0xb704fea5 in ?? () from /usr/lib/libQtGui.so.4
#38 0xb6aee52a in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#39 0xb6aee6ea in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#40 0xb6af0da5 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#41 0xb6fb5767 in QApplication::exec () from /usr/lib/libQtGui.so.4
#42 0xb7fd177d in kdemain () from /usr/lib/libkdeinit4_kate.so
#43 0x08048672 in _start ()

>launching Kate as "kate document.php"
bazilio@bazilio-laptop:~/scripts/mine/php5/9.5.2_gistogramm$ kate index.php
KCrash: Application 'kate' crashing...
sock_file=/home/bazilio/.kde/socket-bazilio-laptop/kdeinit4__0

Приложение: Kate (kate), сигнал SIGSEGV

Thread 1 (Thread 0xb5b526c0 (LWP 19489)):
[KCrash Handler]
#6  0xb421b59f in KateFileLoader::open (this=0xbfbfaf3c) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:180
#7  0xb4217f4d in KateBuffer::openFile (this=0x8e12e90, m_file=@0xbfbfb264) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:529
#8  0xb41f9dd5 in KateDocument::openFile (this=0x8ebcf90) at /build/buildd/kde4libs-4.1.85/kate/document/katedocument.cpp:3366
#9  0xb7f16b4a in KParts::ReadOnlyPart::openUrl (this=0x8ebcf90, url=@0xbfbfb3b8) at /build/buildd/kde4libs-4.1.85/kparts/part.cpp:558
#10 0xb7f6d2bf in ?? () from /usr/lib/libkateinterfaces.so.4
#11 0xb7f86afc in ?? () from /usr/lib/libkateinterfaces.so.4
#12 0xb7f60400 in KateApp::startupKate () from /usr/lib/libkateinterfaces.so.4
#13 0xb7f61163 in KateApp::initKate () from /usr/lib/libkateinterfaces.so.4
#14 0xb7f6146c in KateApp::KateApp () from /usr/lib/libkateinterfaces.so.4
#15 0xb7fc2461 in kdemain () from /usr/lib/libkdeinit4_kate.so
#16 0x08048672 in _start ()


That is all.

If I turn off autodetect encoding, it opening with message about incorect encoding. Encoding in file - cp1251.
Comment 11 Bazilio 2008-12-29 09:22:29 UTC
> If I turn off autodetect encoding, it opening with message about incorect encoding.

If then I try to change encoding to cp1251 -> crash

Приложение: Kate (kate), сигнал SIGSEGV

Thread 1 (Thread 0xb5b056c0 (LWP 26400)):
[KCrash Handler]
#6  0xb412759f in KateFileLoader::open (this=0xbfbad30c) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:180
#7  0xb4123f4d in KateBuffer::openFile (this=0x9340ca8, m_file=@0xbfbad634) at /build/buildd/kde4libs-4.1.85/kate/document/katebuffer.cpp:529
#8  0xb4105dd5 in KateDocument::openFile (this=0x9317e00) at /build/buildd/kde4libs-4.1.85/kate/document/katedocument.cpp:3366
#9  0xb7ec9b4a in KParts::ReadOnlyPart::openUrl (this=0x9317e00, url=@0xbfbad858) at /build/buildd/kde4libs-4.1.85/kparts/part.cpp:558
#10 0xb40fd9fe in KateDocument::documentReload (this=0x9317e00) at /build/buildd/kde4libs-4.1.85/kate/document/katedocument.cpp:5282
#11 0xb418e03a in KateView::reloadFile (this=0x94fa130) at /build/buildd/kde4libs-4.1.85/kate/view/kateview.cpp:1010
#12 0xb41bad17 in KateViewEncodingAction::setProberTypeForEncodingAutoDetection (this=0x957fbe8, proberType=KEncodingProber::Universal)
    at /build/buildd/kde4libs-4.1.85/kate/view/kateviewhelpers.cpp:1744
#13 0xb41c4eb7 in KateViewEncodingAction::qt_metacall (this=0x957fbe8, _c=QMetaObject::InvokeMetaMethod, _id=6, _a=0xbfbada1c)
    at /build/buildd/kde4libs-4.1.85/obj-i486-linux-gnu/kate/kateviewhelpers.moc:227
#14 0xb6aa8a60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#15 0xb6aa97e2 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#16 0xb41ba303 in KateViewEncodingAction::triggered (this=0x957fbe8, _t1=KEncodingProber::Universal) at /build/buildd/kde4libs-4.1.85/obj-i486-linux-gnu/kate/kateviewhelpers.moc:281
#17 0xb799fe74 in KSelectAction::qt_metacall (this=0x957fbe8, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0xbfbadb6c) at /build/buildd/kde4libs-4.1.85/obj-i486-linux-gnu/kdeui/kselectaction.moc:104
#18 0xb41c4d9a in KateViewEncodingAction::qt_metacall (this=0x957fbe8, _c=QMetaObject::InvokeMetaMethod, _id=26, _a=0xbfbadb6c)
    at /build/buildd/kde4libs-4.1.85/obj-i486-linux-gnu/kate/kateviewhelpers.moc:216
#19 0xb6aa8a60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#20 0xb6aa97e2 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#21 0xb6f58133 in QActionGroup::triggered () from /usr/lib/libQtGui.so.4
#22 0xb6f589e8 in ?? () from /usr/lib/libQtGui.so.4
#23 0xb6f58bfe in QActionGroup::qt_metacall () from /usr/lib/libQtGui.so.4
#24 0xb6aa8a60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#25 0xb6aa8e60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#26 0xb6f535f1 in QAction::triggered () from /usr/lib/libQtGui.so.4
#27 0xb6f53f5f in QAction::activate () from /usr/lib/libQtGui.so.4
#28 0xb799eb8e in KSelectAction::actionTriggered (this=0x958f408, action=0x95913f8) at /usr/include/qt4/QtGui/qaction.h:195
#29 0xb799fe74 in KSelectAction::qt_metacall (this=0x958f408, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0xbfbade2c) at /build/buildd/kde4libs-4.1.85/obj-i486-linux-gnu/kdeui/kselectaction.moc:104
#30 0xb6aa8a60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#31 0xb6aa97e2 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#32 0xb6f58133 in QActionGroup::triggered () from /usr/lib/libQtGui.so.4
#33 0xb6f589e8 in ?? () from /usr/lib/libQtGui.so.4
#34 0xb6f58bfe in QActionGroup::qt_metacall () from /usr/lib/libQtGui.so.4
#35 0xb6aa8a60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#36 0xb6aa8e60 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#37 0xb6f535f1 in QAction::triggered () from /usr/lib/libQtGui.so.4
#38 0xb6f53f5f in QAction::activate () from /usr/lib/libQtGui.so.4
#39 0xb7331564 in ?? () from /usr/lib/libQtGui.so.4
#40 0xb7331ff2 in QMenu::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#41 0xb7b666f5 in KMenu::mouseReleaseEvent (this=0x958f898, e=0xbfbae648) at /build/buildd/kde4libs-4.1.85/kdeui/widgets/kmenu.cpp:454
#42 0xb6fb1962 in QWidget::event () from /usr/lib/libQtGui.so.4
#43 0xb73342e9 in QMenu::event () from /usr/lib/libQtGui.so.4
#44 0xb6f598ec in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#45 0xb6f620e1 in QApplication::notify () from /usr/lib/libQtGui.so.4
#46 0xb7a79d3d in KApplication::notify (this=0xbfbaf028, receiver=0x958f898, event=0xbfbae648) at /build/buildd/kde4libs-4.1.85/kdeui/kernel/kapplication.cpp:307
#47 0xb6a93e61 in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#48 0xb6f6136e in QApplicationPrivate::sendMouseEvent () from /usr/lib/libQtGui.so.4
#49 0xb6fcb8de in ?? () from /usr/lib/libQtGui.so.4
#50 0xb6fca9e5 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#51 0xb6ff47aa in ?? () from /usr/lib/libQtGui.so.4
#52 0xb5f026f8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#53 0xb5f05da3 in ?? () from /usr/lib/libglib-2.0.so.0
#54 0xb5f05f61 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#55 0xb6abe478 in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#56 0xb6ff3ea5 in ?? () from /usr/lib/libQtGui.so.4
#57 0xb6a9252a in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#58 0xb6a926ea in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#59 0xb6a94da5 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#60 0xb6f59767 in QApplication::exec () from /usr/lib/libQtGui.so.4
#61 0xb7f7577d in kdemain () from /usr/lib/libkdeinit4_kate.so
#62 0x08048672 in _start ()

Comment 12 Dario Andres 2008-12-31 13:16:44 UTC
Here using:

Qt: 4.4.3 + qt-copy-patches-889120
KDE: 4.1.86 (KDE 4.1.86 (KDE 4.2 >= 20081221))
kdelibs svn rev. 903705 / kdebase svn rev. 903706
on ArchLinux x86_64 - Kernel 2.6.27.10

I can reproduce the crash.

Steps to reproduce

- Download the testcase file as a .php file
- Open KWrite and load that file
(if you are using UTF8 or another default encoding, KWrite will not crash).
KWrite complains about invalid encoding characters in the file
- Go to Tools/Encoding/Cyrillic/Autodetect

KWrite crashes with the following backtrace:

[Thread debugging using libthread_db enabled]
[New Thread 0x7f9b8d174750 (LWP 27304)]
warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f9b8d174750 (LWP 27304)]
warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

0x00007f9b820fda23 in KateFileLoader::open (this=warning: (Internal error: pc 0x7f9b820fd870 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

0x7fff952b2ac0)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/document/katebuffer.cpp:180
180	        if (m_codec->mibEnum()!=MibUtf8)
warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

#0  0x00007f9b820fda23 in KateFileLoader::open (this=0x7fff952b2ac0)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/document/katebuffer.cpp:180
warning: (Internal error: pc 0x7f9b820fda23 in read in psymtab, but not in symtab.)

	c = 3136
	__PRETTY_FUNCTION__ = "bool KateFileLoader::open()"
#1  0x00007f9b820fa8fa in KateBuffer::openFile (this=0xce7170, m_file=@0x7fff952b3130)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/document/katebuffer.cpp:529
	t = {mds = 36596347}
	file = {m_codec = 0x0, m_prober = 0x118b150, m_multiByte = 0, m_eof = false, m_lastWasEndOfLine = true, 
  m_lastWasR = false, m_binary = false, m_removeTrailingSpaces = false, m_utf8Borked = false, m_position = 0, 
  m_lastLineStart = 0, m_eol = -1, m_file = {<QIODevice> = {<QObject> = {_vptr.QObject = 0x7f9b8a62b530, 
        static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x7f9b8a3e8a00 "QObject", data = 0x7f9b8a3e8a80, 
            extradata = 0x0}}, d_ptr = 0x109b6b0, static staticQtMetaObject = {d = {superdata = 0x0, 
            stringdata = 0x7f9b8a3f2340 "Qt", data = 0x7f9b8a3f3fe0, extradata = 0x0}}}, static staticMetaObject = {d = {
          superdata = 0x7f9b8a6257e0, stringdata = 0x7f9b8a3f75a0 "QIODevice", data = 0x7f9b8a3f7600, extradata = 0x0}}}, 
    static staticMetaObject = {d = {superdata = 0x7f9b8a62b640, stringdata = 0x7f9b8a3f7540 "QFile", 
        data = 0x7f9b8a3f7560, extradata = 0x0}}}, m_buffer = {static shared_null = {ref = {_q_value = 4246}, alloc = 0, 
      size = 0, data = 0x7f9b8a62db58 "", array = ""}, static shared_empty = {ref = {_q_value = 495}, alloc = 0, size = 0, 
      data = 0x7f9b8a62db78 "", array = ""}, d = 0x10d79c0}, m_text = {static null = {<No data fields>}, 
    static shared_null = {ref = {_q_value = 14102}, alloc = 0, size = 0, data = 0x7f9b8a62dc9a, clean = 0, simpletext = 0, 
      righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {
        _q_value = 1106}, alloc = 0, size = 0, data = 0x7f9b8a62dcba, clean = 0, simpletext = 0, righttoleft = 0, 
      asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x7f9b8a62dc80, static codecForCStrings = 0x0}}
	sbuf = {st_dev = 2053, st_ino = 2697904, st_nlink = 1, st_mode = 33188, st_uid = 1001, st_gid = 100, __pad0 = 0, 
  st_rdev = 0, st_size = 3136, st_blksize = 4096, st_blocks = 8, st_atim = {tv_sec = 1230723920, tv_nsec = 0}, st_mtim = {
    tv_sec = 1230723921, tv_nsec = 0}, st_ctim = {tv_sec = 1230723921, tv_nsec = 0}, __unused = {0, 0, 0}}
	__PRETTY_FUNCTION__ = "bool KateBuffer::openFile(const QString&)"
#2  0x00007f9b820de96d in KateDocument::openFile (this=0xb8bfa0)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/document/katedocument.cpp:3371
	mimeType = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14102}, alloc = 0, size = 0, 
    data = 0x7f9b8a62dc9a, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, 
    array = {0}}, static shared_empty = {ref = {_q_value = 1106}, alloc = 0, size = 0, data = 0x7f9b8a62dcba, clean = 0, 
    simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x10da560, 
  static codecForCStrings = 0x0}
	pos = <value optimized out>
	success = <value optimized out>
	parentWidget = <value optimized out>
#3  0x00007f9b8ca1f044 in KParts::ReadOnlyPart::openUrl (this=0xb8bfa0, url=<value optimized out>)
    at /home/kde-devel/kde/src/KDE/kdelibs/kparts/part.cpp:558
	ret = <value optimized out>
	args = {d = {d = 0xb2d300}}
#4  0x00007f9b820d6fac in KateDocument::documentReload (this=0xb8bfa0)
    at /home/kde-devel/kde/src/KDE/kdelibs/kate/document/katedocument.cpp:5292
	tmp = {{p = {static shared_null = {ref = {_q_value = 13882}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {
          0x0}}, d = 0x7f9b8a62dbe0}, d = 0x7f9b8a62dbe0}}
	oldMode = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14102}, alloc = 0, size = 0, 
    data = 0x7f9b8a62dc9a, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, 
    array = {0}}, static shared_empty = {ref = {_q_value = 1106}, alloc = 0, size = 0, data = 0x7f9b8a62dcba, clean = 0, 
    simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0xc61ea0, 
  static codecForCStrings = 0x0}
	byUser = false
	cursorPositions = {{p = 0x1237180, d = 0x1237180}}
#5  0x00007f9b8218c64e in KateViewEncodingAction::qt_metacall (this=0xe69750, _c=QMetaObject::InvokeMetaMethod, 
    _id=<value optimized out>, _a=0x7fff952b3890) at /home/kde-devel/kde/build/KDE/kdelibs/kate/kateviewhelpers.moc:227
No locals.
#6  0x00007f9b8a374ac0 in QMetaObject::activate (sender=0xe69750, from_signal_index=<value optimized out>, 
    to_signal_index=32, argv=0x0) at kernel/qobject.cpp:3028
	method = 36
	currentSender = {sender = 0xe69750, signal = 32, ref = 1}
	previousSender = (QObjectPrivate::Sender * const) 0x7fff952b3990
	connectionList = (const QList<QObjectPrivate::Connection> &) @0xeb2310: {{p = {static shared_null = {ref = {
          _q_value = 13882}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xe69be0}, d = 0xe69be0}}
	count = 1
	signal = 32
	empty_argv = {0x0}
	locker = {{mtx = 0xa6dab8, val = 10934968}}
	currentThreadData = (QThreadData *) 0xa6da60
	connectionLists = (QObjectConnectionListVector *) 0xe69bb0
#7  0x00007f9b82182cd1 in KateViewEncodingAction::triggered (this=0x0, _t1=KEncodingProber::Universal)
    at /home/kde-devel/kde/build/KDE/kdelibs/kate/kateviewhelpers.moc:281
	_a = {0x0, 0x7fff952b388c}
#8  0x00007f9b8bb4084c in KSelectAction::qt_metacall (this=0xe69750, _c=QMetaObject::InvokeMetaMethod, 
    _id=<value optimized out>, _a=0x7fff952b3a20) at /home/kde-devel/kde/build/KDE/kdelibs/kdeui/kselectaction.moc:104
No locals.
#9  0x00007f9b8218c505 in KateViewEncodingAction::qt_metacall (this=0x0, _c=2304950304, _id=17660352, _a=0x0)
    at /home/kde-devel/kde/build/KDE/kdelibs/kate/kateviewhelpers.moc:216
No locals.
#10 0x00007f9b8a374ac0 in QMetaObject::activate (sender=0xe69e40, from_signal_index=<value optimized out>, 
    to_signal_index=4, argv=0x0) at kernel/qobject.cpp:3028
	method = 26
	currentSender = {sender = 0xe69e40, signal = 4, ref = 1}
	previousSender = (QObjectPrivate::Sender * const) 0x0
	connectionList = (const QList<QObjectPrivate::Connection> &) @0xe69fa0: {{p = {static shared_null = {ref = {
          _q_value = 13882}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xe69fd0}, d = 0xe69fd0}}
	count = 1
	signal = 4
	empty_argv = {0x0}
	locker = {{mtx = 0xa6dab8, val = 10934968}}
	currentThreadData = (QThreadData *) 0xa6da60
	connectionLists = (QObjectConnectionListVector *) 0xe69f40
#11 0x00007f9b8a7c4c3f in QActionGroup::triggered (this=0x0, _t1=0xe813c0) at .moc/debug-shared/moc_qactiongroup.cpp:138
	_a = {0x0, 0x7fff952b3a18}
#12 0x00007f9b8a7c547c in QActionGroupPrivate::_q_actionTriggered (this=<value optimized out>)
    at kernel/qactiongroup.cpp:83
	q = (QActionGroup * const) 0xe69e40
	action = (class QAction *) 0xe813c0
#13 0x00007f9b8a7c5701 in QActionGroup::qt_metacall (this=0xe69e40, _c=QMetaObject::InvokeMetaMethod, 
    _id=<value optimized out>, _a=0x7fff952b3b70) at .moc/debug-shared/moc_qactiongroup.cpp:94
No locals.
#14 0x00007f9b8a374ac0 in QMetaObject::activate (sender=0xe813c0, from_signal_index=<value optimized out>, 
    to_signal_index=6, argv=0x0) at kernel/qobject.cpp:3028
	method = 11
	currentSender = {sender = 0xe813c0, signal = 6, ref = 1}
	previousSender = (QObjectPrivate::Sender * const) 0x0
	connectionList = (const QList<QObjectPrivate::Connection> &) @0xe869d0: {{p = {static shared_null = {ref = {
          _q_value = 13882}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xeafe10}, d = 0xeafe10}}
	count = 2
	signal = 6
	empty_argv = {0x0}
	locker = {{mtx = 0xa6dab8, val = 10934968}}
	currentThreadData = (QThreadData *) 0xa6da60
	connectionLists = (QObjectConnectionListVector *) 0xe81760
#15 0x00007f9b8a7c0a57 in QAction::triggered (this=0x0, _t1=true) at .moc/debug-shared/moc_qaction.cpp:216
	_a = {0x0, 0x7fff952b3b6c}
#16 0x00007f9b8a7c1204 in QAction::activate (this=0xe813c0, event=<value optimized out>) at kernel/qaction.cpp:1125
	guard = (class QObject *) 0xe813c0
#17 0x00007f9b8bb3f67e in KSelectAction::actionTriggered (this=0xe813c0, action=0xe7f340)
    at /usr/include/QtGui/qaction.h:195
	text = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14102}, alloc = 0, size = 0, 
    data = 0x7f9b8a62dc9a, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, 
    array = {0}}, static shared_empty = {ref = {_q_value = 1106}, alloc = 0, size = 0, data = 0x7f9b8a62dcba, clean = 0, 
    simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x12802a0, 
  static codecForCStrings = 0x0}
	index = 0
#18 0x00007f9b8bb4084c in KSelectAction::qt_metacall (this=0xe813c0, _c=QMetaObject::InvokeMetaMethod, 
    _id=<value optimized out>, _a=0x7fff952b3d60) at /home/kde-devel/kde/build/KDE/kdelibs/kdeui/kselectaction.moc:104
No locals.
....
Comment 13 Dario Andres 2009-02-17 23:46:20 UTC
*** Bug 184646 has been marked as a duplicate of this bug. ***
Comment 14 Pavel Shtanko 2009-03-10 13:32:58 UTC
In my system (Fedora 10, KDE 4.2.1, qt 4.5, kate 3.2.1) I can reproduce this crash too
Comment 15 Denis 2009-03-18 14:18:45 UTC
*** Bug 187488 has been marked as a duplicate of this bug. ***
Comment 16 Kitsonkit 2009-05-04 07:09:02 UTC
Application: Kate (kate), signal SIGSEGV

Thread 1 (Thread 0xb5c00700 (LWP 17719)):
#0  0xb7eea424 in __kernel_vsyscall ()
#1  0xb7e05350 in nanosleep () from /lib/i686/cmov/libc.so.6
#2  0xb7e0518e in sleep () from /lib/i686/cmov/libc.so.6
#3  0xb6230048 in ?? () from /usr/lib/libkdeui.so.5
#4  0x00000000 in ?? ()
Comment 17 Denis 2009-05-11 16:52:56 UTC
any update on this? I can't use kate for development because of this.
btw. is there any KDE alternative of kate for development?
Comment 18 Dario Andres 2009-05-15 01:10:08 UTC
*** Bug 192107 has been marked as a duplicate of this bug. ***
Comment 19 Dario Andres 2009-05-15 01:37:33 UTC
I did some triaging about this:
(( Using the testcase file of bug 192107 ))

The crash is caused because in the function "bool errorsIfUtf8 (const char* data, int length)", the "m_codec" object is NULL.

When the "KateFileLoader" object is created the m_codec is a valid object, 

however, in the "open" function which reports:
KateFileLoader::open: PROBER TYPE:  "Universal"

this line is executed:
"m_codec = QTextCodec::codecForName(m_prober->encoding());"
and after that m_codec becomes a null object (0x0)... leading to the crash itself.

In this case (bug 192107 testcase file) "m_prober->encoding()" is "x-euc-tw"
In the testcase of this report (bug 178789) "m_prober->encoding()" is "x-mac-cyrillic"

(BTW: this isn't related to the selected new encoding... the crash happens when choose any encoding)
Comment 20 Dario Andres 2009-05-15 01:41:29 UTC
A simple fix will be checking if the new generated QTextCodec (using "QTextCodec::codecForName(m_prober->encoding());")  is valid, and only in that case assign it to m_codec. (I wonder if that will affect the behaviour...)
Comment 21 Dario Andres 2009-05-15 20:15:18 UTC
Posted review request for this crash: http://reviewboard.kde.org/r/707/
Thanks
Comment 22 Dario Andres 2009-05-17 23:27:50 UTC
SVN commit 969284 by darioandres:

Do not assign m_codec if QTextCodec::codecForName(name)
returns NULL. This will cause crashes.

BUG: 178789


 M  +1 -1      katebuffer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=969284
Comment 23 Dario Andres 2009-05-17 23:33:52 UTC
SVN commit 969286 by darioandres:

Backport to 4.2branch of:
SVN commit 969284 by darioandres:

Do not assign m_codec if QTextCodec::codecForName(name)
returns NULL. This will cause crashes.

CCBUG: 178789


 M  +1 -1      katebuffer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=969286
Comment 24 Dario Andres 2009-05-22 04:07:57 UTC
*** Bug 193452 has been marked as a duplicate of this bug. ***
Comment 25 Dario Andres 2009-05-24 18:08:30 UTC
*** Bug 193833 has been marked as a duplicate of this bug. ***
Comment 26 Dominik Haumann 2009-05-25 23:24:03 UTC
*** Bug 194091 has been marked as a duplicate of this bug. ***
Comment 27 Dominik Haumann 2009-05-31 22:33:53 UTC
*** Bug 194783 has been marked as a duplicate of this bug. ***