Bug 209975

Summary: KMix crashes on startup [assert, libasound, Mixer_ALSA::prepareUpdateFromHW, Mixer_Backend::readSetFromHW]
Product: [Applications] kmix Reporter: Konstantinos Athanasakos <k.athanasakos>
Component: generalAssignee: Christian Esken <esken>
Status: RESOLVED FIXED    
Severity: crash CC: 126512, aiacovitti, alex.merry, andresbajotierra, asmpub, bairjj, bgpiraja, cfeck, chrismaple, dr.j1234, edmondo, emacalexsen, enochnotsocool, epervieror, erik.casadei, erik.martin-dorel, fbouchet, fmaufroy2, gheesh, giggi1999, giuseppe.laurenza, gp, guido-kdebugs, gwart49, j.nespolo, jancocek, javierleventan, jcca, josueandres.fcb, judith.fursdon, kde.org, kde, kelytharun, konchud, kursat.ufuk, mail, martin.sandsmark, mt.michael88, pablo.cardozo, pabloypunto, pedersen.magnus, plopamihai, pronboogaloo, realasking, saxum87, sebastian.frohn, shhabas, shubhadeepc, silvan.calarco, simon, simont, spam, stalker, standogan, stephan.menzel, taxido_16, thomas.richard, tjm1983, tommaso.gi, upscope, vamp898, vatbier, vortexius, wodencafe, xdan779
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: crash report on arch linux
New crash information added by DrKonqi
New crash information added by DrKonqi
crash report, once @ each kde startup
New crash information added by DrKonqi
ALSA Polling crash fix: backport to KDE4.7
KMix crash version 4.7.3
KMix crash version 4.7.4
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi

Description Konstantinos Athanasakos 2009-10-09 12:34:11 UTC
Application that crashed: kmix
Version of the application: 3.5
KDE Version: 4.3.2 (KDE 4.3.2)
Qt Version: 4.5.2
Operating System: Linux 2.6.28-15-generic i686
Distribution: Ubuntu 9.04

 -- Backtrace:
Application: KMix (kdeinit4), signal: Aborted
[KCrash Handler]
#6  0xb80cf430 in __kernel_vsyscall ()
#7  0xb67006d0 in raise () from /lib/tls/i686/cmov/libc.so.6
#8  0xb6702098 in abort () from /lib/tls/i686/cmov/libc.so.6
#9  0xb66f95ce in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#10 0xb3b72131 in snd_hctl_handle_events () from /usr/lib/libasound.so.2
#11 0xb3b7dfa1 in snd_mixer_handle_events () from /usr/lib/libasound.so.2
#12 0xb3d06e45 in Mixer_ALSA::prepareUpdateFromHW (this=0x92b97b8) at /build/buildd/kdemultimedia-4.3.2/kmix/mixer_alsa9.cpp:570
#13 0xb3d11b8f in Mixer_Backend::readSetFromHW (this=0x92b97b8) at /build/buildd/kdemultimedia-4.3.2/kmix/mixer_backend.cpp:100
#14 0xb3d10fad in Mixer_Backend::qt_metacall (this=0x92b97b8, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfbec1ac) at /build/buildd/kdemultimedia-4.3.2/obj-i486-linux-gnu/kmix/mixer_backend.moc:71
#15 0xb7fd81b8 in QMetaObject::activate (sender=0x92d9668, from_signal_index=4, to_signal_index=4, argv=0xbfbec1ac) at kernel/qobject.cpp:3113
#16 0xb7fd8e42 in QMetaObject::activate (sender=0x92d9668, m=0xb80b58b0, local_signal_index=0, argv=0xbfbec1ac) at kernel/qobject.cpp:3187
#17 0xb8014513 in QSocketNotifier::activated (this=0x92d9668, _t1=10) at .moc/release-shared/moc_qsocketnotifier.cpp:83
#18 0xb7fdd877 in QSocketNotifier::event (this=0x92d9668, e=0xbfbec560) at kernel/qsocketnotifier.cpp:316
#19 0xb6a7ed3c in QApplicationPrivate::notify_helper (this=0x91d6330, receiver=0x92d9668, e=0xbfbec560) at kernel/qapplication.cpp:4056
#20 0xb6a8703e in QApplication::notify (this=0x91d5e10, receiver=0x92d9668, e=0xbfbec560) at kernel/qapplication.cpp:3603
#21 0xb758f49d in KApplication::notify (this=0x91d5e10, receiver=0x92d9668, event=0xbfbec560) at /build/buildd/kde4libs-4.3.2/kdeui/kernel/kapplication.cpp:302
#22 0xb7fc2bcb in QCoreApplication::notifyInternal (this=0x91d5e10, receiver=0x92d9668, event=0xbfbec560) at kernel/qcoreapplication.cpp:610
#23 0xb7fee58a in socketNotifierSourceDispatch (source=0x91d8e38) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:213
#24 0xb6631b88 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#25 0xb66350eb in ?? () from /usr/lib/libglib-2.0.so.0
#26 0xb6635268 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#27 0xb7fee2f8 in QEventDispatcherGlib::processEvents (this=0x9159d40, flags={i = -1078016328}) at kernel/qeventdispatcher_glib.cpp:327
#28 0xb6b20a75 in QGuiEventDispatcherGlib::processEvents (this=0x9159d40, flags={i = -1078016280}) at kernel/qguieventdispatcher_glib.cpp:202
#29 0xb7fc11fa in QEventLoop::processEvents (this=0xbfbec760, flags={i = -1078016216}) at kernel/qeventloop.cpp:149
#30 0xb7fc1642 in QEventLoop::exec (this=0xbfbec760, flags={i = -1078016152}) at kernel/qeventloop.cpp:201
#31 0xb7fc3ae9 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#32 0xb6a7ebb7 in QApplication::exec () at kernel/qapplication.cpp:3525
#33 0xb3cefe7b in kdemain (argc=1, argv=0x91bcf80) at /build/buildd/kdemultimedia-4.3.2/kmix/main.cpp:71
#34 0x0804e27d in launch (argc=1, _name=0x9179544 "/usr/bin/kmix", args=0x9179552 "", cwd=0x0, envc=0, envs=0x9179556 "", reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x805136d "0")
    at /build/buildd/kde4libs-4.3.2/kinit/kinit.cpp:677
#35 0x0804ea5d in handle_launcher_request (sock=7, who=<value optimized out>) at /build/buildd/kde4libs-4.3.2/kinit/kinit.cpp:1169
#36 0x0804efe5 in handle_requests (waitForPid=0) at /build/buildd/kde4libs-4.3.2/kinit/kinit.cpp:1362
#37 0x0804fbca in main (argc=2, argv=0xbfbecff4, envp=0xbfbed000) at /build/buildd/kde4libs-4.3.2/kinit/kinit.cpp:1793

This bug may be a duplicate of or related to bug 204474

Reported using DrKonqi
Comment 1 Dario Andres 2009-10-09 14:03:06 UTC
This looks related to bug 159645 / bug 156505
- Does KMix always crash at startup ?
- Do you have volume restoration enabled ?
Thanks
Comment 2 Konstantinos Athanasakos 2009-10-09 14:17:25 UTC
It always crashes at startup in both cases (volume restoration enabled/disabled)
Comment 3 Dario Andres 2009-11-10 02:30:37 UTC
Bug 212892 contains more information.
Comment 4 Dario Andres 2009-11-10 02:31:56 UTC
*** Bug 212892 has been marked as a duplicate of this bug. ***
Comment 5 Dario Andres 2009-11-10 02:31:58 UTC
*** Bug 213862 has been marked as a duplicate of this bug. ***
Comment 6 Dario Andres 2009-11-12 13:35:02 UTC
*** Bug 214218 has been marked as a duplicate of this bug. ***
Comment 7 Dario Andres 2009-11-16 22:34:02 UTC
*** Bug 214884 has been marked as a duplicate of this bug. ***
Comment 8 Dario Andres 2009-11-21 22:03:08 UTC
*** Bug 215581 has been marked as a duplicate of this bug. ***
Comment 9 Dario Andres 2009-11-27 19:59:14 UTC
*** Bug 216416 has been marked as a duplicate of this bug. ***
Comment 10 Dario Andres 2009-12-31 14:29:11 UTC
*** Bug 220805 has been marked as a duplicate of this bug. ***
Comment 11 Dario Andres 2010-01-26 12:55:42 UTC
From bug 224148:
-- Other details that might be useful :
Sometimes there are two Kmix icones in the part of the taskbar where it normaly
appears.
After having installed Madriva on the computer, no sound can be heard.
I have to change settings in Pulseaudio volume controler to hear other noise
than the system bell (musique for example).
My two audio devices are :
- R700 Audio Device [Radeon HD 4000 Series]
- 82801JI (ICH10 Family) HD Audio Controller
Comment 12 Dario Andres 2010-01-26 12:55:45 UTC
*** Bug 224148 has been marked as a duplicate of this bug. ***
Comment 13 Dario Andres 2010-02-25 13:04:40 UTC
*** Bug 228432 has been marked as a duplicate of this bug. ***
Comment 14 Christian Esken 2010-03-05 23:16:21 UTC
As far as I see the crash is in the marked line:


            if (revents & POLLIN) {
                //kDebug(67100) << "Mixer_ALSA::prepareUpdate() 7\n";
                snd_mixer_handle_events(_handle);         // <<<<<<<<<<<<
                updated = true;
            }

