Summary: | kpdf crashes on logout if it has a file open | ||
---|---|---|---|
Product: | [Unmaintained] kpdf | Reporter: | Robin Green <greenrd> |
Component: | general | Assignee: | Albert Astals Cid <aacid> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | hugo.costelha, juampe, mueller, prigault |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Patch that could fix it |
Description
Robin Green
2005-07-28 14:28:10 UTC
This seems a duplicate of the already fixed "Settings" crash. -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Con Tele2 risparmi al telefono e su Internet. Sempre. Clicca qui per conoscere le promozioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3757&d=28-7 Confirmed on KDE 3.4.2 . Same backtrace.
> This seems a duplicate of the already fixed "Settings" crash.
BugID ?
It is clearly not fixed in 3.4 branch.
Well, that is quite a bold statement, i really can not reproduce that problem with kpdf 3.4.2. 100% reproducible here. KPDF doe not need to have a file open, by the way. Just open KPDF, log out of KDE -> crash. KDE 3.4.2 compiled from sources (using konstruct). GCC-3.4.3-22 on Fedora Core 3 x86_64 Debugdialog (output in .xsession-errors): <snip> ksmserver: completeShutdown: client kwin(1021224b1dd18a000112258897900000160160000) ksmserver: completeShutdown: client (1021224b1dd18a000112258897900000160160001) ksmserver: completeShutdown: client kdesktop(1021224b1dd18a000112258897900000160160003) ksmserver: completeShutdown: client kicker(1021224b1dd18a000112258897900000160160004) ksmserver: completeShutdown: client klipper(1021224b1dd18a000112258898000000160160005) ksmserver: completeShutdown: client korgac(1021224b1dd18a000112258898000000160160006) ksmserver: completeShutdown: client knotify(1021224b1dd18a000112258898000000160160007) ksmserver: completeShutdown: client kpdf(1021224b1dd18a000112258898400000160160008) ksmserver: We killed all clients. We have now clients.count()=8 ksmserver: KSMServer::completeKilling clients.count()=8 ksmserver: KSMServer::completeKilling clients.count()=7 kdecore (KLibLoader): The KLibLoader contains the library libkpdfpart (0x750f20) kdecore (KLibLoader): Factory still has object 0x758de0 unnamed Library = libkpdfpart kdecore (KConfigSkeleton): Creating KConfigSkeleton (0x8cd660) kdecore (KAction): KActionCollection::~KActionCollection(): this = 0x856f00 kdecore (KAccel): ~KAccel(): this = 0x85c500 kdecore (KAccel): ~KAccelBase(): this = 0x8560b0 kdecore (KAccel): KAccelActions::clear() kdecore (KAction): KAction::slotDestroyed(): this = 0x85d7d0, name = "toggleUrlGrabAction", sender = 0x85c500 kdecore (KAction): KAction::slotDestroyed(): this = 0x85e4e0, name = "clearHistoryAction", sender = 0x85c500 kdecore (KAction): KAction::slotDestroyed(): this = 0x85ebc0, name = "configureAction", sender = 0x85c500 kdecore (KAction): KAction::slotDestroyed(): this = 0x85f1f0, name = "quitAction", sender = 0x85c500 kdecore (KAction): KAction::~KAction( this = "toggleUrlGrabAction" ) kdecore (KAction): KAction::~KAction( this = "clearHistoryAction" ) kdecore (KAction): KAction::~KAction( this = "configureAction" ) kdecore (KAction): KAction::~KAction( this = "quitAction" ) kdecore (KAccel): ~KGlobalAccel(): this = 0x865c20 kdecore (KAccel): ~KAccelBase(): this = 0x863908 kdecore (KAccel): KAccelActions::clear() KCrash: crashing... crashRecursionCounter = 2 KCrash: Application Name = kpdf path = <unknown> pid = 16047 ksmserver: KSMServer::completeKilling clients.count()=6 DCOP: unregister 'kpdf-16047' <snip> It happens on my 32-bit (i686) build of 3.4.2 too. Just so we rule that it is 64-bit specific. Opps, typo. Just so we rule OUT a 64-bit specific bug. *** Bug 110613 has been marked as a duplicate of this bug. *** *** Bug 111886 has been marked as a duplicate of this bug. *** Well, the description in bug 110613, reported by Juan Pedro Paredes, pretty much says where the problem seems to be. Any of you is able of testing a patch against kde 3.5 branch? Just a note from today's chat between Albert and me, to help collecting thoughts: [18:48] TSDgeos: because i just got 3 reports like that in a few days [18:49] TSDgeos: searched for that fix you mention and don't remember it [18:49] Koral: aahh! the infamous "Settings" stuff ? [18:49] TSDgeos: yeah [18:50] TSDgeos: wondering why it does not crash here [18:50] TSDgeos: and if we really fixed it [18:50] Koral: I referred to when Settings was renamed to KpdfSettings. that could have prevented more errors like this one.. [18:51] TSDgeos: ah [18:51] TSDgeos: no, i think it's different [18:51] Koral: Before the Settings class was renamed, I found that it could mean something and [18:52] Koral: In annotations I removed all Settings:: call in destructors [18:52] Koral: becouse I found that KStaticDeleter deleted the Setting class (from the KPART) BEFORE the DESTRUCTORS of classes [18:52] TSDgeos: where did you place the one about the splitters? [18:53] Koral: when the splitter is moved I think [18:53] Koral: (when it's dropped) [18:53] TSDgeos: ok, let's see if that helps Created attachment 12449 [details]
Patch that could fix it
If anyone could test this patch (against 3.5 branch) and tell me if it works it
would be great
Dirk any chance you could reproduce it and the patch works for you? Albert: No, I'm unable to reproduce the crash (3.4branch). I just subscribed because it was reported in Novell bugzilla as well, so I can backport the fix when its done. The patch works great for me. I can do dcop logout. Later all is restored. SVN commit 465437 by aacid: Don't use KpdfSettings from the destructor as it seems to cause some problems for users, should fix bug 109764 BUGS: 109764 M +21 -5 part.cpp M +3 -0 part.h M +4 -0 ui/pageview.cpp M +1 -0 ui/thumbnaillist.cpp --- branches/KDE/3.5/kdegraphics/kpdf/part.cpp #465436:465437 @@ -267,6 +267,9 @@ splitterSizes.push_back( 500 ); } m_splitter->setSizes( splitterSizes ); + // get notified about splitter size changes (HACK that will be removed + // by connecting to Qt4::QSplitter's sliderMoved()) + m_pageView->installEventFilter( this ); m_watcher = new KDirWatch( this ); connect( m_watcher, SIGNAL( dirty( const QString& ) ), this, SLOT( slotFileDirty( const QString& ) ) ); m_dirtyHandler = new QTimer( this ); @@ -277,6 +280,7 @@ // [SPEECH] check for KTTSD presence and usability KTrader::OfferList offers = KTrader::self()->query("DCOP/Text-to-Speech", "Name == 'KTTSD'"); KpdfSettings::setUseKTTSD( (offers.count() > 0) ); + KpdfSettings::writeConfig(); // set our XML-UI resource file setXMLFile("part.rc"); @@ -285,11 +289,6 @@ Part::~Part() { - // save internal settings - KpdfSettings::setSplitterSizes( m_splitter->sizes() ); - // write to disk config file - KpdfSettings::writeConfig(); - delete m_document; if ( --m_count == 0 ) delete globalParams; @@ -475,10 +474,21 @@ return KParts::ReadOnlyPart::closeURL(); } +bool Part::eventFilter( QObject * watched, QEvent * e ) +{ + // if pageView has been resized, save splitter sizes + if ( watched == m_pageView && e->type() == QEvent::Resize ) + saveSplitterSize(); + + // only intercept events, don't block them + return false; +} + void Part::slotShowLeftPanel() { bool showLeft = m_showLeftPanel->isChecked(); KpdfSettings::setShowLeftPanel(showLeft); + KpdfSettings::writeConfig(); // show/hide left qtoolbox m_leftPanel->setShown( showLeft ); // this needs to be hidden explicitly to disable thumbnails gen @@ -572,6 +582,12 @@ KMessageBox::information(widget(), i18n("This link points to a quit application action that does not work when using the embedded viewer."), QString::null, "warnNoQuitIfNotInKPDF"); } +void Part::saveSplitterSize() +{ + KpdfSettings::setSplitterSizes( m_splitter->sizes() ); + KpdfSettings::writeConfig(); +} + //BEGIN go to page dialog class KPDFGotoPageDialog : public KDialogBase { --- branches/KDE/3.5/kdegraphics/kpdf/part.h #465436:465437 @@ -86,6 +86,8 @@ bool openFile(); bool openURL(const KURL &url); bool closeURL(); + // filter that watches for splitter size changes + bool eventFilter( QObject * watched, QEvent * e ); protected slots: void openURLFromDocument(const KURL &url); @@ -114,6 +116,7 @@ void enableTOC(bool enable); void psTransformEnded(); void cannotQuit(); + void saveSplitterSize(); void setMimeTypes(KIO::Job *job); public slots: --- branches/KDE/3.5/kdegraphics/kpdf/ui/pageview.cpp #465436:465437 @@ -1097,6 +1097,7 @@ { d->messageWindow->display( i18n("Starting KTTSD Failed: %1").arg(error) ); KpdfSettings::setUseKTTSD(false); + KpdfSettings::writeConfig(); } } if ( KpdfSettings::useKTTSD() ) @@ -1444,6 +1445,7 @@ // save selected zoom factor KpdfSettings::setZoomMode(newZoomMode); KpdfSettings::setZoomFactor(newFactor); + KpdfSettings::writeConfig(); } } @@ -1913,6 +1915,7 @@ if ( KpdfSettings::viewColumns() != newColumns ) { KpdfSettings::setViewColumns( newColumns ); + KpdfSettings::writeConfig(); if ( d->document->pages() > 0 ) slotRelayoutPages(); } @@ -1923,6 +1926,7 @@ if ( KpdfSettings::viewContinuous() != on ) { KpdfSettings::setViewContinuous( on ); + KpdfSettings::writeConfig(); if ( d->document->pages() > 0 ) slotRelayoutPages(); } --- branches/KDE/3.5/kdegraphics/kpdf/ui/thumbnaillist.cpp #465436:465437 @@ -247,6 +247,7 @@ { // save state KpdfSettings::setFilterBookmarks( filterOn ); + KpdfSettings::writeConfig(); // ask for the 'notifySetup' with a little trick (on reinsertion the // document sends the list again) m_document->removeObserver( this ); |