Bug 126812

Summary: Recurring Crash on particular 404 url in embedded HTML viewer
Product: [Applications] akregator Reporter: Ned Boony <crazyned>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: avuton, kde, kdebugs, kde_bugzilla_2, klan, latency, mail, marsup, matthew.flaschen, mg, michal, moltonel
Priority: NOR    
Version: 1.2.1   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: fix

Description Ned Boony 2006-05-05 19:26:59 UTC
Version:           1.2.1 (using KDE 3.5.2, Gentoo)
Compiler:          gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)
OS:                Linux (i686) release 2.6.14-gentoo-r5

1) Add this feed: http://feeds.kedora.org/show/thescene/rss20/index.xml

2) Set feed to "Load the full website when reading articles" in its properties

3) Click on "Episode 10"

4) Crash

=
The article url is http://www.welcometothescene.com/downloadb.php?ep=10 which is a 404 error (obvious typo by RSS maintainer), which can be otherwise viewed normally in akregator's tabbed HTML browser; only the embedded HTML viewer appears to have problems.
Comment 1 Eckhart Wörner 2006-05-06 12:50:17 UTC
Confirmed, seems that Akregator crashes on HTTP 404.
Comment 2 Frank Osterfeld 2006-05-10 14:08:31 UTC
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
`system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1243806016 (LWP 8235)]
[KCrash handler]
#6  0xb77f1594 in QGuardedPtr<khtml::RenderPart>::operator khtml::RenderPart*
    (this=0x28) at qguardedptr.h:117
#7  0xb77e029e in KHTMLPart::slotFinished (this=0x82793f8, job=0x83f1a18)
    at khtml_part.cpp:1847
#8  0xb77ed729 in KHTMLPart::qt_invoke (this=0x82793f8, _id=19, _o=0xbfe38c84)
    at khtml_part.moc:504
#9  0xb5ac7c7c in Akregator::Viewer::qt_invoke (this=0x82793f8, _id=19, 
    _o=0xbfe38c84) at viewer.moc:201
#10 0xb5acd79c in Akregator::ArticleViewer::qt_invoke (this=0x82793f8, 
    _id=19, _o=0xbfe38c84) at articleviewer.moc:136
#11 0xb65a4a56 in QObject::activate_signal ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#12 0xb71e3b0a in KIO::Job::result (this=0x83f1a18, t0=0x83f1a18)
    at jobclasses.moc:162
#13 0xb71e3baa in KIO::Job::emitResult (this=0x83f1a18) at job.cpp:226
#14 0xb71e66f9 in KIO::SimpleJob::slotFinished (this=0x83f1a18) at job.cpp:574
#15 0xb71f220e in KIO::TransferJob::slotFinished (this=0x83f1a18)
    at job.cpp:944
#16 0xb71e6f9a in KIO::TransferJob::qt_invoke (this=0x83f1a18, _id=17, 
    _o=0xbfe3900c) at jobclasses.moc:1071
#17 0xb65a4929 in QObject::activate_signal ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#18 0xb65a53c4 in QObject::activate_signal ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#19 0xb71d2bfe in KIO::SlaveInterface::finished (this=0x95d19b8)
    at slaveinterface.moc:226
#20 0xb71d49a0 in KIO::SlaveInterface::dispatch (this=0x95d19b8, _cmd=104, 
    rawdata=@0xbfe39210) at slaveinterface.cpp:243
#21 0xb71d42ac in KIO::SlaveInterface::dispatch (this=0x95d19b8)
    at slaveinterface.cpp:173
#22 0xb71d0776 in KIO::Slave::gotInput (this=0x95d19b8) at slave.cpp:300
#23 0xb71d0be9 in KIO::Slave::qt_invoke (this=0x95d19b8, _id=4, _o=0xbfe39358)
    at slave.moc:113
#24 0xb65a4929 in QObject::activate_signal ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#25 0xb65a5238 in QObject::activate_signal ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#26 0xb6904c67 in QSocketNotifier::activated ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#27 0xb65c4faa in QSocketNotifier::event ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#28 0xb653bf80 in QApplication::internalNotify ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#29 0xb653c172 in QApplication::notify ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#30 0xb6c052d2 in KApplication::notify (this=0xbfe39934, receiver=0x928b800, 
    event=0xbfe396b0) at kapplication.cpp:550
#31 0xb77c3c1c in QApplication::sendEvent (receiver=0x928b800, 
    event=0xbfe396b0) at qapplication.h:491
#32 0xb652dacb in QEventLoop::activateSocketNotifiers ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#33 0xb64e0a60 in QEventLoop::processEvents ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#34 0xb6553cfb in QEventLoop::enterLoop ()
   from /usr/share/qt3/lib/libqt-mt.so.3
#35 0xb6553c1e in QEventLoop::exec () from /usr/share/qt3/lib/libqt-mt.so.3
#36 0xb653ac13 in QApplication::exec () from /usr/share/qt3/lib/libqt-mt.so.3
#37 0x080515f0 in main (argc=7, argv=0xbfe39ae4) at main.cpp:110
Comment 3 Frank Osterfeld 2006-05-10 23:05:50 UTC
SVN commit 539530 by osterfeld:

I don't see a reason to disable javascript in the article viewer.
This fixes a crash when an error is returned (e.g. 404), which occurs only when
JS is disabled. I can't reproduce it in konqueror, so I assume our current Viewer classes
misuse the KHTMLPart interface too much.
BUG: 126812



 M  +2 -1      ChangeLog  
 M  +1 -1      src/viewer.cpp  


--- branches/KDE/3.5/kdepim/akregator/ChangeLog #539529:539530
@@ -6,7 +6,8 @@
 -----------------------------
 
 New features:
-
+ 2006/05/10 fix crash when using "Load the full website when reading articles" and an error (e.g. 404) 
+            is returned
  2006/05/01 add author information to article header (in the article pane only) -fo
 
 Bug fixes:
--- branches/KDE/3.5/kdepim/akregator/src/viewer.cpp #539529:539530
@@ -323,7 +323,7 @@
 
 void Viewer::setSafeMode()
 {
-    setJScriptEnabled(false);
+    //setJScriptEnabled(false);
     setJavaEnabled(false);
     setMetaRefreshEnabled(false);
     setPluginsEnabled(false);
Comment 4 Frank Osterfeld 2006-06-21 12:02:34 UTC
*** Bug 129480 has been marked as a duplicate of this bug. ***
Comment 5 Frank Osterfeld 2006-06-21 12:04:16 UTC
*** Bug 124465 has been marked as a duplicate of this bug. ***
Comment 6 Frank Osterfeld 2006-07-05 14:13:57 UTC
*** Bug 130293 has been marked as a duplicate of this bug. ***
Comment 7 Frank Osterfeld 2006-07-18 08:14:52 UTC
*** Bug 131009 has been marked as a duplicate of this bug. ***
Comment 8 Frank Osterfeld 2006-11-03 01:58:56 UTC
This happens again as JS is disabled again since 3.5.5.
Comment 9 Frank Osterfeld 2006-11-03 02:00:14 UTC
*** Bug 136213 has been marked as a duplicate of this bug. ***
Comment 10 Tommi Tervo 2006-11-15 15:08:39 UTC
*** Bug 137372 has been marked as a duplicate of this bug. ***
Comment 11 Frank Osterfeld 2007-01-27 21:00:15 UTC
*** Bug 138756 has been marked as a duplicate of this bug. ***
Comment 12 Marcin Gryszkalis 2007-02-01 14:57:01 UTC
Still crashes in 1.2.6/kde 3.5.6 :(
Comment 13 Frank Osterfeld 2007-02-10 12:18:57 UTC
*** Bug 141286 has been marked as a duplicate of this bug. ***
Comment 14 Jai 2007-02-13 04:17:48 UTC
Also crashes on this link:
http://www.tpmmuckraker.com/archives/002539.php
Comment 15 Eckhart Wörner 2007-02-18 23:40:50 UTC
*** Bug 141893 has been marked as a duplicate of this bug. ***
Comment 16 Frank Osterfeld 2007-02-24 23:11:34 UTC
I was able to reproduce this bug in a simple test app only containing a KHTMLPart with JS disabled, calling openURL() with any URL that triggers a 404 error. The following patch fixes the issue.

Index: khtml_part.cpp
===================================================================
--- khtml_part.cpp      (revision 636711)
+++ khtml_part.cpp      (working copy)
@@ -1843,7 +1843,7 @@
   }
   KIO::TransferJob *tjob = ::qt_cast<KIO::TransferJob*>(job);
   if (tjob && tjob->isErrorPage()) {
-    khtml::RenderPart *renderPart = d->m_frame->m_frame;
+    khtml::RenderPart* renderPart = d->m_frame ? d->m_frame->m_frame : 0;
     if (renderPart) {
       HTMLObjectElementImpl* elt = static_cast<HTMLObjectElementImpl *>(renderPart->element());
       if (!elt)
Comment 17 Frank Osterfeld 2007-02-24 23:25:25 UTC
Created attachment 19802 [details]
fix

Now as attachment, with minor changes (s/0/0L, put the * so that it's
consistent with the style in the file)
Comment 18 Frank Osterfeld 2007-02-24 23:43:14 UTC
SVN commit 636988 by osterfeld:

Check for m_frame == 0 here, which can occur when JS is disabled
BUG: 126812


 M  +1 -1      khtml_part.cpp  


--- branches/KDE/3.5/kdelibs/khtml/khtml_part.cpp #636987:636988
@@ -1843,7 +1843,7 @@
   }
   KIO::TransferJob *tjob = ::qt_cast<KIO::TransferJob*>(job);
   if (tjob && tjob->isErrorPage()) {
-    khtml::RenderPart *renderPart = d->m_frame->m_frame;
+    khtml::RenderPart *renderPart = d->m_frame ? d->m_frame->m_frame : 0L;
     if (renderPart) {
       HTMLObjectElementImpl* elt = static_cast<HTMLObjectElementImpl *>(renderPart->element());
       if (!elt)
Comment 19 Frank Osterfeld 2007-02-24 23:51:45 UTC
SVN commit 636991 by osterfeld:

forwardport:

Check for m_frame == 0 here, which can occur when JS is disabled
CCBUG: 126812


 M  +1 -1      khtml_part.cpp  


--- trunk/KDE/kdelibs/khtml/khtml_part.cpp #636990:636991
@@ -1847,7 +1847,7 @@
   }
   KIO::TransferJob *tjob = ::qobject_cast<KIO::TransferJob*>(job);
   if (tjob && tjob->isErrorPage()) {
-    khtml::RenderPart *renderPart = d->m_frame->m_frame;
+    khtml::RenderPart *renderPart = d->frame ? d->m_frame->m_frame : 0L;
     if (renderPart) {
       HTMLObjectElementImpl* elt = static_cast<HTMLObjectElementImpl *>(renderPart->element());
       if (!elt)
Comment 20 Frank Osterfeld 2007-02-25 10:27:40 UTC
*** Bug 141210 has been marked as a duplicate of this bug. ***
Comment 21 Frank Osterfeld 2007-05-14 09:05:38 UTC
*** Bug 145351 has been marked as a duplicate of this bug. ***
Comment 22 Eckhart Wörner 2007-05-20 00:32:03 UTC
*** Bug 145662 has been marked as a duplicate of this bug. ***