Brainstorming: Is there a race condition with _handle (opening and using/polling, or some strange behiviour when the soundcard driver has just been loaded).
Comment 15 Christian Esken 2010-03-05 23:20:29 UTC
Is anybody able to see the assertion?

It could for example be found in ~/.xsession-errors or a console or xconsole.
Comment 16 PC LX 2010-03-06 12:06:45 UTC
I don't remember seeing any assertion or messages related to kmix crash, but kmix has not crashed for me in a while, so I'm not absolutely certain. If kmix crashes on me again I will check for messages and add a comment to this bug report.
Comment 17 Dario Andres 2010-04-11 15:37:29 UTC
*** Bug 234049 has been marked as a duplicate of this bug. ***
Comment 18 François Rey 2010-08-16 10:44:54 UTC
I'm also experiencing this bug. I just upgraded to kde 4.5 and so far it happened each time I booted. With 4.4 it was intermittent.
I'm on Arch Linux 64 bits, using kdemod.
Comment 19 François Rey 2010-08-16 17:28:53 UTC
Created attachment 50616 [details]
crash report on arch linux
Comment 20 François Rey 2010-08-16 17:35:47 UTC
in ~/.xsession-errors I can read:
kdeinit4: hcontrol.c:764: snd_hctl_handle_event: Assertion `elem' failed.
Comment 21 François Rey 2010-08-17 11:24:45 UTC
Actually I resolved this issue by starting kde without a .kde4 directory and manually move some of my old settings to the new dir. I did not move any settings from kmix.
Comment 22 Nicolas L. 2010-08-19 02:54:57 UTC
*** Bug 243683 has been marked as a duplicate of this bug. ***
Comment 23 Nicolas L. 2010-08-19 02:55:03 UTC
*** Bug 248261 has been marked as a duplicate of this bug. ***
Comment 24 François Rey 2010-08-19 10:34:21 UTC
Oops, I just had a kmix crash on startup, so refreshing my .kde4 directory does not really fix this issue for me, as I said in comment  #20.
The same message appear in ~/.xsession-errors:
kdeinit4: hcontrol.c:764: snd_hctl_handle_event: Assertion `elem' failed.

Here's the crash report:
Application: kmix (3.7)
KDE Platform Version: 4.5.00 (KDE 4.5.0)
Qt Version: 4.6.3
Operating System: Linux 2.6.35-ARCH x86_64

-- Backtrace:
Application: KMix (kdeinit4), signal: Aborted
[KCrash Handler]
#6  0x00007f517a380565 in raise () from /lib/libc.so.6
#7  0x00007f517a3819e6 in abort () from /lib/libc.so.6
#8  0x00007f517a379145 in __assert_fail () from /lib/libc.so.6
#9  0x00007f516e80267b in snd_hctl_handle_events () from /usr/lib/libasound.so.2
#10 0x00007f516e80c649 in snd_mixer_handle_events () from /usr/lib/libasound.so.2
#11 0x00007f516eae4ee9 in ?? () from /usr/lib/libkdeinit4_kmix.so
#12 0x00007f516eaeeb37 in ?? () from /usr/lib/libkdeinit4_kmix.so
#13 0x00007f516eaeea9d in ?? () from /usr/lib/libkdeinit4_kmix.so
#14 0x00007f517b9b0def in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#15 0x00007f517b9f6a9e in QSocketNotifier::activated(int) () from /usr/lib/libQtCore.so.4
#16 0x00007f517b9b59cb in QSocketNotifier::event(QEvent*) () from /usr/lib/libQtCore.so.4
#17 0x00007f517ab72ae4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#18 0x00007f517ab76bca in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#19 0x00007f517c6de476 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#20 0x00007f517b99cd8c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#21 0x00007f517b9c5289 in ?? () from /usr/lib/libQtCore.so.4
#22 0x00007f5177711b33 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#23 0x00007f5177712310 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#24 0x00007f51777125ad in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#25 0x00007f517b9c587f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#26 0x00007f517ac1260e in ?? () from /usr/lib/libQtGui.so.4
#27 0x00007f517b99c172 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#28 0x00007f517b99c3ac in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#29 0x00007f517b9a07bb in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#30 0x00007f516ead24aa in kdemain () from /usr/lib/libkdeinit4_kmix.so
#31 0x00000000004070b3 in _start ()
Comment 25 Christian Esken 2010-08-21 00:33:01 UTC
In the bug report we see that the following line in the stacktrace:
kdemultimedia-4.3.2/kmix/mixer_alsa9.cpp:570

This is:

568 	 if (revents & POLLIN) {
569 	//kDebug(67100) << "Mixer_ALSA::prepareUpdate() 7\n";
570 	snd_mixer_handle_events(_handle);           // <<<<<<<<<<<<<<<<<<<
571 	updated = true;
572 	} 

So the issue is in an ALSA call. The comment #20 shows "snd_hctl_handle_event: Assertion `elem' failed." In my opinion ALSA should not throw an assertion. If KMix would be doing anything wrong [1], it should return with an error code. I think this should better be reported to the ALSA developers.

[1] At the moment I don't think KMix does anything wrong, as snd_mixer_handle_events() is not taking an elem as argument, but a handle.
Comment 26 Dario Andres 2010-11-15 15:43:59 UTC
Bug 255450 contains a full backtrace including ALSA symbols:
(it looks a bit different and the assert may not be the same, but it could still be related):

[KCrash Handler]
#5  0x00000030562329a5 in raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#6  0x0000003056234185 in abort () at abort.c:92
#7  0x000000305622b935 in __assert_fail (assertion=0x3066aafedb "dir != 0",
file=<value optimized out>, line=366, function=<value optimized out>) at
assert.c:81
#8  0x0000003066a3bd1f in snd_hctl_elem_add (hctl=0x1fc1d50) at hcontrol.c:366
#9  snd_hctl_handle_event (hctl=0x1fc1d50) at hcontrol.c:757
#10 snd_hctl_handle_events (hctl=0x1fc1d50) at hcontrol.c:793
#11 0x0000003066a45789 in snd_mixer_handle_events (mixer=0x1dce050) at
mixer.c:847
#12 0x00007f67491e3e2c in Mixer_ALSA::prepareUpdateFromHW (this=0x203c420) at
/usr/src/debug/kdemultimedia-4.4.5/kmix/mixer_alsa9.cpp:570
#13 0x00007f67491f5eb7 in Mixer_Backend::readSetFromHW (this=0x203c420) at
/usr/src/debug/kdemultimedia-4.4.5/kmix/mixer_backend.cpp:103
Comment 27 Dario Andres 2010-11-15 15:44:21 UTC
*** Bug 256961 has been marked as a duplicate of this bug. ***
Comment 28 Dario Andres 2010-11-15 15:48:58 UTC
[Bug triager comment]
Bug 242678 seems to have the same backtrace but under a different condition:
KMix crashes on Skype startup/sound.
Comment 29 Dario Andres 2010-12-26 03:06:27 UTC
*** Bug 261261 has been marked as a duplicate of this bug. ***
Comment 30 Dario Andres 2010-12-26 14:56:33 UTC
*** Bug 261270 has been marked as a duplicate of this bug. ***
Comment 31 Christoph Feck 2011-02-02 22:44:25 UTC
*** Bug 265212 has been marked as a duplicate of this bug. ***
Comment 32 Gary Wilson 2011-02-26 01:05:11 UTC
Created attachment 57533 [details]
New crash information added by DrKonqi

kmix (3.7) on KDE Platform 4.5.5 (KDE 4.5.5) using Qt 4.7.1

- What I was doing when the application crashed: KMIX is constantly crashing as KDE is opening. However, the sound system still functions and KDE allows me to reinitiate KMIX. Sometimes KMIX will crash again while using VLC, but then I have to reboot and go through the primary crash and reinitiation process. I really do not know why!

-- Backtrace (Reduced):
#10 0x009ffc08 in __assert_fail (assertion=0x7ac08d7 "elem", file=0x7abe3dd "hcontrol.c", line=764, function=0x7abe7bc "snd_hctl_handle_event") at assert.c:81
#11 0x07a33e3b in snd_hctl_handle_event (hctl=0x84e8658) at hcontrol.c:764
#12 snd_hctl_handle_events (hctl=0x84e8658) at hcontrol.c:793
#13 0x07a413e1 in snd_mixer_handle_events (mixer=0x84e8378) at mixer.c:847
#14 0x0659325f in Mixer_ALSA::prepareUpdateFromHW (this=0x84e09c0) at /usr/src/debug/kdemultimedia-4.5.5/kmix/mixer_alsa9.cpp:571
Comment 33 Christoph Feck 2011-04-12 00:02:31 UTC
Created attachment 58812 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.6.41 (4.7 >= 20110106) using Qt 4.7.4

- What I was doing when the application crashed:

After a fresh start of KDE, I started a kdegames game. The intro sound of that game needed about 1-2 seconds until it was audible. In the meantime, I got this crash. Running today's trunk.

