Bug 293004 - Konversation crashes on exit [@ Phonon::PulseSupport::PulseSupport]
Summary: Konversation crashes on exit [@ Phonon::PulseSupport::PulseSupport]
Status: RESOLVED FIXED
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: Pulsesupport (show other bugs)
Version: 4.6.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: 4.6.1
Assignee: Martin Sandsmark
URL:
Keywords:
: 295155 300542 306168 306956 312091 314273 317251 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-31 23:24 UTC by Danny Tamez
Modified: 2013-09-30 14:44 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (3.91 KB, text/plain)
2012-04-30 21:32 UTC, Lojjik Braughler
Details
app to reproduce bug (2.62 KB, application/x-xz)
2012-05-24 11:05 UTC, Harald Sitter
Details
New crash information added by DrKonqi (2.67 KB, text/plain)
2013-01-26 21:43 UTC, Xavier Hourcade
Details
New crash information added by DrKonqi (5.58 KB, text/plain)
2013-02-01 12:38 UTC, Kvaks
Details
New crash information added by DrKonqi (4.32 KB, text/plain)
2013-03-10 05:47 UTC, Padraic Dewey
Details
New crash information added by DrKonqi (3.88 KB, text/plain)
2013-03-11 06:48 UTC, Senan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Danny Tamez 2012-01-31 23:24:25 UTC
Application: konversation (1.4)
KDE Platform Version: 4.8.00 (4.8.0
Qt Version: 4.7.4
Operating System: Linux 3.0.0-15-generic x86_64
Distribution: Ubuntu 11.10

-- Information about the crash:
Exited konversation after using it for several hours.  Crashes every time on exit.

The crash can be reproduced every time.

-- Backtrace:
Application: Konversation (konversation), signal: Segmentation fault
[Current thread is 1 (Thread 0x7fc6abbed780 (LWP 3015))]

Thread 2 (Thread 0x7fc695b70700 (LWP 3016)):
#0  0x00007fc6a5e71773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007fc6a2250f68 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fc6a2251429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fc6a79ccf3e in QEventDispatcherGlib::processEvents (this=0x7fc6900008b0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#4  0x00007fc6a79a0cf2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fc6a79a0ef7 in QEventLoop::exec (this=0x7fc695b6fdd0, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007fc6a78b827f in QThread::exec (this=<optimized out>) at thread/qthread.cpp:498
#7  0x00007fc6a7983cbf in QInotifyFileSystemWatcherEngine::run (this=0x23c2490) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007fc6a78bad05 in QThreadPrivate::start (arg=0x23c2490) at thread/qthread_unix.cpp:331
#9  0x00007fc6a433eefc in start_thread (arg=0x7fc695b70700) at pthread_create.c:304
#10 0x00007fc6a5e7d89d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fc6abbed780 (LWP 3015)):
[KCrash Handler]
#6  0x00007fc6aa946437 in Phonon::PulseSupport::PulseSupport (this=0x3645ad0) at ../../phonon/pulsesupport.cpp:821
#7  0x00007fc6aa946850 in Phonon::PulseSupport::getInstance () at ../../phonon/pulsesupport.cpp:783
#8  0x00007fc6aa91fbe3 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x2032610, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:539
#9  0x00007fc6aa91fcc9 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x2032610, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:545
#10 0x00007fc6aa91dd33 in Phonon::AbstractAudioOutput::~AbstractAudioOutput (this=0x31e3a40, __in_chrg=<optimized out>) at ../../phonon/abstractaudiooutput.cpp:38
#11 0x00007fc6aa923adf in ~AudioOutput (this=0x31e3a40, __in_chrg=<optimized out>) at ../../phonon/audiooutput.h:50
#12 Phonon::AudioOutput::~AudioOutput (this=<optimized out>, __in_chrg=<optimized out>) at ../../phonon/audiooutput.h:50
#13 0x00007fc6a79b3d75 in QObjectPrivate::deleteChildren (this=0x21da9a0) at kernel/qobject.cpp:1955
#14 0x00007fc6a79b9349 in QObject::~QObject (this=0x31f4c10, __in_chrg=<optimized out>) at kernel/qobject.cpp:946
#15 0x000000000048069b in Konversation::Sound::~Sound() ()
#16 0x00000000004806ce in Konversation::Sound::~Sound() ()
#17 0x00007fc6a79b3d75 in QObjectPrivate::deleteChildren (this=0x202fbe0) at kernel/qobject.cpp:1955
#18 0x00007fc6a79b9349 in QObject::~QObject (this=0x7fff9ae66e30, __in_chrg=<optimized out>) at kernel/qobject.cpp:946
#19 0x00007fc6a6ae1fd7 in QApplication::~QApplication (this=0x7fff9ae66e30, __in_chrg=<optimized out>) at kernel/qapplication.cpp:1093
#20 0x000000000045a6b0 in Application::~Application() ()
#21 0x000000000047ce13 in main ()

This bug may be a duplicate of or related to bug 287880.

Possible duplicates by query: bug 288379, bug 287880, bug 272670, bug 267332.

Reported using DrKonqi
Comment 1 Eike Hein 2012-01-31 23:36:35 UTC
Reassigning to Phonon based on backtrace.
Comment 2 Myriam Schweingruber 2012-02-01 08:43:09 UTC
Wasn't this supposed to be fixed already? See also https://bugs.kde.org/show_bug.cgi?id=246448#c18
Comment 3 Colin Guthrie 2012-02-01 09:01:58 UTC
Perhaps the Phonon version is still too old? Danny, can you confirm what version of Phonon you are using?
Comment 4 Danny Tamez 2012-02-01 14:29:07 UTC
Here's the phonon info:
phonon:
  Installed: 4:4.7.0really4.5.0-3ubuntu4

Thanks!

Danny
On Wednesday, February 01, 2012 09:01:58 AM Colin Guthrie wrote:
> https://bugs.kde.org/show_bug.cgi?id=293004
> 
> 
> 
> 
> 
> --- Comment #3 from Colin Guthrie <colin mageia org>  2012-02-01 09:01:58
> --- Perhaps the Phonon version is still too old? Danny, can you confirm
> what version of Phonon you are using?
Comment 5 Colin Guthrie 2012-02-01 15:37:35 UTC
So maybe it's due to the same problem as Myriam mentioned... perhaps worth updating to Phonon 4.6?
Comment 6 Jekyll Wu 2012-03-01 17:02:12 UTC
*** Bug 295155 has been marked as a duplicate of this bug. ***
Comment 7 Lojjik Braughler 2012-04-30 21:32:26 UTC
Created attachment 70783 [details]
New crash information added by DrKonqi

konversation (1.4) on KDE Platform 4.8.2 (4.8.2) using Qt 4.8.1

Exited Konversation using left hand corner x in Unity. NOT using KDE, so that may or may not be related.

-- Backtrace (Reduced):
#6  0x00007f0a8eec1387 in Phonon::PulseSupport::PulseSupport (this=0x34106c0) at ../../phonon/pulsesupport.cpp:822
#7  0x00007f0a8eec1830 in Phonon::PulseSupport::getInstance () at ../../phonon/pulsesupport.cpp:784
#8  0x00007f0a8ee9a253 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x2fe5af0, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:543
#9  0x00007f0a8ee9a339 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x2fe5af0, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:549
#10 0x00007f0a8ee982e3 in Phonon::AbstractAudioOutput::~AbstractAudioOutput (this=0x2fc3f40, __in_chrg=<optimized out>) at ../../phonon/abstractaudiooutput.cpp:38
Comment 8 Jekyll Wu 2012-05-24 09:30:51 UTC
*** Bug 300542 has been marked as a duplicate of this bug. ***
Comment 9 Harald Sitter 2012-05-24 11:05:03 UTC
Created attachment 71341 [details]
app to reproduce bug
Comment 10 Harald Sitter 2012-05-24 11:06:55 UTC
<apachelogger> PHONON_GLOBAL_STATIC(Phonon::FactoryPrivate, globalFactory)
<apachelogger> meaning the frontends should be long gone by the time factoryprivate is destroyed
<apachelogger> hm
<apachelogger> coling: I know what causes the crash
<apachelogger> konvi's Sound object is parented by the QApp
<apachelogger> now for some reason QApp's dtor will first cleanup statics and then delete the children
<coling> Interesting.
<apachelogger> which then leads to a case where the frontend objects (children of qapp) are destroyed after the static privatefactory
<apachelogger> coling: why does shutdown not simply clean all stream caches?
<apachelogger> once the backend was destroyed the graph is defunct so that it cannot ever output anything anyway
<coling> apachelogger, it could, but it shouldn't need to. The reason to do it on AOP destruction is to save building up a massive cache for e.g. amarok or another multi-stream long running app.
<apachelogger> hm
<apachelogger> well, that reduces options of handling this quite a bit :P
<apachelogger> a) protect every usage of getInstance b) destroy (private) frontends in the privatefactory, which is save iff having qapp cleanup the factory before the frontends is indeed the only case this order can appear c) introduce a manual ref count
<apachelogger> c) would be such that every class that wants to use PA needs to increment the counter in the ctor and decrease it in the dtor, once 0 PASupport is terminated
<apachelogger> suffice to say c is the best but also most expensive approach ;)
<apachelogger> actually b might be best overall
<apachelogger> the dptr destruction is centralized in medianode
Comment 11 Jekyll Wu 2012-09-02 19:01:12 UTC
*** Bug 306168 has been marked as a duplicate of this bug. ***
Comment 12 Christoph Feck 2012-09-17 20:58:45 UTC
*** Bug 306956 has been marked as a duplicate of this bug. ***
Comment 13 Jekyll Wu 2012-12-23 02:24:08 UTC
*** Bug 312091 has been marked as a duplicate of this bug. ***
Comment 14 Xavier Hourcade 2013-01-26 00:40:09 UTC
Seem to experience this here for a week, maybe.

