Crash in KHTMLFind

Sebastian Sauer mail at dipe.org
Mon Nov 24 09:57:09 GMT 2008


Harri Porten wrote:

> Hi!
> 
> I like the new search in KHTML. But I just ran into a crash in KHTMLFind:
> 
> #5  KFind::pattern (this=0x0) at
> #/home/porten/svn4/trunk/kdelibs/kdeui/findreplace/kfind.cpp:665
> #6  0x00007ffea11d9e67 in KHTMLFind::findTextNext (this=0xc6ade0,
> #reverse=false)
>      at /home/porten/svn4/trunk/kdelibs/khtml/find/khtmlfind.cpp:277
> #7  0x00007ffea1151d60 in KHTMLFind::qt_metacall (this=0xc6ade0,
> #_c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>,
> #_a=0x7fffb7204ca0)
>      at /home/porten/obj4/trunk/kdelibs/khtml/moc_khtmlfind_p.cpp:88
> #8  0x00007ffeac50b260 in QMetaObject::activate () from
> #/home/porten/svn4/trunk/qt-copy/lib/libQtCore.so.4
> #9  0x00007ffea1151998 in KHTMLFindBar::qt_metacall (this=0x10f19a0,
> #_c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>,
> #_a=0x7fffb7204e00)
>      at /home/porten/obj4/trunk/kdelibs/khtml/moc_khtmlfindbar.cpp:76
> #10 0x00007ffeac50b260 in QMetaObject::activate () from
> #/home/porten/svn4/trunk/qt-copy/lib/libQtCore.so.4 11 0x00007ffeabe04af7
> #in QAbstractButton::clicked () from
> #/home/porten/svn4/trunk/qt-copy/lib/libQtGui.so.4
> 
> No idad how I exactly managed to do that unfortunately. A patch likely to
> prevent the crash would be the following:

noise from the internet;
looks as m_part->document().isNull() is true (no DOM::Document) and therefore 
d->m_find wan't be created+set :-)

> --- find/khtmlfind.cpp  (revision 887791)
> +++ find/khtmlfind.cpp  (working copy)
> @@ -262,6 +262,9 @@
>     {
>       // We didn't show the find dialog yet, let's do it then (#49442)
>       activate();
> +    // Blocked for some reason
> +    if (!d->m_find)
> +      return false;
>       // It also means the user is trying to match a previous pattern, so
> try and
>       // restore the last saved pattern.
>       if (!d->m_findDialog ||
> !d->m_findDialog->restoreLastPatternFromHistory())
> 
> But maybe the problem is elsewhere like the function better not being
> callable in the first place? CC'ing Bernhard.
> 
> Harri.
> 




More information about the kfm-devel mailing list