-- Backtrace (Reduced):
#10 0xb5cba144 in __assert_fail (assertion=0xaf9f7957 "elem", file=0xaf9f545d "hcontrol.c", line=764, function=0xaf9f583c "snd_hctl_handle_event") at assert.c:81
#11 0xaf974b01 in snd_hctl_handle_events () from /usr/lib/libasound.so.2
#12 0xaf981f71 in snd_mixer_handle_events () from /usr/lib/libasound.so.2
#13 0xafa57103 in Mixer_ALSA::prepareUpdateFromHW (this=0x82cca50) at /local/svn/kde/trunk/KDE/kdemultimedia/kmix/backends/mixer_alsa9.cpp:571
#14 0xafa6c6c9 in Mixer_Backend::readSetFromHW (this=0x82cca50) at /local/svn/kde/trunk/KDE/kdemultimedia/kmix/backends/mixer_backend.cpp:103
Comment 34 t68b 2011-04-23 19:16:33 UTC
Created attachment 59251 [details]
crash report, once @ each kde startup

i get this crash once, and only once, @ each kde (4.6.2) startup, on multiple machines,

...
#10 0x00007f2c4e2aca19 in snd_mixer_handle_events () from /usr/lib64/libasound.so.2
#11 0x00007f2c4e553f39 in Mixer_ALSA::prepareUpdateFromHW (this=0x9069b0) at /usr/src/debug/kdemultimedia-4.6.2/kmix/backends/mixer_alsa9.cpp:571
#12 0x00007f2c4e56b297 in Mixer_Backend::readSetFromHW (this=0x9069b0) at /usr/src/debug/kdemultimedia-4.6.2/kmix/backends/mixer_backend.cpp:103
#13 0x00007f2c4e56b1fd in Mixer_Backend::qt_metacall (this=0x9069b0, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fff2fa50b50) at /usr/src/debug/kdemultimedia-4.6.2/build/kmix/mixer_backend.moc:82
#14 0x00007f2c70308a5f in QMetaObject::activate (sender=0x93f1f0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff2fa50b50) at kernel/qobject.cpp:3278
...
Comment 35 t68b 2011-05-11 21:02:26 UTC
given the age, # of reports, and # of marked duplicates, @ this bug, can the STATUS at least be changed from UNCOFIRMED: "... This bug has recently been added to the database. Nobody has validated that this bug is true. ..."
Comment 36 Christoph Feck 2011-05-11 21:16:17 UTC
DCh, it still could not be confirmed if the bug is in KMix or in ALSA. If you can confirm either, please add a comment how you did.
Comment 37 Pino Toscano 2011-05-20 12:43:07 UTC
*** Bug 273702 has been marked as a duplicate of this bug. ***
Comment 38 Christoph Feck 2011-07-19 00:24:49 UTC
*** Bug 277947 has been marked as a duplicate of this bug. ***
Comment 39 Christoph Feck 2011-07-19 00:25:29 UTC
*** Bug 271439 has been marked as a duplicate of this bug. ***
Comment 40 Christoph Feck 2011-08-01 21:53:42 UTC
*** Bug 279065 has been marked as a duplicate of this bug. ***
Comment 41 Christoph Feck 2011-08-04 23:35:38 UTC
*** Bug 255450 has been marked as a duplicate of this bug. ***
Comment 42 Daniel Duncan 2011-08-07 00:40:15 UTC
Created attachment 62624 [details]
New crash information added by DrKonqi

kmix (3.9-alpha) on KDE Platform 4.7.00 (4.7.0) using Qt 4.7.3

- What I was doing when the application crashed: On login I am greeted with a crash dialog for Kmix, this just started with 4.7.0 and happens on the 1st login after booting up everytime, did not seem to be an issue with the 1st RC.  When I select restart application, Kmix comes up without issue.  It does not crash again after logging out and in as the same user or a differant user, only after I initialy boot up the computer. I am using G-Streamer as a backend for phonon. Hopefully the provided backtrace can add something useful.

-- Backtrace (Reduced):
#9  0x00007f997a3a152b in snd_hctl_handle_events () from /usr/lib64/libasound.so.2
#10 0x00007f997a3ac2c9 in snd_mixer_handle_events () from /usr/lib64/libasound.so.2
#11 0x00007f997a6a5879 in Mixer_ALSA::prepareUpdateFromHW() () from /usr/lib64/libkdeinit4_kmix.so
#12 0x00007f997a6b0897 in Mixer_Backend::readSetFromHW() () from /usr/lib64/libkdeinit4_kmix.so
#13 0x00007f997a6b07fd in Mixer_Backend::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkdeinit4_kmix.so
Comment 43 Alex Merry 2011-08-09 08:50:59 UTC
I get this crash every time I log in, but in KMix's KDED module.



Application: KDE Dæmon (kdeinit4), signal: Aborted
[Current thread is 1 (Thread 0x7f558c21f760 (LWP 1047))]

