Bug 99415 - crashes konqueror when trying to open a pdf after one has already been opened
Summary: crashes konqueror when trying to open a pdf after one has already been opened
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Applications
Component: general (show other bugs)
Version: 0.4
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-15 01:23 UTC by Mike Sears
Modified: 2005-12-18 16:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
backtrace from attaching to konqueror with kpdf (2.82 KB, text/plain)
2005-02-18 15:51 UTC, Marek Lotke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Sears 2005-02-15 01:23:09 UTC
Version:           0.4 (using KDE KDE 3.3.92)
Installed from:    Compiled From Sources
Compiler:          gcc-3.4.3 
OS:                Linux

Using konqueror I go to a web page and open a pdf with kpdf. The first time this works. If you then back arrow and try to open any other pdf in the same fashion, konqueror locks up.
Comment 1 Thiago Macieira 2005-02-15 04:21:03 UTC
Could be a duplicate of Bug #99242
Comment 2 Albert Astals Cid 2005-02-15 09:35:53 UTC
Probably a dup of 99222 and 99363
A shame that noone has a valid backtrace and that i can't reproduce it
Comment 3 Thiago Macieira 2005-02-15 10:57:36 UTC
Neither can I. Some of these reporters are using recent builds. Any chance someone could upgrade to HEAD?
Comment 4 Mike Sears 2005-02-15 18:52:28 UTC
Tell me how to get a backtrace (of an app that technically hasn't crashed but is hung) and I can get it to you.  I can reproduce this on two different boxes.
Comment 5 Albert Astals Cid 2005-02-15 19:04:44 UTC
Have a look at http://bugs.kde.org/show_bug.cgi?id=98894 Comment #9

BTW if you are using Phase Style this is a know bug in its code and you have to update it?
Comment 6 Mike Sears 2005-02-15 19:08:03 UTC
it's not 98894.
I'm not using Phase...I'm using Plastik. Also I can view the entire pdf on the first download, just as you would expect to be able to. Everything hangs when you try to open a second pdf.
Comment 7 Albert Astals Cid 2005-02-15 19:13:44 UTC
I just realised you won't find a kpdf process number doing ps aux because you are embedding kpdf inside konqueror, so do the same but with konqueror. Hope i explain myself.
Comment 8 Mike Sears 2005-02-15 19:17:12 UTC
ok, sorry I misunderstood the earlier directions...I'll try the instructions shortly and report back.
Comment 9 Marek Lotke 2005-02-18 15:49:48 UTC
If I may cut in. I use kde-3.4.0_beta2 from gentoo split ebuilds.
When it hangs it prints to .xsession-errors the following lines:
konqueror: Switching view modes...
konqueror: Trying to create view for "application/pdf"
kio (KTrader): query for application/pdf, Application : returning 2 offers
kio (KTrader): query for application/pdf, KParts/ReadOnlyPart : returning 3 offers
konqueror: kpdf_part : X-KDE-BrowserView-AllowAsDefault is valid : false
konqueror: KonqView::switchView
DCOP: unregister 'anonymous-29352'
kio (KLauncher): KLauncher: Got start_service_by_name('KTTSD', ...)
DCOPServer::DCOPReply for unknown connection.
Comment 10 Marek Lotke 2005-02-18 15:51:54 UTC
Created attachment 9697 [details]
backtrace from attaching to konqueror with kpdf
Comment 11 Gary Cramblitt 2005-02-19 00:27:43 UTC
It looks like the code in part.cpp is starting KTTSD in order to determine if the context menu item should be enabled/displayed or not.  Instead of starting KTTSD, which is something user might not want, you could detect if KTTSD is available something like this:

    // If KTTSD is not installed, hide action.
    KTrader::OfferList offers = KTrader::self()->query("DCOP/Text-to-Speech", "Name == 'KTTSD'");
    if (offers.count() > 0)
        // Enable context menu option.
    else
        // Disable context menu option.

Then if user chooses to speak text, start KTTSD if needed.

Note: You may have to insert a delay after starting KTTSD before sending it text to speak.  I have some code like this in kdebase/konqueror/kttsplugin/khtmlkttsd.cpp to deal with this:

void KHTMLPluginKTTSD::slotReadOut()
{
    DCOPClient *client = kapp->dcopClient();

    // If KTTSD not running, start it.
    if (!client->isApplicationRegistered("kttsd"))
    {
        QString error;
        if (kapp->startServiceByName("KTTSD", QStringList(), &error))
            QMessageBox::warning(0, i18n( "Starting KTTSD Failed"), error );
        else
        {
            // Give KTTSD time to load.
            QTimer::singleShot(1000, this, SLOT(slotReadOut()));
                return;
        }
    }

This may or may not be needed.  I'm not sure.
Comment 12 Albert Astals Cid 2005-02-19 00:55:04 UTC
Hi, that may be another bug (i'll try to fix it tomorrow), but the backtrace says that konqueror hangs at KApplication::startServiceByName() so that should not be the problem
Comment 13 Gary Cramblitt 2005-02-19 01:17:44 UTC
Waldo says to use startServiceByDesktopName("kttsd", ..) rather than startServiceByName("KTTSD", ..), which eliminates need to wait for KTTSD to start up.  And it may also fix this problem. :)

if ( KApplication::startServiceByName( "kttsd" ) )
    Settings::setUseKTTSD( false );
Comment 14 Marek Lotke 2005-02-19 12:44:36 UTC
Thanks! It is fixed with part.cpp version 1.27.
Comment 15 Albert Astals Cid 2005-02-19 13:08:27 UTC
Cool :-) Mike can you please try to update and see if it works for you too?
Comment 16 Sebastian Strand 2005-02-28 23:14:48 UTC
I had this problem in beta2, but in rc1 it works fine.
Comment 17 Albert Astals Cid 2005-03-01 09:32:26 UTC
So could we close it as seems Waldo commit fixed it for those who were having the problem?

Mike are you there? Can you test on KDE 3.4.0 RC1 too?
Comment 18 Albert Astals Cid 2005-12-18 16:38:18 UTC
Anyone on this bug can test if this still happens for you in KDE 3.5.0 ?
Comment 19 dierck.hillmann 2005-12-18 16:41:21 UTC
Atleast for me it was already fixed in 3.4.0...
Comment 20 Albert Astals Cid 2005-12-18 16:50:43 UTC
Ok, marking it as fixed, if it still happens for someone please reopen the bug.