Bug 238454 - Improve UI responsiveness while running unresponsive online quotes
Summary: Improve UI responsiveness while running unresponsive online quotes
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: git (master)
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-22 04:08 UTC by Jan
Modified: 2022-09-12 22:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan 2010-05-22 04:08:35 UTC
Version:           1.0.4 (using KDE 4.3.5)
OS:                Linux
Installed from:    Ubuntu Packages

On several occasions the program hung, most often when doing an edit, e.g. edit an investment, edit an account.  Most of the time I can exit by clicking the exit icon in the top right corner (and confirm that the OS can kill the application which it says does not respond), at times I need to kill the process from a shell window.  I hooked up to the process with the debugger a couple of times and found that it was looping in GetTimeOfDay every single time.  If I start KMM anew and edit the same investment, it will hang again.
Comment 1 Thomas Baumgart 2010-05-22 08:04:58 UTC
GetTimeOfDay does not ring any bell here, so it must be something inside Qt.

Can you run the program under control of gdb, interrupt it when it hangs and add a backtrace to this post, or try to create an anonymized version of your file, check if that also causes the problem and send it to us?  Instructions can be found on http://kmymoney2.sourceforge.net/online-manual/details.formats.anonymous.html
Comment 2 Jan 2010-05-22 16:24:18 UTC
Riht now I cannot edit any investments at all; it hangs every single time.  I executed the following gdbcommand and got the attached traceback:

gdb /usr/bin/kmymoney2 <pid>  where <pid> was the KMM process ID

#0  0x004eb422 in __kernel_vsyscall ()
#1  0x063db6d6 in gettimeofday () from /lib/tls/i686/cmov/libc.so.6
#2  0x04813598 in QTime::currentTime(QTime*, Qt::TimeSpec) () from /usr/lib/libqt-mt.so.3
#3  0x0481368f in QTime::currentTime(Qt::TimeSpec) () from /usr/lib/libqt-mt.so.3
#4  0x048136ca in QTime::currentTime() () from /usr/lib/libqt-mt.so.3
#5  0x045012eb in QEventLoop::processEvents(unsigned int, int) () from /usr/lib/libqt-mt.so.3
#6  0x044e8a9e in QApplication::processEvents(int) () from /usr/lib/libqt-mt.so.3
#7  0x044e8ad5 in QApplication::processEvents() () from /usr/lib/libqt-mt.so.3
#8  0x084ec075 in WebPriceQuote::quoteSourcesFinanceQuote() ()
#9  0x084f1a29 in WebPriceQuote::quoteSources(WebPriceQuote::_quoteSystemE) ()
#10 0x083471a9 in KNewInvestmentWizard::slotSourceChanged(bool) ()
#11 0x08348630 in KNewInvestmentWizard::qt_invoke(int, QUObject*) ()
#12 0x0454d19a in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#13 0x0454f291 in QObject::activate_signal_bool(int, bool) () from /usr/lib/libqt-mt.so.3
#14 0x048b35cf in QButton::toggled(bool) () from /usr/lib/libqt-mt.so.3
#15 0x045e7a96 in QButton::setState(QButton::ToggleState) () from /usr/lib/libqt-mt.so.3
#16 0x08347cc1 in KNewInvestmentWizard::init2() ()
#17 0x083488d6 in KNewInvestmentWizard::KNewInvestmentWizard(MyMoneyAccount const&, QWidget*, char const*) ()
#18 0x0814cc7a in KMyMoney2App::slotInvestmentEdit() ()
#19 0x0819123d in KMyMoney2App::qt_invoke(int, QUObject*) ()
#20 0x0454d19a in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#21 0x0454f168 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
#22 0x08efea09 in KAction::activated() () from /usr/lib/libkdeui.so.4
#23 0x08f4f8e0 in KAction::slotActivated() () from /usr/lib/libkdeui.so.4
#24 0x08ff8637 in KAction::slotPopupActivated() () from /usr/lib/libkdeui.so.4
#25 0x08ff8770 in KAction::qt_invoke(int, QUObject*) () from /usr/lib/libkdeui.so.4
#26 0x0454d19a in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#27 0x048abd0e in QSignal::signal(QVariant const&) () from /usr/lib/libqt-mt.so.3
#28 0x04569b27 in QSignal::activate() () from /usr/lib/libqt-mt.so.3
#29 0x0465baaf in QPopupMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libqt-mt.so.3
#30 0x08f2b921 in KPopupMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libkdeui.so.4
#31 0x04586d81 in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3
#32 0x044e83d7 in QApplication::internalNotify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
#33 0x044e94f5 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
#34 0x01fd367c in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdecore.so.4
#35 0x044826ce in QApplication::sendSpontaneousEvent(QObject*, QEvent*) ()
   from /usr/lib/libqt-mt.so.3