Thread 2 (Thread 0x7f5573174700 (LWP 1114)):
#0  0x00007f5588e10b83 in poll () from /lib/libc.so.6
#1  0x00007f55856dd7d4 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007f55856ddd09 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f558aac08de in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f558aa94db2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f558aa94fb7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f558a9ac69f in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f558aa77d8f in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f558a9af0f5 in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007f558a725d60 in start_thread () from /lib/libpthread.so.0
#10 0x00007f5588e18e2d in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f558c21f760 (LWP 1047)):
[KCrash Handler]
#6  0x00007f5588d79795 in raise () from /lib/libc.so.6
#7  0x00007f5588d7ac0b in abort () from /lib/libc.so.6
#8  0x00007f5588d7253e in ?? () from /lib/libc.so.6
#9  0x00007f5588d725e2 in __assert_fail () from /lib/libc.so.6
#10 0x00007f5570d68afb in snd_hctl_handle_events () from /usr/lib/libasound.so.2
#11 0x00007f5570d73899 in snd_mixer_handle_events () from /usr/lib/libasound.so.2
#12 0x00007f557103594c in Mixer_ALSA::prepareUpdateFromHW (this=0xb704b0) at /home/kde-devel/src/kdemultimedia/kmix/backends/mixer_alsa9.cpp:573
#13 0x00007f5571051080 in Mixer_Backend::readSetFromHW (this=0xb704b0) at /home/kde-devel/src/kdemultimedia/kmix/backends/mixer_backend.cpp:103
#14 0x00007f55710516b6 in Mixer_Backend::qt_metacall (this=0xb704b0, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x7fffd39cc710) at /home/kde-devel/build/kdemultimedia/kmix/mixer_backend.moc:82
#15 0x00007f558aaa87fa in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#16 0x00007f558aaf1dde in QSocketNotifier::activated(int) () from /usr/lib/libQtCore.so.4
#17 0x00007f558aab04ab in QSocketNotifier::event(QEvent*) () from /usr/lib/libQtCore.so.4
#18 0x00007f5589c56174 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#19 0x00007f5589c5afe1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#20 0x00007f558bb598ff in KApplication::notify (this=0x7fffd39ccef0, receiver=0xc2bda0, event=0x7fffd39ccc30) at /home/kde-devel/src/kdelibs/kdeui/kernel/kapplication.cpp:311
#21 0x00007f558aa95bbc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#22 0x00007f558aabff57 in ?? () from /usr/lib/libQtCore.so.4
#23 0x00007f55856dd29d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#24 0x00007f55856dda78 in ?? () from /usr/lib/libglib-2.0.so.0
#25 0x00007f55856ddd09 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#26 0x00007f558aac0876 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#27 0x00007f5589cf91be in ?? () from /usr/lib/libQtGui.so.4
#28 0x00007f558aa94db2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#29 0x00007f558aa94fb7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#30 0x00007f558aa991ab in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#31 0x00007f557a3b1755 in kdemain (argc=1, argv=0x91e510) at /home/kde-devel/src/kdelibs/kded/kded.cpp:924
#32 0x00000000004072e8 in launch (argc=1, _name=0x40de7e "kded4", args=0x0, cwd=0x0, envc=0, envs=0x0, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x40d73f "0") at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:734
#33 0x000000000040a4c4 in main (argc=4, argv=0x7fffd39cd7d8, envp=0x7fffd39cd800) at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:1849
Comment 44 Christian Esken 2011-08-22 19:42:23 UTC
Alex Merry, on which KDE version does this crash occur on?
Comment 45 Christian Esken 2011-08-22 20:49:03 UTC
Just for the records, this bug report (#209975) has an assertion failure directly below snd_hctl_handle_events() while in #255450 the assertion failure is 2 stack levels lower.

#255450 has an excellent stack trace, even with line numbers on ALSA. I checked back the the ALSA sources, and it really looks like an ALSA bug
Comment 46 Christian Esken 2011-08-22 20:52:38 UTC
I checked the alsamixer source code, and found a very interesting code snippet. it looks like the number of polling descriptors can vary over time. I'll try to follow that, and have patched KMix to simulate alsamixer behaviour. The code in alsamixer is strange, though: I only update its polling file descriptors if the number of descriptors change. This looks incomplete, but I will just do the same.
Comment 47 Christian Esken 2011-08-22 20:58:06 UTC
SVN commit 1248938 by esken:

CCBUGS: 209975
refresh polling FD's if number of polling descriptors change (adapting alsamixer behaviour here).

 M  +2 -2      mixer_alsa.h  
 M  +26 -20    mixer_alsa9.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1248938
Comment 48 Alex Merry 2011-08-22 22:31:03 UTC
That just makes _everything_ kmix-related crash.  At login, kmix crashed twice, kded once and kmixctrl once.

Application: KMix (kdeinit4), signal: Aborted
[Current thread is 1 (Thread 0x7ff815ee8760 (LWP 1715))]

Thread 3 (Thread 0x7ff7fe9f1700 (LWP 1774)):
#0  0x00007ff8143f3cbe in pthread_mutex_lock () from /lib/libpthread.so.0
#1  0x00007ff80f3a78b4 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007ff80f3a7d09 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007ff81478c8de in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007ff814760db2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007ff814760fb7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007ff81467869f in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007ff814743d8f in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007ff81467b0f5 in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007ff8143f1d60 in start_thread () from /lib/libpthread.so.0
#10 0x00007ff812ae425d in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7ff7f47f0700 (LWP 1786)):
#0  0x00007ff81478cd67 in ?? () from /usr/lib/libQtCore.so.4
#1  0x00007ff80f3a6f24 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#2  0x00007ff80f3a77f2 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007ff80f3a7d09 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#4  0x00007ff81478c8de in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007ff814760db2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007ff814760fb7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#7  0x00007ff81467869f in QThread::exec() () from /usr/lib/libQtCore.so.4
#8  0x00007ff814743d8f in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007ff81467b0f5 in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007ff8143f1d60 in start_thread () from /lib/libpthread.so.0
#11 0x00007ff812ae425d in clone () from /lib/libc.so.6
#12 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ff815ee8760 (LWP 1715)):
[KCrash Handler]
#6  0x00007ff812a45725 in raise () from /lib/libc.so.6
#7  0x00007ff812a46b9b in abort () from /lib/libc.so.6
#8  0x00007ff814671a2f in qt_message_output(QtMsgType, char const*) () from /usr/lib/libQtCore.so.4
#9  0x00007ff814671baf in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007ff814671d54 in qFatal(char const*, ...) () from /usr/lib/libQtCore.so.4
#11 0x00007ff803e46aad in QList<QSocketNotifier*>::operator[] (this=0x1963d48, i=0) at /usr/include/QtCore/qlist.h:464
#12 0x00007ff803e38590 in Mixer_ALSA::setupAlsaPolling (this=0x1963cb0) at /home/kde-devel/src/kdemultimedia/kmix/backends/mixer_alsa9.cpp:367
#13 0x00007ff803e378d5 in Mixer_ALSA::open (this=0x1963cb0) at /home/kde-devel/src/kdemultimedia/kmix/backends/mixer_alsa9.cpp:253
#14 0x00007ff803e51de3 in Mixer_Backend::openIfValid (this=0x1963cb0) at /home/kde-devel/src/kdemultimedia/kmix/backends/mixer_backend.cpp:50
#15 0x00007ff803e44486 in Mixer::openIfValid (this=0x18fdfe0) at /home/kde-devel/src/kdemultimedia/kmix/core/mixer.cpp:190
#16 0x00007ff803e332c1 in MixerToolBox::possiblyAddMixer (this=0x1907a80, mixer=0x18fdfe0) at /home/kde-devel/src/kdemultimedia/kmix/core/mixertoolbox.cpp:243
#17 0x00007ff803e32ce1 in MixerToolBox::initMixerInternal (this=0x1907a80, multiDriverMode=false, backendList=..., ref_hwInfoString=...) at /home/kde-devel/src/kdemultimedia/kmix/core/mixertoolbox.cpp:147
#18 0x00007ff803e32946 in MixerToolBox::initMixer (this=0x1907a80, multiDriverMode=false, backendList=..., ref_hwInfoString=...) at /home/kde-devel/src/kdemultimedia/kmix/core/mixertoolbox.cpp:78
#19 0x00007ff803e034e6 in KMixWindow::KMixWindow (this=0x18d1ab0, invisible=false, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /home/kde-devel/src/kdemultimedia/kmix/apps/kmix.cpp:92
#20 0x00007ff803e0ebe6 in KMixApp::newInstance (this=0x17ba290) at /home/kde-devel/src/kdemultimedia/kmix/apps/KMixApp.cpp:106
#21 0x00007ff81582e9df in KUniqueApplicationAdaptor::newInstance (this=0x188f140, asn_id=..., args=...) at /home/kde-devel/src/kdelibs/kdeui/kernel/kuniqueapplication.cpp:442
#22 0x00007ff81582ec27 in KUniqueApplicationAdaptor::qt_metacall (this=0x188f140, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff3c8cce80) at /home/kde-devel/build/kdelibs/kdeui/kuniqueapplication_p.moc:81
#23 0x00007ff814ab17c2 in ?? () from /usr/lib/libQtDBus.so.4
#24 0x00007ff814ab283b in ?? () from /usr/lib/libQtDBus.so.4
#25 0x00007ff814ab31c2 in ?? () from /usr/lib/libQtDBus.so.4
#26 0x00007ff814ab3298 in ?? () from /usr/lib/libQtDBus.so.4
#27 0x00007ff81477839e in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#28 0x00007ff813926024 in QApplication::event(QEvent*) () from /usr/lib/libQtGui.so.4
#29 0x00007ff813922174 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#30 0x00007ff813926fe1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#31 0x00007ff815823bd7 in KApplication::notify (this=0x17ba290, receiver=0x17ba290, event=0x188f9e0) at /home/kde-devel/src/kdelibs/kdeui/kernel/kapplication.cpp:311
#32 0x00007ff814761bbc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#33 0x00007ff814764f2f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#34 0x00007ff81478c413 in ?? () from /usr/lib/libQtCore.so.4
#35 0x00007ff80f3a729d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#36 0x00007ff80f3a7a78 in ?? () from /usr/lib/libglib-2.0.so.0
#37 0x00007ff80f3a7d09 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#38 0x00007ff81478c876 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#39 0x00007ff8139c51be in ?? () from /usr/lib/libQtGui.so.4
#40 0x00007ff814760db2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#41 0x00007ff814760fb7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#42 0x00007ff8147651ab in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#43 0x00007ff803e02c36 in kdemain (argc=1, argv=0x17967b0) at /home/kde-devel/src/kdemultimedia/kmix/apps/main.cpp:72
#44 0x00000000004072e8 in launch (argc=1, _name=0x17a9c08 "/home/kde-devel/kde/bin/kmix", args=0x17a9c25 "", cwd=0x0, envc=0, envs=0x17a9c2d "", reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x40d73f "0") at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:734
#45 0x00000000004083f6 in handle_launcher_request (sock=8, who=0x40d9dc "launcher") at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:1226
#46 0x0000000000408ca9 in handle_requests (waitForPid=0) at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:1419
#47 0x000000000040a778 in main (argc=4, argv=0x7fff3c8cead8, envp=0x7fff3c8ceb00) at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:1907
Comment 49 Alex Merry 2011-08-22 22:31:30 UTC
And KMix will no longer start at all without crashing.
Comment 50 Christian Esken 2011-08-22 22:38:23 UTC
Thanks for the super fast test. :-)
That is great. It crashes at a completely other location. It looks like we are getting really closer. The crash is in
m_fds = (struct pollfd*)calloc(countNew, sizeof(struct pollfd));
Comment 51 Christian Esken 2011-08-22 22:51:36 UTC
THIS IS A BREAKTHROUGH!!! It proves that the list of polling descriptors can actually change:
It doesn't do it for my soundcards => no crash
For other soundcards it changes    => crash

So we are referencing non-existing entries from "QList<QSocketNotifier*> m_sns;".

I'll apply a patch, that should fix a whole lotta bug reports.
Comment 52 Christian Esken 2011-08-22 22:52:29 UTC
SVN commit 1248942 by esken:

CCBUGS: 209975
refresh polling FD's if number of polling descriptors change (adapting alsamixer behaviour here).

 M  +3 -1      mixer_alsa9.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1248942
Comment 53 Christian Esken 2011-08-22 22:54:12 UTC
SVN commit 1248943 by esken:

CCBUGS: 209975
refresh polling FD's if number of polling descriptors change (adapting alsamixer behaviour here).

 M  +1 -1      mixer_alsa9.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1248943
Comment 54 Christian Esken 2011-08-22 23:29:11 UTC
*** Bug 278455 has been marked as a duplicate of this bug. ***
Comment 55 Christian Esken 2011-08-22 23:31:04 UTC
*** Bug 280410 has been marked as a duplicate of this bug. ***
Comment 56 Alex Merry 2011-08-23 09:26:43 UTC
New crash (with r1248968) - again, only happens when logging in, not when starting kmix during the session:

Application: KMix (kdeinit4), signal: Aborted
[Current thread is 1 (Thread 0x7f1a05fe1760 (LWP 1681))]

[snip threads 2,3]

