[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#39432: marked as done (kmcinit hangs on startup when .Xdefaults corrupted [patch included]) by W
From:       owner () bugs ! kde ! org (Stephan Kulow)
Date:       2002-09-11 23:18:01
[Download RAW message or body]

Your message with subj: kdebase/kcontrol/krdb

kdebase/kcontrol/krdb krdb.cpp,1.37,1.38
Author: waba


Modified Files:
         krdb.cpp
Log Message:
CCMAIL: 39432-done@bugs.kde.org
Fix hang on corrupted ~/.Xdefaults file.



has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Stephan Kulow
(administrator, KDE bugs database)

(Complete bug history is available at http://bugs.kde.org/db/39/39432.html)

Received: (at submit) by bugs.kde.org; 17 Mar 2002 22:47:58 +0000
Received: (qmail 11143 invoked by uid 33); 17 Mar 2002 22:47:58 -0000
Date: 17 Mar 2002 22:47:58 -0000
Message-ID: <20020317224758.11142.qmail@mail.kde.org>
To: submit@bugs.kde.org
Subject: kmcinit hangs on startup when .Xdefaults corrupted [patch included]
From: marcel@weltherrschaftjetzt.de
X-KDE-Received: -129.70.254.50

Package:           kcontrol
Version:           KDE 2.9.2 CVS/CVSup/Snapshot
Severity:          normal
Installed from:    Compiled sources
Compiler:          gcc 2.95.3
OS:                Linux
OS/Compiler notes: Not Specified

For some time now KDE would hang on startup with "kcminit" using a lot of CPU time. \
Today I was finally able to track down the error. The ~/.Xdefaults file was corrupted \
(probably after an unclean shutdown), it contained a few dozen Zero-Bytes ('\0') at \
the end. This caused krdb's copyFile() to run into an endless loop. My fix was to \
replace the call to "readLine" with "readBlock" (line 250 in \
kdebase/kcontrol/krdb/krdb.cpp). The copied file won't be un-corrupted by this but at \
least copyFile() will handle files with zero-bytes gracefully. It would be nice if \
someone could fix this in CVS.

Thanks,
Marcel

[possible patch follows]
--- kdebase/kcontrol/krdb/krdb.cpp	Sat Mar  9 17:54:55 2002
+++ kdebase-patched/kcontrol/krdb/krdb.cpp	Sun Mar 17 23:06:16 2002
@@ -205,7 +205,7 @@
   if ( f.open(IO_ReadOnly) ) {
       QCString buf( 8192 );
       while ( !f.atEnd() ) {
-          int read = f.readLine( buf.data(), buf.size() );
+          int read = f.readBlock( buf.data(), buf.size() );
           if ( read > 0 )
               tmp.writeBlock( buf.data(), read );
       }

(Submitted via bugs.kde.org)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic