Version: KOffice CVS HEAD 2003-10-16 (using KDE KDE 3.1.4) Installed from: Compiled From Sources Compiler: gcc 3.2 -march=pentium2 OS: Linux When trying to save any document (even A4 template), KWord crashes after having clisked "Ok" in the file dailog. I have discovered this behaviour yesterday, but I have not saved anything in KWord for days. (KOffice has been build from cvs-clean, after having brought kdelibs to the KDE_3_1_BRANCH (just after KDE 3.1.4.) (So I have not any KDE 3.2 modification in kdelibs anymore.)) Have a nice day!
Created attachment 2796 [details] GDB output
Subject: Re: New: KWord: crash when saving (destroying file dialog) > KWord crashes after having clisked "Ok" in the file dailog. I thought at least *you* would check for duplicates first... So for the 10th time: Fixed in kdelibs-3.1-branch (post 3.1.4) and in CVS HEAD.
I am sorry, David but the bugs is *not* solved. :-( It still crashes, with exact the same result. Have a nice day!
Subject: Re: KWord: crash when saving (destroying file dialog) > I am sorry, David but the bugs is *not* solved. :-( It still crashes, with exact the same result. Which version of kdelibs do you have, exactly? Is your version of kdelibs/kdeui/klineedit.cpp 1.153.2.5, from KDE_3_1_BRANCH?
Subject: Re: KWord: crash when saving (destroying file dialog) From the CVS/Entries: /klineedit.cpp/1.153.2.5/Sat Sep 27 18:35:42 2003//TKDE_3_1_BRANCH I have downloaded the file again, there is no difference with the file that was there and compiled. On Monday 20 October 2003 00:58, David Faure wrote: > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > > http://bugs.kde.org/show_bug.cgi?id=66142 > > > > > ------- Additional Comments From faure@kde.org 2003-10-20 00:58 ------- > Subject: Re: KWord: crash when saving (destroying file dialog) > > > I am sorry, David but the bugs is *not* solved. :-( It still crashes, > > with exact the same result. > > Which version of kdelibs do you have, exactly? > Is your version of kdelibs/kdeui/klineedit.cpp 1.153.2.5, from > KDE_3_1_BRANCH?
*** Bug 63946 has been marked as a duplicate of this bug. ***
*** Bug 66046 has been marked as a duplicate of this bug. ***
Also duplicate of 61225 (which has been closed so I won't redirect this bug there). This is not a KDE bug. It's a QT 3.2 bug that only causes problems in a specific situation: http://lists.kde.org/?l=koffice-devel&m=106553685018372&w=2 I can't comment on whether it still happens for me (haven't updated kdelibs for a while). But since it clearly still happens for others, I guess I'll have to drag out my QWidget debugging code again and try to write a patch. Tracking down the cause of this bug was a nightmare in itself...
Subject: Dangling pointer dereference in focus data list Hi TT, See http://bugs.kde.org/show_bug.cgi?id=66142 (but ignore the koffice-devel ML link -- there was a "bug" in that description of the cause; corrected below). It can only be reproduced when the filterWidget is not set to be editable (i.e. saving a file with a mimefilter list, with a default type e.g. in KOffice). IIRC, this crash (or at least, valgrind error) is due to a bug in qwidget.cpp: setFocus() and setTabOrder() added one of the KComboBox's (locationEdit?) to 2 separate focusData's (because of the focusProxy() changing, IIRC). And so when this KComboBox destructed, it only removed itself from one focusData list and hence a dangling pointer was left in the other, which later got dereferenced by the other KComboBox (filterWidget?) upon its destruction, causing the crash. I can't reduce the code to a small QT program because it's an _incredible_ pain. So you'll have to try it from KDE_3_1_BRANCH. Thanks, Clarence
Subject: [PATCH] Fixing KLineEdit's use of KCompletionBox The attached patch is for kdelibs/kdeui/klineedit.cpp (The patch is not committed.) It fixes the use of KCompletionBox in KLineEdit. In the documentation of KCompletionBox's constructor is told that the parent *must* be null and that the box *must* be deleted manually. This seems to fix the KOffice CVS HEAD problem at save on KDE 3.1.x. (It is hard to tell, as it did not crahed always anymore.) Clarence, can you confirm? This was tested on KDE KDE_3_1_BRANCH but I suppose that it must be applied on KDE CVS HEAD too. Have a nice day! Created an attachment (id=2855) patch_klineedit.diff
Subject: Re: [PATCH] Fixing KLineEdit's use of KCompletionBox The idea was nice, as it fixed KOffice. However it breaks Konqueror, which becomes unusable (You cannot enter any URL, and the completion list is in the middle of the window.) Have a nice day! On Thursday 23 October 2003 00:28, Nicolas Goutte wrote: > The attached patch is for kdelibs/kdeui/klineedit.cpp (The patch is not > committed.) > > It fixes the use of KCompletionBox in KLineEdit. In the documentation of > KCompletionBox's constructor is told that the parent *must* be null and > that the box *must* be deleted manually. > > This seems to fix the KOffice CVS HEAD problem at save on KDE 3.1.x. (It is > hard to tell, as it did not crahed always anymore.) Clarence, can you > confirm? > > This was tested on KDE KDE_3_1_BRANCH but I suppose that it must be applied > on KDE CVS HEAD too. > > Have a nice day!
Subject: Re: [Issue N33571] Dangling pointer dereference in focus data list On Wednesday, 22. Oct 2003 17:13 Clarence Dang wrote: > See http://bugs.kde.org/show_bug.cgi?id=66142 (but ignore the > koffice-devel ML link -- there was a "bug" in that description of the > cause; corrected below). It can only be reproduced when the > filterWidget is not set to be editable (i.e. saving a file with a > mimefilter list, with a default type e.g. in KOffice). > > IIRC, this crash (or at least, valgrind error) is due to a bug in > qwidget.cpp: > > setFocus() and setTabOrder() added one of the KComboBox's > (locationEdit?) to 2 separate focusData's (because of the focusProxy() > changing, IIRC). And so when this KComboBox destructed, it only > removed itself from one focusData list and hence a dangling pointer > was left in the other, which later got dereferenced by the other > KComboBox (filterWidget?) upon its destruction, causing the crash. > > I can't reduce the code to a small QT program because it's an > _incredible_ > pain. So you'll have to try it from KDE_3_1_BRANCH. Hi Clarence, We do not think that there is a problem in the Qt code, but we maybe wrong. A widget should never be in more than one list. Can you please provide a Qt only example program the has this crash. Regards Pascal Technical Support Trolltech AS, Waldemar Thranes gate 98, NO-0175 Oslo, Norway
Subject: koffice/lib/kofficecore CVS commit by goutte: HACK: give back a mimimum of functionality to the save dialog when compiled under KDE 3.1.x. (For KDE 3.2.x nothing is touched.) This disables the saving to KOffice 1.1 format and to directories. (The entries are now labeled "Empty file". Do *not* use them!) However this permits now people to continue tracking bugs while using KOffice CVS HEAD on KDE 3.1.x. I repeat: this is a *hack*. I am sorry for the inconveniences. CCMAIL:66142@bugs.kde.org M +14 -0 koMainWindow.cc 1.315 --- koffice/lib/kofficecore/koMainWindow.cc #1.314:1.315 @@ -92,4 +92,5 @@ public: Q_ASSERT( mimeFilter[0] == nativeFormat ); +#if KDE_IS_VERSION(3,1,92) // Insert two entries with native mimetypes, for the special entries. QStringList::Iterator mimeFilterIt = mimeFilter.at( 1 ); @@ -120,4 +121,17 @@ public: filterWidget->changeItem (i18n ("%1 (%2 Compatible)").arg (mime->comment ()).arg (compatString), i); } +#else + // ### FIXME: KDE 3.1.x crashes on filterWidget->changeItem + // ### FIXME: So we must provide a hack to have back a minimum of functionality. + // ### FIXME: (Saving to KOffice 1.1 format and to directory are not supported.) + + // Insert two entries with native mimetypes, for the special entries. + QStringList::Iterator mimeFilterIt = mimeFilter.at( 1 ); + mimeFilter.insert( mimeFilterIt /* before 1 -> after 0 */, 2, "application/x-zerosize" ); + // Fill in filter combo + // Note: if currentFormat doesn't exist in mimeFilter, filterWidget + // will default to the first item (native format) + setMimeFilter( mimeFilter, currentFormat.isEmpty() ? nativeFormat : currentFormat ); +#endif }
Subject: [PATCH] A little more for KDE 3.1.x The attached patch is for the file koffice/lib/kofficecore/koMainWindow.cc It gives back, to KOffice CVS HEAD compiled on KDE 3.1.x, the possibility to save to KOffice 1.1 format and to a directory, however now coded as application/x-tgz and text/xml. (Ugly GUI but not any risk anymore to lose the document by choosing the "empty file" entries.) Of course this patch does not fix bug #66142, it is still part of a work-around. Please check if there is anything that I would have missed. (Loading seems to work when choosing the KOffice format.) I think that this patch will give the possibility to release a KOffice 1.3 Beta 5 next week. (I am not sure if Luk
Subject: Re: KWord: crash when saving (destroying file dialog) On Saturday 25 October 2003 18:36, you wrote: > It gives back, to KOffice CVS HEAD compiled on KDE 3.1.x, the possibility to > save to KOffice 1.1 format and to a directory, however now coded as > application/x-tgz and text/xml. (Ugly GUI but not any risk anymore to lose > the document by choosing the "empty file" entries.) > > Of course this patch does not fix bug #66142, it is still part of a > work-around. Cool. Thanks a lot. I'd say apply for now, this makes is possible to release koffice, for the rest we need a kdelibs fix.
*** Bug 65229 has been marked as a duplicate of this bug. ***
*** Bug 66359 has been marked as a duplicate of this bug. ***
Let us change its status, as this bug is getting very annoying. Have a nice day!
Subject: Re: KDE Problem (was: Re: KSpread bugs) Very bad news: bug #66142 seems to affect KOffice 1.2.1 too. :-( So either I have to backport the workaround or we have to speed up the release of KOffice 1.3. (Or of course someone could find a solution for KDE 3.1.x but it seems more difficult.) I get more and more the feeling that some behaviour in Qt 3.2 changed and is therefore triggering the bug. (Sigh, I hoped that I was wrong when I wrote that the RTF filter export bug with Qt 3.2 could be the start of such kinds of bugs.) Have a nice day! On Monday 20 October 2003 10:22, Luk
Hi, Can anyone still reproduce this exact problem with valgrind?: =22769== Invalid read of size 4 ==22769== at 0x402BD21E: ??? (/home/kdevel/cvs/qt-copy/include/qobject.h) ==22769== by 0x40E7755A: QWidget::~QWidget() (kernel/qwidget.cpp) ==22769== by 0x40F617DE: QScrollBar::~QScrollBar() (widgets/qscrollbar.cpp) ==22769== by 0x40F650AA: QScrollView::~QScrollView() (widgets/qscrollview.cpp) (...) See, after upgrading from Qt 3.2.0 to near Qt 3.2.3 (recent qt-copy), I can no longer reproduce those memory errors (even with my contrived program) and have not seen the filedialog crash since. For this reason (and because I had a complete valgrind backtrace sometime ago), I'm confident that it was a qwidget/qfocusdata bug and so I doubt that Nicolas' patches would have made a difference for KDE 3.1 as they didn't attack the source of the problem. Having said this, it seems a new, unrelated bug has appeared :( ==6311== Invalid read of size 2 ==6311== at 0x4047068C: ??? (../include/qstring.h:214) ==6311== by 0x407FD048: QChar::isPrint() const (tools/qstring.cpp:437) ==6311== by 0x40D35A35: KLineEdit::keyPressEvent(QKeyEvent*) (in /home/kdevel/dist/lib/libkdeui.so.4.2.0) ==6311== by 0x405600A2: QWidget::event(QEvent*) (kernel/qwidget.cpp:4472) ==6311== by 0x405F5D24: QLineEdit::event(QEvent*) (widgets/qlineedit.cpp:1406) ==6311== by 0x404C55F7: QApplication::internalNotify(QObject*, QEvent*) (kernel/qapplication.cpp:2582) ==6311== by 0x404C4C12: QApplication::notify(QObject*, QEvent*) (kernel/qapplication.cpp:2339) ==6311== by 0x40A753D0: KApplication::notify(QObject*, QEvent*) (in /home/kdevel/dist/lib/libkdecore.so.4.2.0) ==6311== by 0x4045B189: ??? (kernel/qapplication.h:495) ==6311== by 0x4045611F: QETWidget::translateKeyEvent(_XEvent const*, bool) (kernel/qapplication_x11.cpp:5499) ==6311== by 0x404528E9: QApplication::x11ProcessEvent(_XEvent*) (kernel/qapplication_x11.cpp:3655) ==6311== by 0x4046C786: QEventLoop::processEvents(unsigned) (kernel/qeventloop_x11.cpp:192) ==6311== by 0x404DAEB0: QEventLoop::enterLoop() (kernel/qeventloop.cpp:198) ==6311== by 0x404C57DD: QApplication::enter_loop() (kernel/qapplication.cpp:2737) ==6311== by 0x406BDEAB: QDialog::exec() (dialogs/qdialog.cpp:370) ==6311== by 0x8049C96: main (in /home/kdevel/krash/krash) ==6311== by 0x411FE082: __libc_start_main (in /lib/i686/libc-2.2.5.so) ==6311== by 0x80498A1: free (in /home/kdevel/krash/krash)
Subject: Re: KWord: crash when saving (destroying file dialog) (...) > > For this reason (and because I had a complete valgrind backtrace sometime > ago), I'm confident that it was a qwidget/qfocusdata bug and so I doubt > that Nicolas' patches would have made a difference for KDE 3.1 as they > didn't attack the source of the problem. Having said this, it seems a new, > unrelated bug has appeared :( I have always told that it was a work-around to avoid triggering the problem. Nothing is fixed, which gives the problem that some file names seems to trigger the bug too (see one of the duplicated bugs.) > (...)
*** Bug 69620 has been marked as a duplicate of this bug. ***
Subject: Valgrind log Attached is the log of Valgrind over KWord (with work-around, on KDE 3.1.x) Content: loading KWord, choosing the A4 template, saving as /var/tmp/test.kwd (file already existing) and closing KWord. Perhaps someone experimented with Valgrind can find something out of the data. Also perhaps other Valgrind user could use it as a reference to help debugging this bug. Have a nice day! Created an attachment (id=3584) valgrind.txt
Subject: Re: KWord: crash when saving (destroying file dialog) On Saturday 06 December 2003 21:21, you wrote: > Perhaps someone experimented with Valgrind can find something out of the data. > Also perhaps other Valgrind user could use it as a reference to help debugging > this bug. It's just the usual "crash in KCompletionBox accessing already-deleted data", there's no other info there :( (BTW to get better reports from valgrind, compile everything with --enable-debug or adddebug, and export VALGRIND_OPTS="--num-callers=20" However on this particular problem, it won't help (I've seen the full backtraces already...)
*** Bug 70177 has been marked as a duplicate of this bug. ***
Created attachment 3692 [details] Valgrind-confirmed anti-crash hack for KOffice 1.3 on KDE 3.1
Created attachment 3693 [details] Valgrind-confirmed anti-crash hack for KOffice 1.2 on KDE 3.1
Patch initially written by me; valgrind-tested, corrected and backported to 1.2 by Nicolas Goutte. Works by removing one of the possible "cannon triggers" (filterWidget->setEditable (false) which plays with the focusdata lists). It turns out that the crash disappeared for me because I upgraded both Qt _and_ KDE at the same time. So still a Qt 3.2 bug. On Sat, 13 Dec 2003 08:29 am, Nicolas Goutte wrote: > The question is now if this hack is good enough for a direct KOffice 1.3 or > do we need a KOffice 1.3 RC2? I am not convienced that some of the bugs are > really the same problem.
Subject: KOFFICE_1_2_BRANCH: koffice/lib/kofficecore CVS commit by goutte: HACK: avoid triggering the crash in the file dialog by putting the mime type combo box as editable (only for KDE 3.1.x on Qt 3.2.x) (The hack passes Valgrind. This is a backport of a patch made by Clarence Dang) CCMAIL:66142@bugs.kde.org M +21 -0 koMainWindow.cc 1.268.2.2 --- koffice/lib/kofficecore/koMainWindow.cc #1.268.2.1:1.268.2.2 @@ -53,4 +53,20 @@ #include <kstatusbar.h> + + +// The file dialog bug #66142 happens with KDE 3.1.x on QT 3.2.x +#include <kdeversion.h> +#if KDE_VERSION >= 0x030100 && KDE_VERSION < 0x030190 +# if QT_VERSION >= 0x030200 +# ifdef __GNUC__ +# warning "Including File Dialog Hack!" +# endif +# define FILE_DIALOG_BUG +# include <kpushbutton.h> +# endif +#endif + + + class KoPartManager : public KParts::PartManager { @@ -554,5 +570,10 @@ bool KoMainWindow::saveDocument( bool sa dialog->setCaption( i18n("Save Document As") ); dialog->setKeepLocation( true ); +#ifdef FILE_DIALOG_BUG + dialog->setOperationMode( KFileDialog::Other ); + dialog->okButton()->setGuiItem( KStdGuiItem::save() ); +#else dialog->setOperationMode( KFileDialog::Saving ); +#endif QStringList mimeFilter = KoFilterManager::mimeFilter( _native_format, KoFilterManager::Export ); dialog->setSpecialMimeFilter( mimeFilter, _native_format );
Subject: koffice/lib/kofficecore CVS commit by dang: apply 1.3 version of HACK: don't crash on save filedialog destruction (KDE 3.1 on Qt 3.2) CCMAIL: 66142@bugs.kde.org M +7 -38 koMainWindow.cc 1.319 --- koffice/lib/kofficecore/koMainWindow.cc #1.318:1.319 @@ -41,4 +41,5 @@ #include <kedittoolbar.h> #include <kprogress.h> +#include <kpushbutton.h> #include <kdebug.h> #if ! KDE_IS_VERSION( 3,1,90 ) @@ -85,5 +86,4 @@ public: : KFileDialog( startDir, filter, parent, name, modal ) { } -#if KDE_IS_VERSION(3,1,92) void setSpecialMimeFilter( QStringList& mimeFilter, const QString& currentFormat, const int specialOutputFlag, @@ -123,41 +123,4 @@ public: } -#else - - QString m_nativeFormat; - - void setSpecialMimeFilter( QStringList& mimeFilter, - const QString& currentFormat, const int specialOutputFlag, - const QString& nativeFormat ) - { - Q_ASSERT( !mimeFilter.isEmpty() ); - Q_ASSERT( mimeFilter[0] == nativeFormat ); - - // ### FIXME: KDE 3.1.x crashes on filterWidget->changeItem - // ### FIXME: So we must provide a hack to have back a minimum of functionality. - // ### FIXME: (Saving to KOffice 1.1 format and to directory are not supported.) - - // Insert two entries with native mimetypes, for the special entries. - QStringList::Iterator mimeFilterIt = mimeFilter.at( 1 ); - mimeFilter.insert( mimeFilterIt, "application/x-tgz" ); - mimeFilter.insert( mimeFilterIt, "text/xml" ); - // Fill in filter combo - // Note: if currentFormat doesn't exist in mimeFilter, filterWidget - // will default to the first item (native format) - setMimeFilter( mimeFilter, currentFormat.isEmpty() ? nativeFormat : currentFormat ); - m_nativeFormat=nativeFormat; - } - - QString currentMimeFilter() const // Note: this is not virtual!!! - { - const QString result ( KFileDialog::currentMimeFilter() ); - if ( (result == "application/x-tgz") || (result == "text/xml")) - return m_nativeFormat; - else - return result; - } - -#endif - int specialEntrySelected() { @@ -783,5 +746,11 @@ bool KoMainWindow::saveDocument( bool sa dialog->setCaption( i18n("Export Document As") ); +#if KDE_IS_VERSION(3,1,92) dialog->setOperationMode( KFileDialog::Saving ); +#else + dialog->setOperationMode( KFileDialog::Other ); + dialog->setKeepLocation( true ); + dialog->okButton()->setGuiItem( KStdGuiItem::save() ); +#endif dialog->setSpecialMimeFilter( mimeFilter, isExporting() ? d->m_lastExportFormat : pDoc->mimeType(),
*** Bug has been marked as fixed ***.
*** Bug 86227 has been marked as a duplicate of this bug. ***
*** Bug 71682 has been marked as a duplicate of this bug. ***