Thread 1 (Thread 0x7f1a05fe1760 (LWP 1681)):
[KCrash Handler]
#6  0x00007f1a02b3e725 in raise () from /lib/libc.so.6
#7  0x00007f1a02b3fb9b in abort () from /lib/libc.so.6
#8  0x00007f1a02b374de in ?? () from /lib/libc.so.6
#9  0x00007f1a02b37582 in __assert_fail () from /lib/libc.so.6
#10 0x00007f19f3bec644 in snd_hctl_handle_event (hctl=0x1d36380, event=0x7fff472ba940) at hcontrol.c:764
#11 0x00007f19f3bec703 in snd_hctl_handle_events (hctl=0x1d36380) at hcontrol.c:793
#12 0x00007f19f3bfa720 in snd_mixer_handle_events (mixer=0x1d11590) at mixer.c:847
#13 0x00007f19f3f325fe in Mixer_ALSA::prepareUpdateFromHW (this=0x1d0ccb0) at /home/kde-devel/src/kdemultimedia/kmix/backends/mixer_alsa9.cpp:581
#14 0x00007f19f3f4b070 in Mixer_Backend::readSetFromHW (this=0x1d0ccb0) at /home/kde-devel/src/kdemultimedia/kmix/backends/mixer_backend.cpp:103
#15 0x00007f19f3f4b9f4 in Mixer_Backend::qt_metacall (this=0x1d0ccb0, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x7fff472bacc0) at /home/kde-devel/build/kdemultimedia/kmix/mixer_backend.moc:82
#16 0x00007f1a0486d7fa in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#17 0x00007f1a048b6dde in QSocketNotifier::activated(int) () from /usr/lib/libQtCore.so.4
#18 0x00007f1a048754ab in QSocketNotifier::event(QEvent*) () from /usr/lib/libQtCore.so.4
#19 0x00007f1a03a1b174 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#20 0x00007f1a03a1ffe1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#21 0x00007f1a0591cbd7 in KApplication::notify (this=0x1aac450, receiver=0x1d5a240, event=0x7fff472bb1e0) at /home/kde-devel/src/kdelibs/kdeui/kernel/kapplication.cpp:311
#22 0x00007f1a0485abbc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#23 0x00007f1a04884f57 in ?? () from /usr/lib/libQtCore.so.4
#24 0x00007f19ff4a029d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#25 0x00007f19ff4a0a78 in ?? () from /usr/lib/libglib-2.0.so.0
#26 0x00007f19ff4a0d09 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#27 0x00007f1a04885876 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#28 0x00007f1a03abe1be in ?? () from /usr/lib/libQtGui.so.4
#29 0x00007f1a04859db2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#30 0x00007f1a04859fb7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#31 0x00007f1a0485e1ab in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#32 0x00007f19f3efbcb6 in kdemain (argc=3, argv=0x1a9ae90) at /home/kde-devel/src/kdemultimedia/kmix/apps/main.cpp:72
#33 0x00000000004072e8 in launch (argc=3, _name=0x1a6e198 "/home/kde-devel/kde/bin/kmix", args=0x1a6e1f6 "", cwd=0x0, envc=0, envs=0x1a6e1fe "", reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x40d73f "0") at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:734
#34 0x00000000004083f6 in handle_launcher_request (sock=8, who=0x40d9dc "launcher") at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:1226
#35 0x0000000000408ca9 in handle_requests (waitForPid=0) at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:1419
#36 0x000000000040a778 in main (argc=4, argv=0x7fff472bc408, envp=0x7fff472bc430) at /home/kde-devel/src/kdelibs/kinit/kinit.cpp:1907
Comment 57 Christian Esken 2011-08-26 18:11:59 UTC
SVN commit 1249601 by esken:

CCBUGS: 209975
Try to always refresh FD's for the ALSA polling


 M  +2 -1      mixer_alsa9.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1249601
Comment 58 Christian Esken 2011-08-26 18:13:19 UTC
Probably the alsamixer logic is not good enough. Lets do an experiment and
ALWAYS refresh the file descriptors. The patch below is also in trunk. If this
does not help, the problem must be reported to the ALSA developers.

kde@linux-1zss:~/workspace/kmix-BUILD/kmix  # svn diff
../../kmix/kmix/backends/mixer_alsa9.cpp
Index: ../../kmix/kmix/backends/mixer_alsa9.cpp
===================================================================
--- ../../kmix/kmix/backends/mixer_alsa9.cpp    (Revision 1248943)
+++ ../../kmix/kmix/backends/mixer_alsa9.cpp    (Arbeitskopie)
@@ -335,7 +335,8 @@
                return Mixer::ERR_OPEN;
        }

-       if ( countNew != m_sns.size() )
+       //if ( countNew != m_sns.size() )
+       if (true)
        {
                // Redo everything if count of FD's have changed (emulating
alsamixer behaviour here)
                 while (!m_sns.isEmpty())
Comment 59 Christian Esken 2011-08-29 22:18:21 UTC
Brainstorming. When feedback comes in about the last change and it still crashes, I might add Qt::QueuedConnection when doing the connect( _pollingTimer, ...).
Comment 60 Christian Schmitt 2011-08-30 06:43:00 UTC
*** Bug 279271 has been marked as a duplicate of this bug. ***
Comment 61 Christian Esken 2011-09-01 07:09:51 UTC
This is a call for testers. I need somebody to try the trunk version of KMix to see whether this bug vanishes. If not, we need to retry with another change (Qt::QueuedConnection).
Comment 62 Christian Schmitt 2011-09-01 07:20:15 UTC
I'd like to test it but i'm using 4.7. Would you mind supplying a patch against this version?

Thanks.
Comment 63 Alex Merry 2011-09-01 12:46:40 UTC
I haven't had any crashes after building the latest trunk.  So it seems to work as far as I can tell.
Comment 64 Christian Esken 2011-09-01 22:55:13 UTC
SVN commit 1250843 by esken:

CCBUGS: 209975
Use Qt::QueuedConnection for poll() interface

 M  +1 -1      mixer_backend.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1250843
Comment 65 Christoph Feck 2011-09-07 21:43:19 UTC
*** Bug 281581 has been marked as a duplicate of this bug. ***
Comment 66 Christian Esken 2011-09-09 19:10:15 UTC
Closing bug. Fix will ship with KDE4.8.

@Christian Schmitt: I tried to do a patch, but the versions are unfortunately just too different.
Comment 67 Christian Esken 2011-09-09 19:23:49 UTC
*** Bug 242678 has been marked as a duplicate of this bug. ***
Comment 68 Christian Esken 2011-09-09 19:40:06 UTC
I have reconsidered. Given the fact that the bug is so bad and KDE4.8 ships not
earlier than in4 months, I decided to patch it manually for KDE4.7.

@Christian Schmitt: This really requires testing!!! Can you do so? See the
attached patch? I will also commit to branch 4.7 in a minute.
Comment 69 Christian Esken 2011-09-09 19:42:56 UTC
Created attachment 63541 [details]
ALSA Polling crash fix: backport to KDE4.7
Comment 70 Christian Esken 2011-09-09 19:46:10 UTC
SVN commit 1252374 by esken:

BUGS: 209975
ALSA Polling crash fix: backport to KDE4.7


 M  +2 -2      mixer_alsa.h  
 M  +39 -30    mixer_alsa9.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1252374
Comment 71 Christian Schmitt 2011-09-10 09:27:27 UTC
I just tested it under KDE 4.7.1. Result: kded still crashes as soon as I open Amarok, in my case.
Attached debug info is hopefully of help. If not, please ping me.

[KCrash Handler]
#6  0x00007fad90962b35 in raise () from /lib64/libc.so.6
#7  0x00007fad90963eda in abort () from /lib64/libc.so.6
#8  0x00007fad9095b5a1 in __assert_fail () from /lib64/libc.so.6
#9  0x00007fad75070edf in snd_hctl_handle_event (hctl=0xd88110, event=0x7fff07997850) at hcontrol.c:764
#10 0x00007fad75070f9e in snd_hctl_handle_events (hctl=0xd88110) at hcontrol.c:793
#11 0x00007fad7507e6e4 in snd_mixer_handle_events (mixer=0xd7f430) at mixer.c:847
#12 0x00007fad7534e95d in ?? () from /usr/lib64/kde4/kded_kmixd.so
#13 0x00007fad75358917 in ?? () from /usr/lib64/kde4/kded_kmixd.so
#14 0x00007fad753588a3 in ?? () from /usr/lib64/kde4/kded_kmixd.so
#15 0x00007fad9201f49f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#16 0x00007fad92067e0e in QSocketNotifier::activated(int) () from /usr/lib64/qt4/libQtCore.so.4
#17 0x00007fad92025ab3 in QSocketNotifier::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#18 0x00007fad911996fc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#19 0x00007fad9119e25a in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#20 0x00007fad92dd65c8 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#21 0x00007fad9200aacb in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#22 0x00007fad920355f8 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#23 0x00007fad8d7edf1a in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#24 0x00007fad8d7ee6f8 in ?? () from /usr/lib64/libglib-2.0.so.0
#25 0x00007fad8d7ee95f in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#26 0x00007fad92035c1a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#27 0x00007fad9123f8c6 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#28 0x00007fad92009e12 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#29 0x00007fad9200a094 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#30 0x00007fad9200e57b in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#31 0x00007fad851f3d71 in kdemain () from /usr/lib64/libkdeinit4_kded4.so
#32 0x0000000000407566 in _start ()
Comment 72 Christoph Feck 2011-09-14 21:44:49 UTC
*** Bug 281967 has been marked as a duplicate of this bug. ***
Comment 73 Christian Esken 2011-09-17 09:15:37 UTC
Thanks for testing. I now added the poll Qt::QueuedConnection also to the QSocketNotifier. Hopefully this helps. Patch is below and I will also commit it to trunk and some branches.

Index: kmix/backends/mixer_alsa9.cpp
===================================================================
--- kmix/backends/mixer_alsa9.cpp	(revision 1252374)
+++ kmix/backends/mixer_alsa9.cpp	(working copy)
@@ -368,7 +368,7 @@
 			//kDebug() << "socket " << i;
 			QSocketNotifier* qsn = new QSocketNotifier(m_fds[i].fd, QSocketNotifier::Read);
 			m_sns.append(qsn);
