Bug#46279: kate crashes on exit SIGSEGV, sometimes corrupts katesessionrc, causing startup to crash as well.
[email protected] 8 Aug 2002 21:16:32 -0000
| Newsgroups | gmane.comp.kde.devel.kate |
|---|---|
| Message-ID | <[email protected]> |
Package: kate
Version: 2.0 (using KDE 3.0.0 )
Severity: crash
Installed from:
Compiler: gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)
OS: Linux (i686) release 2.4.19-xfs-1
OS/Compiler notes:
I am using SMP 2.4.19 x86 Redhat 7.3, current updates of all packages. I have tried uninstall and reinstall of the kate rpm, no help.
In all cases, for all users, upon exit kate crashes with SIGSEGV. Sometimes the katesessionrc file becomes corrupted and must be removed before startup will work again. My binary does not have debugging symbols, but here is a backtrace upon exit (this is while running in gdb, I will paste a similar backtrace from the KDE crash handler following this one):
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 3311)]
0x40702bd3 in KInstance::~KInstance () from /usr/lib/libkdecore-gcc2.96.so.4
(gdb) bt
#0 0x40702bd3 in KInstance::~KInstance () from /usr/lib/libkdecore-gcc2.96.so.4
#1 0x41594e64 in KatePluginFactory::~KatePluginFactory () from /usr/lib/kde3/katehtmltoolsplugin.so
#2 0x40704e74 in KLibrary::~KLibrary () from /usr/lib/libkdecore-gcc2.96.so.4
#3 0x40706a11 in KLibLoader::close_pending () from /usr/lib/libkdecore-gcc2.96.so.4
#4 0x40705d03 in KLibLoader::~KLibLoader () from /usr/lib/libkdecore-gcc2.96.so.4
#5 0x40705b48 in KLibLoader::cleanUp () from /usr/lib/libkdecore-gcc2.96.so.4
#6 0x40658bf6 in KApplication::~KApplication () from /usr/lib/libkdecore-gcc2.96.so.4
#7 0x40071d24 in Kate::Application::~Application () from /usr/lib/libkateinterfaces-gcc2.96.so
#8 0x40033454 in KateApp::~KateApp () from /usr/lib/kate-gcc2.96.so
#9 0x40054baf in main () from /usr/lib/kate-gcc2.96.so
#10 0x410291c4 in __libc_start_main () from /lib/libc.so.6
//////////////////////////////////////////
// Now a backtrace via KDE crash handler
//////////////////////////////////////////
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...[New Thread 1024 (LWP 3330)]
0x410304b9 in wait4 () from /lib/libc.so.6
#0 0x410304b9 in wait4 () from /lib/libc.so.6
#1 0x410a830c in __DTOR_END__ () from /lib/libc.so.6
#2 0x40ef483a in waitpid () from /lib/libpthread.so.0
#3 0x406b78d2 in KCrash::defaultCrashHandler ()
from /usr/lib/libkdecore-gcc2.96.so.4
#4 0x40ef2307 in pthread_sighandler () from /lib/libpthread.so.0
#5 <signal handler called>
#6 0x406cbbd3 in KInstance::~KInstance ()
from /usr/lib/libkdecore-gcc2.96.so.4
#7 0x41604e64 in KatePluginFactory::~KatePluginFactory ()
from /usr/lib/kde3/katehtmltoolsplugin.so
#8 0x406cde74 in KLibrary::~KLibrary () from /usr/lib/libkdecore-gcc2.96.so.4
#9 0x406cfa11 in KLibLoader::close_pending ()
from /usr/lib/libkdecore-gcc2.96.so.4
#10 0x406ced03 in KLibLoader::~KLibLoader ()
from /usr/lib/libkdecore-gcc2.96.so.4
#11 0x406ceb48 in KLibLoader::cleanUp () from /usr/lib/libkdecore-gcc2.96.so.4
#12 0x40621bf6 in KApplication::~KApplication ()
from /usr/lib/libkdecore-gcc2.96.so.4
#13 0x4001bd24 in Kate::Application::~Application ()
from /usr/lib/libkateinterfaces-gcc2.96.so
#14 0x41314454 in KateApp::~KateApp () from /usr/lib/kate-gcc2.96.so
#15 0x41335baf in main () from /usr/lib/kate-gcc2.96.so
#16 0x0804cee9 in strcpy ()
#17 0x0804dbcc in strcpy ()
#18 0x0804e016 in strcpy ()
#19 0x0804f505 in strcpy ()
#20 0x40f9d1c4 in __libc_start_main () from /lib/libc.so.6
////////////////////////////////////////////
Below is one example of a user katesessionrc that forces startup SIGSEGV (this happens once in every 10 or so crashes that the crash causes further startups to always fail):
///////////////////////////////////////////
[file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec]
Highlight=
Modtime=2002,8,7,23,49,47
URL=file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec
viewconfig=viewspace1:file0
[file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec.in]
Highlight=RPM Spec
Modtime=2002,8,7,21,31,45
URL=file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec.in
viewconfig=viewspace1:file1
[general]
activeviewspace=0
[open files]
File0=file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec
File1=file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec.in
current file=file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec
[splitter0]
children=viewspace0,viewspace1
orientation=1
sizes=810,162
[viewspace0]
file0=file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec.in
file1=file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec
[viewspace0:file0]
CursorX=0
CursorY=0
IconBorderStatus=0
XPos=0
YPos=0
[viewspace0:file1]
CursorX=0
CursorY=23
IconBorderStatus=0
XPos=0
YPos=0
[viewspace1]
file0=file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec
file1=file:/home/home1/stimits/rpm/SOURCES/nut-0.99.0/packaging/RedHat/nut.spec.in
[viewspace1:file0]
CursorX=10
CursorY=3
IconBorderStatus=0
XPos=0
YPos=0
[viewspace1:file1]
CursorX=13
CursorY=179
IconBorderStatus=0
XPos=0
YPos=2447
////////////////////////////////////////
By removing the katesessionrc file, startups resume properly, shutdowns are 100% crash cases. Perhaps an strace would be useful, if someone requests it. Below is a very short ltrace log:
///////////////////////////////////////
__libc_start_main(0x080485b0, 1, 0xbffff884, 0x08048578, 0x08048720 <unfinished ...>
__register_frame_info(0x08049758, 0x0804992c, 0xbffff828, 0x0804860e, 0x08048578) = 0
main(1, 0xbffff884, 0xbffff88c, 0x0804858e, 0x08048720 <unfinished ...>
--- SIGSEGV (Segmentation fault) ---
////////////////////////////////////////
It is my "feeling" that the exit crash is somehow related to files which are opened or closed or updated upon exit. The strace shows an infinite recursion of file close is probably being attempted, here is an excerpt towards the end of the rather large strace log:
///////////////////////////////////////////
chmod("/home/home1/stimits/.kde/share/config/katepluginrcAD3sKa.new", 0600) = 0
getgid32() = 110
getuid32() = 500
chown32(0x81f9620, 0x1f4, 0x6e) = 0
fchmod(13, 0600) = 0
fcntl64(13, F_GETFL) = 0x2 (flags O_RDWR)
fstat64(13, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40f64000
_llseek(13, 0, [0], SEEK_CUR) = 0
write(13, "[Plugins]\nkatehtmltoolsplugin=tr"..., 172) = 172
close(13) = 0
munmap(0x40f64000, 4096) = 0
rename("/home/home1/stimits/.kde/share/config/katepluginrcAD3sKa.new", "/home/home1/stimits/.kde/share/config/katepluginrc") = 0
rename("/home/home1/stimits/.kde/share/config/katepluginrcAD3sKa.new", "/home/home1/stimits/.kde/share/config/katepluginrc") = -1 ENOENT (No such file or directory)
unlink("/home/home1/stimits/.kde/share/config/katepluginrcAD3sKa.new") = -1 ENOENT (No such file or directory)
close(12) = 0
close(12) = -1 EBADF (Bad file descriptor)
munmap(0x40f63000, 4096) = 0
--- SIGSEGV (Segmentation fault) ---
rt_sigaction(SIGALRM, {SIG_DFL}, {SIG_DFL}, 8) = 0
alarm(3) = 0
write(2, "KCrash: crashing.... crashRecurs"..., 47) = 47
getpid() = 3384
write(2, "KCrash: Application Name = kate "..., 60) = 60
fork() = 3386
close(3) = 0
close(10) = 0
getrlimit(0x7, 0xbfffed18) = 0
close(0) = 0
close(1) = 0
close(2) = 0
close(3) = -1 EBADF (Bad file descriptor)
close(4) = 0
close(5) = 0
close(6) = 0
close(7) = 0
close(8) = 0
close(9) = 0
close(10) = -1 EBADF (Bad file descriptor)
close(11) = 0
close(12) = -1 EBADF (Bad file descriptor)
close(13) = -1 EBADF (Bad file descriptor)
/////////////////////////////////////////////
The EBADF (Bad file descriptor) with system call return failure repeats from close(0) through close(1023), and then alarm(0) is called.
////////////////////////////////////////////
NOTE: I have tried with and without plugins of all types, I have tried with and without the "Restrict to single process" option. I have tried with and without restore of old files and old view configuration. In all cases the same exit crash occurs.
///////////////////////////////////////////
It is especially suspicious that the rename system call is used twice in a row, succeeding once, failing a second time. Perhaps more than one thread is calling the same rename on SMP:
rename("/home/home1/stimits/.kde/share/config/katepluginrcAD3sKa.new", "/home/home1/stimits/.kde/share/config/katepluginrc") = 0
rename("/home/home1/stimits/.kde/share/config/katepluginrcAD3sKa.new", "/home/home1/stimits/.kde/share/config/katepluginrc") = -1 ENOENT (No such file or directory)
unlink("/home/home1/stimits/.kde/share/config/katepluginrcAD3sKa.new") = -1 ENOENT (No such file or directory)
(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
(Complete bug history is available at http://bugs.kde.org/db/46/46279.html)