kernel-3.6.11-1.fc16.x86_64
kde-baseapps-4.8.5-1.fc16.x86_64
konversation-1.4-1.fc16.x86_64
phonon-4.6.0-3.fc16.x86_64

As suggested by busher, starting konversation as following prevents the crash (and, yes, sound is still working just fine).

  $ PHONON_PULSEAUDIO_DISABLE=1 konversation

Without this, here are a typical cli message, and followed with a backtrace: (not so useful, sorry, removed all debuginfos, slow link and about to migrate distro release anyway very soon).

[user@host ~]$ konversation
konversation(6797)/kio (KDirWatch) KDirWatchPrivate::removeEntry: doesn't know "/home/user/.kde/share/apps/kabc"
[user@host ~]$ Enchant dict for "en_US" 0x2335d70
(konversation:6797): GStreamer-CRITICAL **: gst_value_set_fraction: assertion `denominator != 0' failed
Trying to set an invalid MediaSource -> ignoring.
KCrash: Application 'konversation' crashing...
KCrash: Attempting to start /usr/libexec/kde4/drkonqi from kdeinit
sock_file=/home/user/.kde/socket-host/kdeinit4__0



Application: Konversation (konversation), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[KCrash Handler]
#6  0x00007faec3a44d67 in Phonon::PulseSupport::PulseSupport() () from /usr/lib64/libphonon.so.4
#7  0x00007faec3a45210 in Phonon::PulseSupport::getInstance() () from /usr/lib64/libphonon.so.4
#8  0x00007faec3a1cbf3 in ?? () from /usr/lib64/libphonon.so.4
#9  0x00007faec3a1ccd9 in ?? () from /usr/lib64/libphonon.so.4
#10 0x00007faec3a1ac83 in Phonon::AbstractAudioOutput::~AbstractAudioOutput() () from /usr/lib64/libphonon.so.4
#11 0x00007faec3a20c3f in Phonon::AudioOutput::~AudioOutput() () from /usr/lib64/libphonon.so.4
#12 0x00007faec0a5dd55 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQtCore.so.4
#13 0x00007faec0a641ac in QObject::~QObject() () from /usr/lib64/libQtCore.so.4
#14 0x000000000047b3d9 in _start ()
Comment 15 Xavier Hourcade 2013-01-26 13:56:33 UTC
... however resuming from suspend state, a dialogue did pop up, saying sound devices were detected as removed, and asking if they should be permanently deleted from configuration (while all I had done so far, before suspend, was launching Konv once as above from Konsole to verify it was no longer crashing when closing).
Comment 16 Colin Guthrie 2013-01-26 14:04:40 UTC
FWIW when you say that "sound works" when using PHONON_PULSEAUDIO_DISABLE=1, this will be effectively locked to just Konversation as it will end up hogging your sound device and not let other applications access it.

Also it will not honour any device preferences you have configured. So all in all it's just a sub-optimal hack.

I've not looked at the code for a while, but I think some recent re factoring in phonon might have made things a bit better here.
Comment 17 Xavier Hourcade 2013-01-26 14:38:38 UTC
Thanks for your comment and yes, busher had warned too this might happen indeed.

I might have to postpone my release migration a little more, so depending on bandwidth, I could provide a better trace. But would it be any useful to you if I do so ? (doubting :p)
Comment 18 Xavier Hourcade 2013-01-26 21:43:30 UTC
Created attachment 76742 [details]
New crash information added by DrKonqi

konversation (1.4) on KDE Platform 4.8.5 (4.8.5) using Qt 4.8.4

- What I was doing when the application crashed:

Nothing, just open then close the application as previously

-- Backtrace (Reduced):
#6  0x00007fa48f5f9d67 in Phonon::PulseSupport::PulseSupport (this=0x39c62d0) at /usr/src/debug/phonon-4.6.0/phonon/pulsesupport.cpp:822
#7  0x00007fa48f5fa210 in Phonon::PulseSupport::getInstance () at /usr/src/debug/phonon-4.6.0/phonon/pulsesupport.cpp:784
#8  0x00007fa48f5d1bf3 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x34e26e0, __in_chrg=<optimized out>) at /usr/src/debug/phonon-4.6.0/phonon/audiooutput.cpp:543
#9  0x00007fa48f5d1cd9 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x34e26e0, __in_chrg=<optimized out>) at /usr/src/debug/phonon-4.6.0/phonon/audiooutput.cpp:549
#10 0x00007fa48f5cfc83 in Phonon::AbstractAudioOutput::~AbstractAudioOutput (this=0x3588670, __in_chrg=<optimized out>) at /usr/src/debug/phonon-4.6.0/phonon/abstractaudiooutput.cpp:38
Comment 19 Harald Sitter 2013-01-27 13:47:37 UTC
Git commit 8ededd84420b397325f7255120d1d97039bc3b8f by Harald Sitter.
Committed on 27/01/2013 at 14:47.
Pushed by sitter into branch 'master'.

manually manage Konversation::Sound (Phonon::AudioOutput)

when parenting a phonon audiooutput to a qapplication an access to
pulseaudio happens after it was destructed already.
qapplication's ctor first destructs q_global_statics and after that
deletes children. however in the phonon's factory global static all
backend objects (including the root object) are deleted which in turn
will shut down the pulseaudio support. at that point from a phonon
perspective everything is shut down, except qapplication then goes on to
delete its children which then causes headaches.

generally speaking this is a problem all phonon frontend objects have,
except only the audiooutput does things that will trigger a sigsev.
so inside phonon a different workaround needs to be made for some future
release.

the fact that global statics are deleted before children seems wrong
though and perhaps needs addressing within qt.

M  +2    -1    src/application.cpp

http://commits.kde.org/konversation/8ededd84420b397325f7255120d1d97039bc3b8f
Comment 20 Kvaks 2013-02-01 12:38:50 UTC
Created attachment 76861 [details]
New crash information added by DrKonqi

konversation (1.4) on KDE Platform 4.9.4 using Qt 4.8.3

- What I was doing when the application crashed:

Chosing quit from file menu, confirming, then receiving crash notification.

-- Backtrace (Reduced):
#6  0x00007f9a62480942 in Phonon::PulseSupport::PulseSupport (this=0x2239150) at ../../phonon/pulsesupport.cpp:822
#7  0x00007f9a62480d61 in Phonon::PulseSupport::getInstance () at ../../phonon/pulsesupport.cpp:784
#8  0x00007f9a6245bdb3 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x519a5b0, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:543
#9  0x00007f9a6245be99 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x519a5b0, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:549
#10 0x00007f9a6245a2b3 in Phonon::AbstractAudioOutput::~AbstractAudioOutput (this=0x392b440, __in_chrg=<optimized out>) at ../../phonon/abstractaudiooutput.cpp:38
Comment 21 Bernd Buschinski 2013-02-01 23:38:29 UTC
*** Bug 314273 has been marked as a duplicate of this bug. ***
Comment 22 Padraic Dewey 2013-03-10 05:47:45 UTC
Created attachment 77905 [details]
New crash information added by DrKonqi

konversation (1.4) on KDE Platform 4.8.5 (4.8.5) using Qt 4.8.1

- What I was doing when the application crashed:

Closed last window of Konversation after /quit to leave IRC server.

Note this only started happening to me in the last few days.

-- Backtrace (Reduced):
#7  0xb72eb0c0 in Phonon::PulseSupport::PulseSupport (this=0x90af458) at ../../phonon/pulsesupport.cpp:822
#8  0xb72eb5d4 in Phonon::PulseSupport::getInstance () at ../../phonon/pulsesupport.cpp:784
#9  0xb72bf78e in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x8d8f968, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:543
#10 0xb72bf892 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x8d8f968, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:549
#11 0xb72deeed in Phonon::MediaNode::~MediaNode (this=0x895a3f8, __in_chrg=<optimized out>) at ../../phonon/medianode.cpp:57
Comment 23 Senan 2013-03-11 06:48:10 UTC
Created attachment 77936 [details]
New crash information added by DrKonqi

konversation (1.4) on KDE Platform 4.8.5 (4.8.5) using Qt 4.8.1

- What I was doing when the application crashed:

Closed Konversation via top left X button.

-- Backtrace (Reduced):
#6  0x00007fe2b49b7387 in Phonon::PulseSupport::PulseSupport (this=0x2140a60) at ../../phonon/pulsesupport.cpp:822
#7  0x00007fe2b49b7830 in Phonon::PulseSupport::getInstance () at ../../phonon/pulsesupport.cpp:784
#8  0x00007fe2b4990253 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x1dc2a50, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:543
#9  0x00007fe2b4990339 in Phonon::AudioOutputPrivate::~AudioOutputPrivate (this=0x1dc2a50, __in_chrg=<optimized out>) at ../../phonon/audiooutput.cpp:549
#10 0x00007fe2b498e2e3 in Phonon::AbstractAudioOutput::~AbstractAudioOutput (this=0xf8f7e0, __in_chrg=<optimized out>) at ../../phonon/abstractaudiooutput.cpp:38
Comment 24 Myriam Schweingruber 2013-04-13 06:15:27 UTC
*** Bug 317251 has been marked as a duplicate of this bug. ***
Comment 25 Harald Sitter 2013-09-30 14:44:09 UTC
Git commit dd16b3b22b8b9ed3e9d409a072d3240a9787d99a by Harald Sitter.
Committed on 30/09/2013 at 14:43.
Pushed by sitter into branch 'master'.

Don't crash when trying to create the singleton out of a qapp parented AO

rationale: qapp kills q_global_statics (such as our backing object manager
thing) BEFORE its own children, when the children then get destructed
everything explodes because it tries to create a PASupport which tries
to mindlessly access an eventloop that is no longer present and everything
explodereds and there be brains and blood all over the place

M  +6    -0    phonon/pulsesupport.cpp

http://commits.kde.org/phonon/dd16b3b22b8b9ed3e9d409a072d3240a9787d99a