-			connect(m_sns[i], SIGNAL(activated(int)), SLOT(readSetFromHW()));
+			connect(m_sns[i], SIGNAL(activated(int)), SLOT(readSetFromHW()), Qt::QueuedConnection);
 		}
 	}
Comment 74 Christian Esken 2011-09-17 09:20:02 UTC
SVN commit 1254071 by esken:

CCBUGS: 209975
Use Qt::QueuedConnection for QSocketNotifier in for poll() on ALSA's FD's.

 M  +1 -1      mixer_alsa9.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1254071
Comment 75 Christian Esken 2011-09-17 09:22:15 UTC
SVN commit 1254072 by esken:

CCBUGS: 209975
Use Qt::QueuedConnection for QSocketNotifier in for poll() on ALSA's FD's and for olling via QTimer. Backport to 4.6 branch.

 M  +1 -1      mixer_alsa9.cpp  
 M  +1 -1      mixer_backend.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1254072
Comment 76 Christian Esken 2011-09-17 09:23:35 UTC
SVN commit 1254073 by esken:

CCBUGS: 209975
Use Qt::QueuedConnection for QSocketNotifier in for poll() on ALSA's FD's and for polling via QTimer. Backport to 4.7 branch.

 M  +1 -1      mixer_alsa9.cpp  
 M  +1 -1      mixer_backend.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1254073
Comment 77 Christian Esken 2011-09-17 09:31:23 UTC
To Christian Schmidt. You cannot test under KDE4.7.1 because KDE 4.7.1 was released before my patch. Please either use 4.7 trunk, use the patch, or wait for KDE4.7.2. For now I will presume that the bug is fixed, as I got positive reports.
If there is still a problem in KDE4.7.2 please open a new bug report with a new stack trace. I would appreciate if you then also would leave a comment in #209975 about that new bug report.
Comment 78 Alex Merry 2011-09-22 11:42:53 UTC
Sorry, still happening, just less frequently.

Crash in latest trunk:

Application: KDE Dæmon (kdeinit4), signal: Aborted
[Current thread is 1 (Thread 0x7f9c12a63760 (LWP 1215))]

Thread 2 (Thread 0x7f9bf8b03700 (LWP 1689)):
#0  0x00007f9c0f63c563 in poll () from /lib/libc.so.6
#1  0x00007f9c0bf037d4 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007f9c0bf03d09 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f9c112f966e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f9c112cda92 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f9c112cdc97 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f9c111e513f in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f9c112b0aef in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f9c111e7bc5 in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007f9c10f5dda0 in start_thread () from /lib/libpthread.so.0
#10 0x00007f9c0f6447dd in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f9c12a63760 (LWP 1215)):
[KCrash Handler]
#6  0x00007f9c0f5a5735 in raise () from /lib/libc.so.6
#7  0x00007f9c0f5a6bab in abort () from /lib/libc.so.6
#8  0x00007f9c0f59e57e in ?? () from /lib/libc.so.6
#9  0x00007f9c0f59e622 in __assert_fail () from /lib/libc.so.6
#10 0x00007f9bf6340644 in snd_hctl_handle_event (hctl=0x141e7a0, event=0x7fff7d1fdbd0) at hcontrol.c:764
#11 0x00007f9bf6340703 in snd_hctl_handle_events (hctl=0x141e7a0) at hcontrol.c:793
#12 0x00007f9bf634e720 in snd_mixer_handle_events (mixer=0x14215b0) at mixer.c:847
#13 0x00007f9bf6637d30 in Mixer_ALSA::prepareUpdateFromHW (this=0x1450a20) at /home/kde-devel/src/kdemultimedia/kmix/backends/mixer_alsa9.cpp:582
#14 0x00007f9bf662f334 in Mixer_Backend::readSetFromHW (this=0x1450a20) at /home/kde-devel/src/kdemultimedia/kmix/backends/mixer_backend.cpp:107
#15 0x00007f9bf662fcb8 in Mixer_Backend::qt_metacall (this=0x1450a20, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x150f880) at /home/kde-devel/build/kdemultimedia/kmix/mixer_backend.moc:82
#16 0x00007f9c112e518e in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#17 0x00007f9c10487ae4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#18 0x00007f9c1048c951 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#19 0x00007f9c1239c3ab in KApplication::notify (this=0x7fff7d1fe6c0, receiver=0x1450a20, event=0x1487f90) at /home/kde-devel/src/kde/kdelibs/kdeui/kernel/kapplication.cpp:311
#20 0x00007f9c112ce89c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#21 0x00007f9c112d1c2f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#22 0x00007f9c112f91a3 in ?? () from /usr/lib/libQtCore.so.4
#23 0x00007f9c0bf0329d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#24 0x00007f9c0bf03a78 in ?? () from /usr/lib/libglib-2.0.so.0
#25 0x00007f9c0bf03d09 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#26 0x00007f9c112f9606 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#27 0x00007f9c1052aeee in ?? () from /usr/lib/libQtGui.so.4
#28 0x00007f9c112cda92 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#29 0x00007f9c112cdc97 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#30 0x00007f9c112d1eab in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#31 0x00007f9c00976755 in kdemain (argc=1, argv=0x110fa30) at /home/kde-devel/src/kde/kdelibs/kded/kded.cpp:924
#32 0x00000000004072f8 in launch (argc=1, _name=0x40de72 "kded4", args=0x0, cwd=0x0, envc=0, envs=0x0, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x40d74f "0") at /home/kde-devel/src/kde/kdelibs/kinit/kinit.cpp:734
#33 0x000000000040a4d4 in main (argc=4, argv=0x7fff7d1fefa8, envp=0x7fff7d1fefd0) at /home/kde-devel/src/kde/kdelibs/kinit/kinit.cpp:1849
Comment 79 Alex Merry 2011-09-22 12:00:34 UTC
Or maybe the latest change broke it again - it seemed to be fixed for a while.
Comment 80 Christian Esken 2011-09-22 19:11:37 UTC
Alex, could you test with undoing the one or both of the changes:

http://websvn.kde.org/trunk/KDE/kdemultimedia/kmix/backends/mixer_alsa9.cpp?r1=1254071&r2=1254070&pathrev=1254071

http://websvn.kde.org/trunk/KDE/kdemultimedia/kmix/backends/mixer_backend.cpp?r1=1250843&r2=1250842&pathrev=1250843

BTW: It looks more and more like something that must be fixed in ALSA. If this "patch undoing" does not help, it must be addressed to the ALSA bug system.
Comment 81 Alex Merry 2011-10-16 18:55:41 UTC
I reverted both the QueuedConnection commits, and I haven't had a crash since, but I'll keep you updated.
Comment 82 Alex Merry 2011-10-19 09:49:09 UTC
*sigh*

Sorry, it's still there, even after reverting both.  It just didn't happen for a couple of restarts.
Comment 83 Christoph Feck 2011-10-20 22:45:14 UTC
*** Bug 284578 has been marked as a duplicate of this bug. ***
Comment 84 Christoph Feck 2011-10-22 00:44:52 UTC
*** Bug 284637 has been marked as a duplicate of this bug. ***
Comment 85 Lamarque V. Souza 2011-10-25 22:05:00 UTC
*** Bug 284963 has been marked as a duplicate of this bug. ***
Comment 86 Christian Esken 2011-10-29 10:23:36 UTC
I have opened a bug report at ALSA: https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5471

Everybody who is still affected, please report the soundcard(s) and alsa version you use like this here:

cat /proc/asound/version
cat /proc/asound/cards
cat /proc/asound/modules
Comment 87 Christoph Feck 2011-11-01 17:03:10 UTC
*** Bug 285389 has been marked as a duplicate of this bug. ***
Comment 88 spam 2011-11-01 22:15:55 UTC
Advanced Linux Sound Architecture Driver Version 1.0.24.

0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf7db8000 irq 44

0 snd_hda_intel