#36 0x0447f745 in QETWidget::translateMouseEvent(_XEvent const*) () from /usr/lib/libqt-mt.so.3
#37 0x0447e237 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libqt-mt.so.3
#38 0x04492884 in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3
#39 0x045013b0 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3
#40 0x044e899f in QApplication::enter_loop() () from /usr/lib/libqt-mt.so.3
#41 0x0465ecc1 in QPopupMenu::exec(QPoint const&, int) () from /usr/lib/libqt-mt.so.3
#42 0x0814c84f in KMyMoney2App::showContextMenu(QString const&) ()
#43 0x0814f0e9 in KMyMoney2App::slotShowInvestmentContextMenu() ()
#44 0x08190a55 in KMyMoney2App::qt_invoke(int, QUObject*) ()
#45 0x0454d19a in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#46 0x0454f168 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
#47 0x08232af0 in KInvestmentView::investmentRightMouseClick() ()
#48 0x08232f0e in KInvestmentView::slotListContextMenu(KListView*, QListViewItem*, QPoint const&) ()
#49 0x0823603d in KInvestmentView::qt_invoke(int, QUObject*) ()
#50 0x0454d19a in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#51 0x08f4c975 in KListView::contextMenu(KListView*, QListViewItem*, QPoint const&) ()
   from /usr/lib/libkdeui.so.4
#52 0x08f4c9bf in KListView::emitContextMenu(QListViewItem*, QPoint const&, int) ()
   from /usr/lib/libkdeui.so.4
#53 0x090132ad in KListView::qt_invoke(int, QUObject*) () from /usr/lib/libkdeui.so.4
#54 0x0454d19a in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#55 0x048bf4c5 in QListView::rightButtonPressed(QListViewItem*, QPoint const&, int) ()
#56 0x0463ddc7 in QListView::contentsMousePressEventEx(QMouseEvent*) () from /usr/lib/libqt-mt.so.3
#57 0x0463e334 in QListView::contentsMousePressEvent(QMouseEvent*) () from /usr/lib/libqt-mt.so.3
#58 0x08f28aaf in KListView::contentsMousePressEvent(QMouseEvent*) () from /usr/lib/libkdeui.so.4
#59 0x0466b4e6 in QScrollView::viewportMousePressEvent(QMouseEvent*) () from /usr/lib/libqt-mt.so.3
#60 0x04669e79 in QScrollView::eventFilter(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
#61 0x0463655b in QListView::eventFilter(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
#62 0x0454d23c in QObject::activate_filters(QEvent*) () from /usr/lib/libqt-mt.so.3
#63 0x0454d2ab in QObject::event(QEvent*) () from /usr/lib/libqt-mt.so.3
#64 0x04586c6c in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3
#65 0x044e83d7 in QApplication::internalNotify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
#66 0x044e94f5 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
#67 0x01fd367c in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdecore.so.4
#68 0x044826ce in QApplication::sendSpontaneousEvent(QObject*, QEvent*) ()
   from /usr/lib/libqt-mt.so.3
#69 0x0447f439 in QETWidget::translateMouseEvent(_XEvent const*) () from /usr/lib/libqt-mt.so.3
#70 0x0447e237 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libqt-mt.so.3
#71 0x04492884 in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3
#72 0x045013b0 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3
#73 0x04501256 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3
#74 0x044e8a2f in QApplication::exec() () from /usr/lib/libqt-mt.so.3
#75 0x08197315 in main ()
Comment 3 Thomas Baumgart 2010-05-22 18:47:48 UTC
Looks like you have a Finance::Quote installation and that does not return for some reason.

#8  0x084ec075 in WebPriceQuote::quoteSourcesFinanceQuote() ()
#9  0x084f1a29 in WebPriceQuote::quoteSources(WebPriceQuote::_quoteSystemE) ()

show just that. Can you check in that area? Did you change anything in your installation after you created the investments?
Comment 4 Jan 2010-05-22 19:31:13 UTC
I did not [knowingly] change anything in my installation.  I looked at /usr/share/apps/kmymoney2/misc/financequote.pl but did not change it (time stamp is OK).  I did change a configuration setting in Online Quotes (URL for Yahoo France).  How can I check if anything is corrupted?

I have two investments that do not return (not found) when updating online.  I have had these for over a week, and have successfully edited investments since.  When updating online, and the error box popped up for these investments, I always selected the option YES (continue updating this security).  Since I cannot edit these investments to deactivate online lookup, I reran the online update just now and selected NO (remove online price source permanently).  I reran the update again to make sure the offending searches were removed.  I then tried editing an investment, and the program hung right away.
  
I am surprised that "Edit Investment" goes into WebPriceQuote though.  All I wanted to do is deactivate the online lookup.

Thanks.
Comment 5 Jan 2010-05-22 22:10:20 UTC
BTW I can use Finance::Quote independently in a perl script without problems.
Comment 6 Jan 2010-05-23 05:02:21 UTC
I resolved the problem by creating a new investment.  After that I could edit both new and old investments.  Not convinced something isn't fishy.
Comment 7 Jan 2010-06-05 17:55:43 UTC
I have had this problem two or three times again since last update.  KMM hangs when editing any investment in any account, except in the account where I created a new investment last time.

