Bug 171665 - Amarok doesn't always exit properly; problem related to statusbar threads
Summary: Amarok doesn't always exit properly; problem related to statusbar threads
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.0-SVN
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-25 21:52 UTC by Soren Harward
Modified: 2009-12-09 11:28 UTC (History)
1 user (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 Soren Harward 2008-09-25 21:52:52 UTC
Version:           2.0-SVN (using KDE 4.1.1)
OS:                Linux
Installed from:    Gentoo Packages

I've noticed that Amarok doesn't always shutdown properly.  I tell it to quit, and it goes through most of the shutdown procedure, but hangs somewhere after the App dtor gets called.  The final couple of lines from Amarok's internal debugging are:

...
amarok: BEGIN: virtual MountPointManager::~MountPointManager()
amarok: END__: virtual MountPointManager::~MountPointManager() - Took 8e-05s
amarok: BEGIN: virtual EngineController::~EngineController()
amarok: END__: virtual EngineController::~EngineController() - Took 0.00095s
amarok: END__: virtual App::~App() - Took 0.46s

But if I use gdb to attach to the still-running process, I get this backtrace:

#0  0xffffe410 in __kernel_vsyscall ()
#1  0x450d4576 in pthread_cond_wait () from /lib/libpthread.so.0
#2  0x4f6ec30a in QWaitCondition::wait () from /usr/lib/qt4/libQtCore.so.4
#3  0x4f6eb8a7 in QThread::wait () from /usr/lib/qt4/libQtCore.so.4
#4  0x4f984cc4 in ?? () from /usr/lib/qt4/libQtNetwork.so.4
#5  0x4f7e0759 in qt_call_post_routines () from /usr/lib/qt4/libQtCore.so.4
#6  0x41a0803b in QApplication::~QApplication () from /usr/lib/qt4/libQtGui.so.4
#7  0x45be5468 in KApplication::~KApplication () from /usr/lib/libkdeui.so.5
#8  0x45be53b8 in KApplication::~KApplication () from /usr/lib/libkdeui.so.5
#9  0x45bed2c8 in KUniqueApplication::~KUniqueApplication () from /usr/lib/libkdeui.so.5
#10 0xbf8cdefc in ?? ()
#11 0xb7f08ff4 in ?? () from /usr/lib/libamaroklib.so.1
#12 0xbf8cdf0c in ?? ()
#13 0xb7e052f0 in ~App (this=0xbf8cdefc) at /home/soren/programs/src/amarok/src/App.cpp:246
#14 0x0804c00a in main (argc=1, argv=0xbf8ce3e4) at /home/soren/programs/src/amarok/src/main.cpp:127

which indicates that the program has hung because it's waiting for some thread to finish, and that the App dtor hasn't actually exited yet.

When Amarok does manage to exit cleanly, I get the following debugging output:

amarok: BEGIN: virtual MountPointManager::~MountPointManager()
amarok: END__: virtual MountPointManager::~MountPointManager() - Took 8e-05s
amarok: BEGIN: virtual EngineController::~EngineController()
amarok: END__: virtual EngineController::~EngineController() - Took 0.00095s
amarok: END__: virtual App::~App() - Took 0.46s
amarok: BEGIN: Amarok::MessageQueue::~MessageQueue()
amarok: END__: Amarok::MessageQueue::~MessageQueue() - Took 0.00026s

which suggests that the problem is somehow related to the statusbar.  I can also consistently cause an unclean exit if I close a LongMessage on the statusbar before it times out.

I'm not really sure exactly what the problem is, so hopefully someone who knows the statusbar internals better than I do can take a look at it.
Comment 1 Nikolaj Hald Nielsen 2008-10-11 16:08:03 UTC
As far as I can tell, this is fixed by commit 869846 as this is basically a complete rewrite of the statusbar stuff.