(In the order you've mentioned the infos above)
kdeinit4 crashes for me every time I start up, kmix tells me that it couldn't find "alsa", "oss", and many other, and states that it fell back to "". Sound works though.
Comment 89 Chris Maple 2011-11-03 01:40:15 UTC
cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.23.

cat /proc/asound/cards
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf3ff8000 irq 57

cat /proc/asound/modules
 0 snd_hda_intel

Sound processing is built in to Asus motherboard.

Sound always works and kmix always comes up whether error message occurs or
not. However, kmix appearance is not consistent, with one or four tabs
independent of error message occurrence.
Comment 90 Jekyll Wu 2011-11-08 09:16:59 UTC
*** Bug 286082 has been marked as a duplicate of this bug. ***
Comment 91 Vamp898 2011-11-08 09:34:10 UTC
For me this only happens with my specific configuration i take over from my archlinux installation to my gentoo installation.

With a clean new user this does not happen. so this really seems to be an configuration issue

i dont get any popup about sound device not aviable, i only have VLC Backend in Phonon without Pulseaudio support
Comment 92 Vamp898 2011-11-08 09:45:30 UTC
(In reply to comment #91)
> For me this only happens with my specific configuration i take over from my
> archlinux installation to my gentoo installation.
> 
> With a clean new user this does not happen. so this really seems to be an
> configuration issue
> 
> i dont get any popup about sound device not aviable, i only have VLC Backend in
> Phonon without Pulseaudio support

to clearify, everything i get is this popup on login. Everything works fine and i dont get any further popups or something like that.

When i use blank configs this does not happen anymore, if i put back my old configs, the popup is there again.

On Archlinux i used Phonon with VLC Backend, but PulseAudio Support was compiled in.

On Gentoo, because i dont need Pulseaudio in any way, i didn't compiled pulseaudio support. But still the same VLC Backend.
Comment 93 Kelytha 2011-11-08 21:07:25 UTC
Advanced Linux Sound Architecture Driver Version 1.0.24.

0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf9dfc000 irq 43

0 snd_hda_intel

Crash happens on first login after every boot. Sound always works perfectly. I'm using Arch Linux, everything upgraded. I use the VLC backend for Phonon.
Comment 94 mail 2011-11-16 16:44:01 UTC
This happens to me too. KMix crashes on first startup after login.
(I can provide a backtrace with line nubers if neccessary.)

I am using Gentoo 64bit, kmix-4.7.3, alsa-lib-1.0.24.1.

cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.24.

cat /proc/asound/cards
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xee300000 irq 46

/proc/asound/modules does not exist.
Comment 95 Christian Esken 2011-11-19 09:18:15 UTC
We have plenty of backtraces with line numbers, but if you have a current KDE version (KDE4.7 series), it would be appreciated.
Comment 96 Christian Esken 2011-11-19 09:28:47 UTC
Thanks to everybody who reported their soundcard configuration. There seems to be a pattern, namely every single one has a '[Intel]' card installed. So it looks like soundcard specific. I would ask everybody else who did not report to just run 
  cat /proc/asound/version

and look for Intel (in square brackets, like "[Intel ]"). If you have a crash but NO such card, please report it here. Or (better, even if you have an Intel card) simply post the complete information like described in comment 86.
Comment 97 mail 2011-11-19 11:30:15 UTC
Created attachment 65838 [details]
KMix crash version 4.7.3

I have added an attachment with another backtrace using KDE 4.7.3 on Gentoo.
Comment 98 Christian Schmitt 2011-11-22 07:34:46 UTC
Another variant:

cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.24

cat /proc/asound/cards
 0 [SB             ]: HDA-Intel - HDA ATI SB
                      HDA ATI SB at 0xfe024000 irq 16
 1 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfdffc000 irq 43

Gentoo ~amd64 with kde 4.7.3
Comment 99 Peter S. 2011-11-26 22:46:49 UTC
I have the same problem. Hardware:
Advanced Linux Sound Architecture Driver Version 1.0.24.
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf9ff8000 irq 45
 0 snd_hda_intel

Krash report:
-----------------------------------------------
Thread 1 (Thread 0x7ff192b01760 (LWP 865)):
[KCrash Handler]
#6  0x00007ff1900f1965 in raise () from /lib/libc.so.6
#7  0x00007ff1900f2ddb in abort () from /lib/libc.so.6
#8  0x00007ff1900ea7ae in ?? () from /lib/libc.so.6
#9  0x00007ff1900ea852 in __assert_fail () from /lib/libc.so.6
#10 0x00007ff17027dafb in snd_hctl_handle_events () from /usr/lib/libasound.so.2
#11 0x00007ff170288899 in snd_mixer_handle_events () from /usr/lib/libasound.so.2
#12 0x00007ff17054668d in ?? () from /usr/lib/kde4/kded_kmixd.so
#13 0x00007ff170558da7 in ?? () from /usr/lib/kde4/kded_kmixd.so
#14 0x00007ff170558d0d in ?? () from /usr/lib/kde4/kded_kmixd.so
------------------------------------------------

For two diffrent PC's helped me doing from root:
alsaconf

Try this, I hope it help in yours case .
Comment 100 Jekyll Wu 2011-12-04 07:15:52 UTC
*** Bug 288135 has been marked as a duplicate of this bug. ***
Comment 101 Thomas Richard 2011-12-04 13:33:18 UTC
I'm also having the same issue

cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.24.

cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf3a20000 irq 46
29 [ThinkPadEC     ]: ThinkPad EC - ThinkPad Console Audio Control
                      ThinkPad Console Audio Control at EC reg 0x30, fw unknown

I'm running KDE 4.7.3 on Arch. What i'm noticing in this bug report is that most people here run Arch or Gentoo. Could this be a configuration issue at distro level? I never saw this crash when running Kubuntu.
Comment 102 Christoph Feck 2011-12-08 11:23:10 UTC
*** Bug 288402 has been marked as a duplicate of this bug. ***
Comment 103 Pablo 2011-12-19 12:30:05 UTC
I solved it running as root:

#alsactl init

Thanks to Peter S. (comment #99)
Comment 104 Christoph Feck 2011-12-27 20:57:02 UTC
*** Bug 289949 has been marked as a duplicate of this bug. ***
Comment 105 Thomas Richard 2011-12-28 19:48:18 UTC
I can confirm that the command mentioned in comment #103 fixed my problem
Comment 106 Christian Esken 2011-12-30 14:42:15 UTC
Thanks for posting the workarounds. I forwarded them to https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5471
Comment 107 Thijs 2012-01-03 16:12:59 UTC
*** Bug 290501 has been marked as a duplicate of this bug. ***
Comment 108 stalker37 2012-01-03 17:57:54 UTC
#alsactl init
not help, 
rm -f rm -f /home/user/.kde4/share/config/kimixrc and alsactl init after reboot help
Comment 109 Dionysius 2012-01-05 06:03:20 UTC
Created attachment 67474 [details]
KMix crash version 4.7.4

AltLinux 6.0.1 x86_64
Comment 110 Christoph Feck 2012-02-07 20:45:44 UTC
*** Bug 293565 has been marked as a duplicate of this bug. ***
Comment 111 Christian Esken 2012-02-08 23:23:00 UTC
I just found that alsamixer itself can also be affected:
https://bugs.launchpad.net/ubuntu/+source/alsa-utils/+bug/715544

The description shows a crash/asssertion failure at the exact same line:

AssertionMessage: alsamixer: hcontrol.c:764: snd_hctl_handle_event: Assertiva `elem' falhou.
Date: Tue Feb 8 23:55:28 2011
ExecutablePath: /usr/bin/alsamixer

That Launchpad bug report is already 1 year old, but it looks like it wasn't visible at that time (visibility: private).
Comment 112 Christian Esken 2012-02-08 23:38:06 UTC
And more "identical" bugs in alsamixer:

https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5249#c23300
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/689590


So it looks like a repetetive issue, with different sound cards.

If someone is interested in getting this fixed, I advise to discuss it on the alsa-devel Mailing list, like it was done in http://mailman.alsa-project.org/pipermail/alsa-devel/2011-January/036290.html . I personally cannot do this, as I cannot reproduce it and thus cannot submit the neccesary feedback and test data. If you plan to do it, please add links to the KDE- and ALSA-Bugsystem tp your post:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5471
https://bugs.kde.org/show_bug.cgi?id=209975
Comment 113 Jekyll Wu 2012-02-12 09:12:30 UTC
*** Bug 293882 has been marked as a duplicate of this bug. ***
Comment 114 Christoph Feck 2012-02-13 16:51:17 UTC
*** Bug 294003 has been marked as a duplicate of this bug. ***
Comment 115 Christoph Feck 2012-02-13 16:52:43 UTC
*** Bug 287877 has been marked as a duplicate of this bug. ***
Comment 116 Christian Schmitt 2012-02-14 07:03:51 UTC
alsaconf also solved this for me here. I had no more crashes since then.
Comment 117 Andrea Iacovitti 2012-02-14 11:26:08 UTC
I have the same problem.
My system: Debian/testing, kde 4.7.4, qt 4.7.4.
Already reported the output of alsa-info.sh in https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5471

The crash happens to me at first login in kde after booting my machine. If I logout from kde, then login again (without rebooting the machine) i do not experience the crash -> either using kdm or not (i.e. startx).

I workaround the crash by installing the (optional) debian pkg "alsa-utils".
This packages contains the init script (/etc/init.d/alsa-utils) that seems to help avoid the crash when login to kde.
In fact if I disable the execution of the above mentioned init script, i experience again the crash.
Comment 118 Tomáš Chvátal 2012-02-14 18:51:57 UTC
Created attachment 68798 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.7.4 (4.7.4) using Qt 4.7.4

As previous reporter i just logged in and seen this error, the trace is bit different but result the same, not only kmix but also kded crashed for me, both with same trace.

-- Backtrace (Reduced):
#6  0x000002e819bed835 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x000002e819beecab in __GI_abort () at abort.c:92
#8  0x000002e819be65dd in __GI___assert_fail (assertion=0x2e7fdcd0fde "elem", file=<optimized out>, line=764, function=<optimized out>) at assert.c:81
#9  0x000002e7fdc4cfed in snd_hctl_handle_event (event=0x3fca44218e0, hctl=0x2383f49610) at hcontrol.c:764
#10 snd_hctl_handle_events (hctl=0x2383f49610) at hcontrol.c:793
Comment 119 Christoph Feck 2012-02-14 22:10:34 UTC
*** Bug 294109 has been marked as a duplicate of this bug. ***
Comment 120 Erik Martin-Dorel 2012-02-15 18:45:08 UTC
The workaround suggested in Comment #117 (installing Debian package alsa-utils) also worked for me.

My system:
$ uname -a
Linux localhost 3.2.0-1-amd64 #1 SMP Sun Feb 5 15:17:15 UTC 2012 x86_64 GNU/Linux
(I am running a Debian unstable.)

$ cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.24.

$ cat /proc/asound/cards
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xe9660000 irq 44
 1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xe3080000 irq 16
$ cat /proc/asound/modules
 0 snd_hda_intel
 1 snd_hda_intel
Comment 121 Jekyll Wu 2012-02-16 20:30:11 UTC
*** Bug 294262 has been marked as a duplicate of this bug. ***
Comment 122 Jekyll Wu 2012-02-20 15:43:16 UTC
*** Bug 294503 has been marked as a duplicate of this bug. ***
Comment 123 Diego 2012-02-28 17:14:28 UTC
Created attachment 69162 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.8.00 (4.8.0 using Qt 4.8.0

- What I was doing when the application crashed:
During the login KDE tells me that has crashed kdeinit4
- Custom settings of the application:
i use e4rat in boot process

-- Backtrace (Reduced):
#10 0x00007f19e43dc54b in snd_hctl_handle_events () from /usr/lib/libasound.so.2
#11 0x00007f19e43e79a9 in snd_mixer_handle_events () from /usr/lib/libasound.so.2
[...]
#16 0x00007f1a00a0ee09 in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#17 0x00007f19ffb668c4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#18 0x00007f19ffb6b743 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
Comment 124 Christoph Feck 2012-03-09 12:00:45 UTC
*** Bug 295568 has been marked as a duplicate of this bug. ***
Comment 125 udo 2012-03-09 23:03:07 UTC
The Error-Messages appears only at first startup. Restarting the X-Server with /etc/init.d/kdm restart shows no Message.
The Installation of Package alsa-utils also fixed the Problem for me.

Linux laptop 3.1.0-1-486 #1 Tue Jan 10 04:55:10 UTC 2012 i686 GNU/Linux
Distribution: Debian wheezy with KDE 4.6.5.
/proc/asound/version:   Advanced Linux Sound Architecture Driver Version 1.0.24
/proc/asound/cards 
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xd3600000 irq 43
/proc/asound/modules:  0 snd_hda_intel
Comment 126 Christian Esken 2012-03-16 22:46:39 UTC
Dear bug reporters,

with all the reports of a possible fix via ALSA-Tools I think it is more than save to assume that the core reason is inside ALSA. Thus I will soon close this bug report, as there is really nothing I can do within KMix. 

I will repeat what I advised in comment 112 if you are interested in getting it fixed in ALSA:
Please discuss it on the alsa-devel Mailing list, like it was done in http://mailman.alsa-project.org/pipermail/alsa-devel/2011-January/036290.html . I personally cannot do this, as I cannot reproduce it and thus cannot submit the neccesary feedback and test data. If you plan to do it, please add links to the KDE- and ALSA-Bugsystem to your post:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5471
https://bugs.kde.org/show_bug.cgi?id=209975

Thanks for all your patience on this really nasty problem.

  Christian
Comment 127 Jekyll Wu 2012-03-20 20:50:05 UTC
*** Bug 296455 has been marked as a duplicate of this bug. ***
Comment 128 Jekyll Wu 2012-03-25 15:48:31 UTC
*** Bug 296744 has been marked as a duplicate of this bug. ***
Comment 129 Christian Esken 2012-03-27 21:35:46 UTC
Closing bug as bug responsibility is transferred to the ALSA bugtracker: It is an ALSA bug, and resolving or workarounds in KMix do not seem to be possible:
 https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5471

Hint to bug triagers: If you find more duplicates of this bug, please continue to mark them as duplicate of this bug. Thanks for your work.
Comment 130 Jekyll Wu 2012-04-06 14:32:54 UTC
*** Bug 297598 has been marked as a duplicate of this bug. ***
Comment 131 Christoph Feck 2012-04-17 01:45:13 UTC
*** Bug 298271 has been marked as a duplicate of this bug. ***
Comment 132 Sergey 2012-04-17 18:13:03 UTC
Created attachment 70461 [details]
New crash information added by DrKonqi

krunner (0.1) on KDE Platform 4.8.2 (4.8.2) using Qt 4.8.1

- What I was doing when the application crashed:
Correctly rebooted system. At start KDE Init crashed. 
not working alt+f2 for start application.
Every time you start KDE is falling.
- Unusual behavior I noticed:

-- Backtrace (Reduced):
#12 0x00007feeac898484 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#13 0x00007feeac89cbf8 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#14 0x00007fee9a64350f in kdemain () from /usr/lib/libkdeinit4_krunner.so
#15 0x00000000004083e4 in _start ()
Comment 133 Stephan Menzel 2012-05-20 13:11:33 UTC
Created attachment 71241 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.8.3 (4.8.3) using Qt 4.8.1

- What I was doing when the application crashed:

starting up. I did click some icons before startup was complete. 

- Unusual behavior I noticed:

-- Backtrace (Reduced):
#8  0x00007fd599c11a8e in __assert_fail_base (fmt=<optimized out>, assertion=0x7fd57b5279ea "elem", file=0x7fd57b525539 "hcontrol.c", line=<optimized out>, function=<optimized out>) at assert.c:94
[...]
#10 0x00007fd57b4b1776 in snd_hctl_handle_event (event=0x7fffd108c770, hctl=0x1488220) at hcontrol.c:764
#11 snd_hctl_handle_events (hctl=0x1488220) at hcontrol.c:793
#12 0x00007fd57b4bd889 in snd_mixer_handle_events (mixer=0x14886b0) at mixer.c:847
#13 0x00007fd57b7753c5 in Mixer_ALSA::prepareUpdateFromHW (this=0x14825a0) at /var/tmp/portage/kde-base/kmix-4.8.3/work/kmix-4.8.3/kmix/backends/mixer_alsa9.cpp:603
Comment 134 Christian Esken 2012-05-21 20:51:45 UTC
Sergey and Stephan Menzel. Reporting additional  information her does not make sense. This is an ALSA bug, so please instead contact the ALSA developers as explained in Comment 126 .
Comment 135 Jekyll Wu 2012-05-25 19:57:41 UTC
*** Bug 300622 has been marked as a duplicate of this bug. ***
Comment 136 Jekyll Wu 2012-06-04 05:44:29 UTC
*** Bug 301141 has been marked as a duplicate of this bug. ***
Comment 137 Martin Sandsmark 2012-07-05 08:48:54 UTC
For posterity, it should now have been fixed in ALSA:

http://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=86e27cdbf119440101a850e1b44baebfefe863ca
Comment 138 Jekyll Wu 2012-07-07 12:03:20 UTC
*** Bug 303143 has been marked as a duplicate of this bug. ***
Comment 139 Jekyll Wu 2012-07-07 23:46:14 UTC
*** Bug 303176 has been marked as a duplicate of this bug. ***
Comment 140 Carlos Izquierdo 2012-07-08 15:52:21 UTC
Just for information if anyone else gets this error and has to read the whole thread: I had the crash screen on startup on 2 Debian machines. On one of them, installing alsa-utils (comment #117) did the trick, the other needed an extra "rm ~/,kde/share/config/kmix* && sudo alsactl-init" (comments #103 and #108) but in the end it solved it as well.
Comment 141 Jekyll Wu 2012-07-11 13:24:03 UTC
*** Bug 303363 has been marked as a duplicate of this bug. ***
Comment 142 Jekyll Wu 2012-07-17 02:39:22 UTC
*** Bug 303639 has been marked as a duplicate of this bug. ***
Comment 143 Christoph Feck 2012-07-23 15:13:53 UTC
*** Bug 303958 has been marked as a duplicate of this bug. ***
Comment 144 Jekyll Wu 2012-08-20 03:08:11 UTC
*** Bug 305456 has been marked as a duplicate of this bug. ***
Comment 145 Jekyll Wu 2012-08-24 15:45:45 UTC
*** Bug 305724 has been marked as a duplicate of this bug. ***
Comment 146 Jekyll Wu 2012-10-25 23:25:19 UTC
*** Bug 309005 has been marked as a duplicate of this bug. ***
Comment 147 Christoph Feck 2012-12-19 23:56:45 UTC
*** Bug 311955 has been marked as a duplicate of this bug. ***
Comment 148 Jekyll Wu 2013-02-20 15:32:47 UTC
*** Bug 315521 has been marked as a duplicate of this bug. ***
Comment 149 Jekyll Wu 2013-06-06 01:57:44 UTC
*** Bug 320674 has been marked as a duplicate of this bug. ***
Comment 150 Dan 2013-06-07 21:49:48 UTC
Hello Jekyll Wu
Just to let you know that I downloaded a newer version of PCLinux with KDE
support. The ISO version is much
superior to the CD I purchased, and it does not have the problem I have
been dealing with.
So everything is running at this point. However installing the PCLinux
alongside my WinXP OS kind of made the old
WinXP upset. It does not like sharing disk space with another system.
I do want to thank you for your kind help and advise----it is much
appreciated.
Dan


On Wed, Jun 5, 2013 at 8:57 PM, Jekyll Wu <adaptee@gmail.com> wrote:

> https://bugs.kde.org/show_bug.cgi?id=209975
>
> Jekyll Wu <adaptee@gmail.com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |dr.j1234@gmail.com
>
> --- Comment #149 from Jekyll Wu <adaptee@gmail.com> ---
> *** Bug 320674 has been marked as a duplicate of this bug. ***
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>