It is definitely related, but not in a repeatable way, to failing price updates.  This morning, an update failed because I lost internet connection during a thunderstorm.  I am experiencing the problem again in all but one account.
Comment 8 Jan 2010-09-11 13:44:57 UTC
Yesterday I installed a new computer and reinstalled the same OS and other software as before, including KMM 1.0.4.  I moved my KMM files over, and started KMM from a shell.  My online updates no longer worked: "Failed to retrieve a quote for...".  "Online Quotes" was set to boerseonline.  I changed it to Yahoo, but that still did not work.  I edited an investment to see how online update was defined, and KMM hung.  This message appeared in the terminal window I had started it from:

Can't locate object method "new" via package "Finance::Quote" at
        /usr/share/apps/kmymoney2/misc/financequote.pl line 71 (#1)
    (F) You called a method correctly, and it correctly indicated a package
    functioning as a class, but that package doesn't define that particular
    method, nor does any of its base classes.  See perlobj.
    
Uncaught exception from user code:
        Can't locate object method "new" via package "Finance::Quote" at /usr/share/apps/kmymoney2/misc/financequote.pl line 71.
 at /usr/share/apps/kmymoney2/misc/financequote.pl line 71
Comment 9 Alvaro Soliverez 2010-09-11 14:01:58 UTC
Please update to 1.0.5, and reinstall the finance::quoute if you were using it before.
Comment 10 Jan 2010-09-11 16:49:14 UTC
I reinstalled Finance::Quote but it did not help.  Something must be wrong; if I run this small perl script to fetch a stock quote, I get

Can't locate HTML/TableExtract.pm in @INC
BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Finance/Quote/AEX.pm line 44.
Compilation failed in require at (eval 10) line 1.
BEGIN failed--compilation aborted at (eval 10) line 1.
 at Q line 3
Can't locate object method "methods" via package "Finance::Quote::AEX" at /usr/local/share/perl/5.10.1/Finance/Quote.pm line 113.
Comment 11 Jan 2010-09-11 16:58:36 UTC
Ignore the above: I found how to install it.  I'm all set.
Comment 12 Jan 2010-09-11 19:11:36 UTC
Alvaro: the problem I solved was the TableExtract issue.  The hang is still there in 1.0.5.  Please reopen the bug if possible.
Comment 13 Alvaro Soliverez 2010-09-12 01:18:51 UTC
Please send an anonymous file to verify why it's happening.

I recall having trouble editing investments in 1.x, but I haven't seen that happen in the KDE4 version.
Comment 14 Jan 2010-12-06 00:14:27 UTC
All but one investment I am trying to edit right now causes 1.0.5 to hang; it seems independent on whether the online update (Finance::Quote) works or not for the investment.  The traceback above shows that editing an investment calls Finance::Quote.  Why?  Could there be something with my Qt installation?  KPackageKit shows I'm missing some 4:4.7.0 things. I do have the 4:4.6.2 version for most.  I did upgrade Qt to no avail.
Comment 15 Jan 2012-02-05 23:48:25 UTC
Additional info:  I manually modified the kmy database of an investment that causes kmymoney to hang when editing it.  I removed the first two lines concerning on-line quote updating of the following sequence:

    <PAIR key="kmm-online-quote-system" value="Finance::Quote" />
    <PAIR key="kmm-online-source" value="france" />
    <PAIR key="kmm-security-id" value="dummy" />
   </KEYVALUEPAIRS>
  </SECURITY>

I then gzipped the file and opened it with kmymoney.  This time, I was able to edit the investment.  Finance::Quote is broken at this moment for this investment because the format of the website has changed.  The problem seems to be that editing an investment triggers a quote look-up, which does not time out.  A work-around is as follows:  Right-click the investment, select online update, let it time out, select to permanently remove online updates for this security.  From then on, editing no longer hangs.  Perhaps a fix for this bug simply consists of inerting a time-out for the online quote lookup (or skipping it altogether).
Comment 16 Cristian Oneț 2014-08-20 20:31:38 UTC
Moving this wish to kmymoney4.
Comment 17 Cristian Oneț 2014-08-22 07:04:44 UTC
TODO: check if Finance::Quote could hang indefinitely.
Comment 18 Cristian Oneț 2014-09-25 20:18:45 UTC
I checked this, even if Finance quote never returns anything it's run in a child process which is waited for 30 seconds so there is no way for the application to hang indefinitely, so I'm making a wish list item out of this.
Comment 19 Jan 2016-02-21 18:35:44 UTC
You probably overlooked something.  I waited for way more than 30 seconds.  It hangs indefinitely.  I no longer use Finance::Quote, and have not had the problem anymore.  I also switched to KMM 4.6.4.
If you are interested, I can update Finance::Quote and try again, if you intend to continue support for Finance::Quote.
Comment 20 Jack 2020-01-17 18:25:57 UTC
Can anyone confirm that this can still happen?  I have started using F::Q recenetly, and have had no hangs, but it was always likely that there was something specific in a setup or configuration to trigger it.  If nobody confirms after a while, I'll close as WORKSFORME.
Comment 21 Jack 2022-03-14 21:16:02 UTC
Any objections to closing this?
Comment 22 Jan 2022-03-17 13:55:56 UTC
(In reply to Jack from comment #21)
> Any objections to closing this?

Not me.