Bug 268185 - ALSA config parsing not reentrant
Summary: ALSA config parsing not reentrant
Status: RESOLVED UPSTREAM
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: kded module for audio device listing (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Harald Sitter
URL: http://mailman.alsa-project.org/piper...
Keywords:
: 228840 255489 265159 269839 271040 272428 273031 284836 292294 292297 292817 293714 298251 298678 298761 301124 305800 307091 308766 310750 311248 312565 313232 314102 314180 314584 315486 315663 315782 316471 318866 319141 319266 319797 319805 320854 322417 322811 324175 327378 329474 336265 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-11 04:12 UTC by Chris Maple
Modified: 2017-05-10 18:24 UTC (History)
46 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (6.88 KB, text/plain)
2011-08-19 14:49 UTC, Sami Nieminen
Details
New crash information added by DrKonqi (8.57 KB, text/plain)
2012-06-04 21:22 UTC, Webos 64
Details
New crash information added by DrKonqi (8.39 KB, text/plain)
2012-07-27 02:45 UTC, robert
Details
New crash information added by DrKonqi (8.73 KB, text/plain)
2012-08-01 08:24 UTC, darkfish
Details
New crash information added by DrKonqi (8.21 KB, text/plain)
2012-11-05 08:23 UTC, Nicos Gollan
Details
New crash information added by DrKonqi (7.37 KB, text/plain)
2012-11-10 18:26 UTC, William A.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Maple 2011-03-11 04:12:24 UTC
Application: kded4 ($Id: kded.cpp 1156841 2010-07-29 19:59:05Z zander $)
KDE Platform Version: 4.5.5 (KDE 4.5.5)
Qt Version: 4.7.1
Operating System: Linux 2.6.35.11-83.fc14.i686 i686
Distribution: "Fedora release 14 (Laughlin)"

-- Information about the crash:
- What I was doing when the application crashed:
First boot after restoring system from a failed attempt to put /usr/bin, /usr/sbin, /usr/lib, /usr/libexec, and /usr/local/bin on an SSD and symlinking to them. There was no user input before the crash message appeared.

-- Backtrace:
Application: KDE Daemon (kded4), signal: Segmentation fault
[KCrash Handler]
#7  snd_config_iterator_next (iterator=0x206c6174) at conf.c:3827
#8  0x06f6251d in add_software_devices (card=-1, iface=0x68cd45c "pcm", hints=0xbfe3de1c) at namehint.c:506
#9  snd_device_name_hint (card=-1, iface=0x68cd45c "pcm", hints=0xbfe3de1c) at namehint.c:582
#10 0x068b942e in PhononServer::findVirtualDevices (this=0x9586ff8) at /usr/src/debug/kdebase-runtime-4.5.5/phonon/kded-module/phononserver.cpp:166
#11 0x068bdb43 in PhononServer::findDevices (this=0x9586ff8) at /usr/src/debug/kdebase-runtime-4.5.5/phonon/kded-module/phononserver.cpp:520
#12 0x068c0f47 in PhononServer::PhononServer (this=0x9586ff8, parent=0x93ea620) at /usr/src/debug/kdebase-runtime-4.5.5/phonon/kded-module/phononserver.cpp:68
#13 0x068c7159 in KPluginFactory::createInstance<PhononServer, QObject> (parentWidget=0x0, parent=0x93ea620, args=...) at /usr/include/kde4/kpluginfactory.h:461
#14 0x03c6f148 in KPluginFactory::create (this=0x9598458, iface=0x3cbdd20 "KDEDModule", parentWidget=0x0, parent=0x93ea620, args=..., keyword=...) at /usr/src/debug/kdelibs-4.5.5/kdecore/util/kpluginfactory.cpp:191
#15 0x0046a856 in create<KDEDModule> (this=0x93ea620, s=..., onDemand=true) at /usr/src/debug/kdelibs-4.5.5/kdecore/util/kpluginfactory.h:491
#16 Kded::loadModule (this=0x93ea620, s=..., onDemand=true) at /usr/src/debug/kdelibs-4.5.5/kded/kded.cpp:381
#17 0x0046b127 in Kded::loadModule (this=0x93ea620, obj=..., onDemand=true) at /usr/src/debug/kdelibs-4.5.5/kded/kded.cpp:335
#18 0x0046b3d4 in Kded::messageFilter (message=...) at /usr/src/debug/kdelibs-4.5.5/kded/kded.cpp:196
#19 0x00624ca0 in QDBusConnectionPrivate::handleMessage (this=0x93e36d0, amsg=...) at qdbusintegrator.cpp:541
#20 0x006286c5 in qDBusSignalFilter (connection=0x93e6bd8, message=0x9523970, data=0x93e36d0) at qdbusintegrator.cpp:530
#21 0x006e4f03 in dbus_connection_dispatch (connection=0x93e6bd8) at dbus-connection.c:4650
#22 0x0061bd6b in q_dbus_connection_dispatch (this=0x93e36d0) at qdbus_symbols_p.h:115
#23 QDBusConnectionPrivate::doDispatch (this=0x93e36d0) at qdbusintegrator.cpp:1094
#24 0x0061ed0d in QDBusConnectionPrivate::socketRead (this=0x93e36d0, fd=5) at qdbusintegrator.cpp:1114
#25 0x006634df in QDBusConnectionPrivate::qt_metacall (this=0x93e36d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0xbfe3e918) at .moc/release-shared/moc_qdbusconnection_p.cpp:99
#26 0x0332dbeb in QMetaObject::metacall (object=0x93e36d0, cl=QMetaObject::InvokeMetaMethod, idx=8, argv=0xbfe3e918) at kernel/qmetaobject.cpp:237
#27 0x0333d0c7 in QMetaObject::activate (sender=0x9437428, m=0x3463a70, local_signal_index=0, argv=0xbfe3e918) at kernel/qobject.cpp:3272
#28 0x0338b6a4 in QSocketNotifier::activated (this=0x9437428, _t1=5) at .moc/release-shared/moc_qsocketnotifier.cpp:89
#29 0x033438cf in QSocketNotifier::event (this=0x9437428, e=0xbfe3eda4) at kernel/qsocketnotifier.cpp:317
#30 0x03ece26c in QApplicationPrivate::notify_helper (this=0x93eb978, receiver=0x9437428, e=0xbfe3eda4) at kernel/qapplication.cpp:4445
#31 0x03ed2ed2 in QApplication::notify (this=0xbfe3f0d0, receiver=0x9437428, e=0xbfe3eda4) at kernel/qapplication.cpp:3845
#32 0x04a16f7b in KApplication::notify (this=0xbfe3f0d0, receiver=0x9437428, event=0xbfe3eda4) at /usr/src/debug/kdelibs-4.5.5/kdeui/kernel/kapplication.cpp:310
#33 0x033273b3 in QCoreApplication::notifyInternal (this=0xbfe3f0d0, receiver=0x9437428, event=0xbfe3eda4) at kernel/qcoreapplication.cpp:732
#34 0x03354a2f in sendEvent (source=0x93eeb00) at kernel/qcoreapplication.h:215
#35 socketNotifierSourceDispatch (source=0x93eeb00) at kernel/qeventdispatcher_glib.cpp:110
#36 0x00183192 in g_main_dispatch (context=0x93edcf8) at gmain.c:2149
#37 g_main_context_dispatch (context=0x93edcf8) at gmain.c:2702
#38 0x00183978 in g_main_context_iterate (context=0x93edcf8, block=1, dispatch=1, self=<value optimized out>) at gmain.c:2780
#39 0x00183c35 in g_main_context_iteration (context=0x93edcf8, may_block=1) at gmain.c:2843
#40 0x033550ad in QEventDispatcherGlib::processEvents (this=0x93eb938, flags=...) at kernel/qeventdispatcher_glib.cpp:415
#41 0x03f81406 in QGuiEventDispatcherGlib::processEvents (this=0x93eb938, flags=...) at kernel/qguieventdispatcher_glib.cpp:207
#42 0x0332654a in QEventLoop::processEvents (this=0xbfe3f024, flags=...) at kernel/qeventloop.cpp:149
#43 0x033267fa in QEventLoop::exec (this=0xbfe3f024, flags=...) at kernel/qeventloop.cpp:201
#44 0x0332b3a7 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#45 0x03ecc078 in QApplication::exec () at kernel/qapplication.cpp:3719
#46 0x00469efb in kdemain (argc=1, argv=0xbfe3f2f4) at /usr/src/debug/kdelibs-4.5.5/kded/kded.cpp:894
#47 0x080486cc in main (argc=1, argv=0xbfe3f2f4) at /usr/src/debug/kdelibs-4.5.5/i686-redhat-linux-gnu/kded/kded4_dummy.cpp:3

Reported using DrKonqi
Comment 1 Dario Andres 2011-03-13 14:23:35 UTC
[Comment from a bug triager]
This could be related to the crashes on bug 222630.
Regards
Comment 2 Harald Sitter 2011-03-13 15:56:54 UTC
We only call snd_device_name_hint(-1, "pcm", &hints), which is perfectly valid (with hints being a void**).

So I would say this is an issue in libasound rather than Phonon. In particular either a malloc for the list in which the segfault appears failed or there is a bug in the list building in general (could be related to buggy asoundrc I suppose). FWIW the snd_config_iterator_next function only returns node->next(), so I suppose only a limited number of things could cause the issue.

Anyhow. Please report this crash to the ALSA people as we can do little about it from within Phonon. Thanks :)
Comment 3 Chris Maple 2011-03-13 20:23:34 UTC
This problem has not repeated in about 20 startups. I'm not knowledgeable
enough that my opinion should influence you, but I'm inclined to believe
this was a hardware glitch or some other one time event, rather than a kde
bug.
Comment 4 Harald Sitter 2011-03-14 00:16:00 UTC
Well, a hardware glitch still shouldn't make things crash (unless it is a glitch in the memory itself, which would be rather scary actually :)). But if you cannot reproduce it anymore, let's just leave it at that. As I did not see any obvious problems with the actual list building in the latest alsa-lib it would be terribly difficult to debug without reproducibility anyway.

Thanks for the report though. :)
Comment 5 Harald Sitter 2011-04-16 10:54:57 UTC
*** Bug 265159 has been marked as a duplicate of this bug. ***
Comment 6 Harald Sitter 2011-04-16 10:55:15 UTC
*** Bug 271040 has been marked as a duplicate of this bug. ***
Comment 7 Myriam Schweingruber 2011-08-13 12:39:31 UTC
*** Bug 228840 has been marked as a duplicate of this bug. ***
Comment 8 Myriam Schweingruber 2011-08-13 12:40:48 UTC
*** Bug 269839 has been marked as a duplicate of this bug. ***
Comment 9 Myriam Schweingruber 2011-08-13 12:44:58 UTC
*** Bug 255489 has been marked as a duplicate of this bug. ***
Comment 10 Myriam Schweingruber 2011-08-13 12:47:07 UTC
*** Bug 272428 has been marked as a duplicate of this bug. ***
Comment 11 Myriam Schweingruber 2011-08-13 12:47:27 UTC
*** Bug 273031 has been marked as a duplicate of this bug. ***
Comment 12 Sami Nieminen 2011-08-19 14:49:02 UTC
Created attachment 62980 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.7.00 (4.7.0) using Qt 4.7.2

- What I was doing when the application crashed:

I was opening the Phonon Audio Setup from Mixer menu.

-- Backtrace (Reduced):
#9  0x03bb4b02 in snd_device_name_hint () from /usr/lib/libasound.so.2
#10 0x038015e7 in PhononServer::findVirtualDevices (this=0x9163ee8) at ../../../phonon/kded-module/phononserver.cpp:168
#11 0x03805419 in PhononServer::findDevices (this=0x9163ee8) at ../../../phonon/kded-module/phononserver.cpp:677
#12 0x03809b13 in PhononServer::PhononServer (this=0x9163ee8, parent=0x8f4e238) at ../../../phonon/kded-module/phononserver.cpp:64
#13 0x0380f938 in KPluginFactory::createInstance<PhononServer, QObject> (parentWidget=0x0, parent=0x8f4e238, args=...) at /usr/include/KDE/../kpluginfactory.h:477
Comment 13 Christoph Feck 2011-10-25 09:07:06 UTC
*** Bug 284836 has been marked as a duplicate of this bug. ***
Comment 14 Christoph Feck 2012-01-23 22:20:59 UTC
*** Bug 292294 has been marked as a duplicate of this bug. ***
Comment 15 Christoph Feck 2012-01-23 22:21:34 UTC
*** Bug 292297 has been marked as a duplicate of this bug. ***
Comment 16 Christoph Feck 2012-01-29 19:53:45 UTC
*** Bug 292817 has been marked as a duplicate of this bug. ***
Comment 17 Christoph Feck 2012-02-10 17:09:42 UTC
*** Bug 293714 has been marked as a duplicate of this bug. ***
Comment 18 Christoph Feck 2012-04-16 21:58:45 UTC
*** Bug 298251 has been marked as a duplicate of this bug. ***
Comment 19 Christoph Feck 2012-04-23 19:40:35 UTC
*** Bug 298678 has been marked as a duplicate of this bug. ***
Comment 20 Myriam Schweingruber 2012-04-24 22:09:17 UTC
*** Bug 298761 has been marked as a duplicate of this bug. ***
Comment 21 Jekyll Wu 2012-05-27 16:05:39 UTC
*** Bug 300713 has been marked as a duplicate of this bug. ***
Comment 22 Jekyll Wu 2012-06-03 22:46:45 UTC
*** Bug 301124 has been marked as a duplicate of this bug. ***
Comment 23 Webos 64 2012-06-04 21:22:37 UTC
Created attachment 71587 [details]
New crash information added by DrKonqi

knotify4 (4.0) on KDE Platform 4.8.3 (4.8.3) using Qt 4.8.1

- What I was doing when the application crashed:
I was started Ubuntu with this desktop (KDE[I don't shout if are thinking that]) and open the Window KNotify crash (Warning: I did the same for bug 301124 and I had said in the commentary to the bottom of the same bug)

-- Backtrace (Reduced):
#8  0xb1637703 in strcpy (__src=0x0, __dest=0x9450f80 "pcm.(null)") at /usr/include/i386-linux-gnu/bits/string3.h:105
#9  try_config (list=0xbfef7b1c, base=0xb1836962 "pcm", name=0x0) at namehint.c:241
#10 0xb1638a27 in add_software_devices (list=0xbfef7b1c) at namehint.c:512
#11 snd_device_name_hint (card=-1, iface=<optimized out>, hints=0xbfef7c1c) at namehint.c:587
#12 0xb18349bb in GetDevices (obj=0x93c3930, item=0x9447260, prefs_dev=<optimized out>) at alsa.c:721
Comment 24 Webos 64 2012-06-04 21:27:28 UTC
(In reply to comment #23)
This is on Ubuntu 12.04 LTS
help me please because this error has me more than enough
this start on startup & I always use this desktop :(
Comment 25 Myriam Schweingruber 2012-06-24 13:44:11 UTC
(In reply to comment #24)
> (In reply to comment #23)
> This is on Ubuntu 12.04 LTS
> help me please because this error has me more than enough
> this start on startup & I always use this desktop :(

Please ask on http://forum.kde.org, you probably have a configuration problem. This is a bug tracker, not a support forum.
Comment 26 Webos 64 2012-06-24 16:06:54 UTC
(In reply to comment #25)
hey!
for my: a bug tracker is: you repport a bug, you got support with respect of this bug to fix the problem.
settings, software, etc.
I think what all trolling me here
but fuck you! KDE stink!
Comment 27 robert 2012-07-27 02:45:19 UTC
Created attachment 72777 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.8.4 (4.8.4) using Qt 4.8.2

- What I was doing when the application crashed:im using fedora 16 i was in a terminal trying to fix the sound with pulseaudio -k and i was also usinf a wind ow labeled playback devices testing the soundsystem

- Unusual behavior I noticed:
slinux avc deniels sound system not working in my account but working in evryone elses 
damn there should be more security/error tolerance on the sound system 
something like a way to patch all the files unique to a users account if it malfunctions

-- Backtrace (Reduced):
#7  0xad77a7f4 in snd_config_iterator_next (iterator=0x44482f73) at conf.c:3885
#8  0xad7871f8 in add_software_devices (list=0xbfcb96fc) at namehint.c:506
#9  snd_device_name_hint (card=-1, iface=<optimized out>, hints=0xbfcb9938) at namehint.c:587
[...]
#13 0xad8765fb in QObject* KPluginFactory::createInstance<PhononServer, QObject>(QWidget*, QObject*, QList<QVariant> const&) () from /usr/lib/kde4/kded_phononserver.so
#14 0xb6324c60 in KPluginFactory::create (this=0x8cca210, iface=0xb637dfe0 "KDEDModule", parentWidget=0x0, parent=0x8a972c0, args=..., keyword=...) at /usr/src/debug/kdelibs-4.8.4/kdecore/util/kpluginfactory.cpp:203
Comment 28 robert 2012-07-27 02:51:14 UTC
this annoying i treed to report this bug using the application and it not here
Comment 29 Webos 64 2012-07-27 15:04:46 UTC
(In reply to comment #28)
Fedora Verne:
Installed on your PC/Portable
or Live USB

/ : or

relax
when I used to KDE on ubuntu (now I Use Fedora 17 GNOME[I Will install KDE-Standard]) my crashes don't search the same corresponding bug and i put at the first bug what is appear
:D
but don't wait solution of this bug because...
see the comment #25
trust me
trust on my experience
find the solution on other side
only find the problem not the backtrace
you aren't the only
probably other people have the same trouble
you will find the solution of your bug and you can fix it
trust me
Comment 30 darkfish 2012-08-01 08:24:47 UTC
Created attachment 72868 [details]
New crash information added by DrKonqi

knotify4 (4.0) on KDE Platform 4.8.4 (4.8.4) using Qt 4.8.1

- What I was doing when the application crashed:

This happens every time I log into KDE. Probably when something is trying to notify. Dropbox, Phonon, or some other net related service.

-- Backtrace (Reduced):
#10 0xb1837500 in sprintf (__fmt=0xb18c5558 "%s.%s", __s=0x86fa390 "pcm.pT\372\265l") at /usr/include/i386-linux-gnu/bits/stdio2.h:34
#11 try_config (list=0xbfdbad6c, base=0xb1a73962 "pcm", name=0x2e2265 <Address 0x2e2265 out of bounds>) at namehint.c:229
#12 0xb1838a27 in add_software_devices (list=0xbfdbad6c) at namehint.c:512
#13 snd_device_name_hint (card=-1, iface=<optimized out>, hints=0xbfdbae6c) at namehint.c:587
#14 0xb1a719bb in GetDevices (obj=0x8679d00, item=0x86f1700, prefs_dev=<optimized out>) at alsa.c:721
Comment 31 Harald Sitter 2012-08-27 10:03:45 UTC
*** Bug 305800 has been marked as a duplicate of this bug. ***
Comment 32 Jekyll Wu 2012-09-20 09:21:47 UTC
*** Bug 307091 has been marked as a duplicate of this bug. ***
Comment 33 Christoph Feck 2012-10-21 21:14:40 UTC
*** Bug 308766 has been marked as a duplicate of this bug. ***
Comment 34 Nicos Gollan 2012-11-05 08:23:06 UTC
Created attachment 75019 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.8.4 (4.8.4) using Qt 4.8.2

- What I was doing when the application crashed:

Starting a KDE session directly after a reboot.

-- Backtrace (Reduced):
#6  __strcpy_chk () at ../sysdeps/x86_64/strcpy_chk.S:71
[...]
#8  0x00007fe0f33c9a7d in snd_device_name_hint () from /usr/lib/x86_64-linux-gnu/libasound.so.2
[...]
#13 0x00007fe119460b55 in KPluginFactory::create (this=0x1fbd280, iface=0x7fe1194b76c0 "KDEDModule", parentWidget=0x0, parent=0x1d35f20, args=..., keyword=...) at ../../kdecore/util/kpluginfactory.cpp:203
#14 0x00007fe1052cc367 in create<KDEDModule> (args=..., parent=0x1d35f20, this=<optimized out>) at ../../kdecore/util/kpluginfactory.h:507
#15 Kded::loadModule (this=this@entry=0x1d35f20, s=..., onDemand=onDemand@entry=true) at ../../kded/kded.cpp:409
Comment 35 William A. 2012-11-10 18:26:09 UTC
Created attachment 75160 [details]
New crash information added by DrKonqi

knotify4 (4.0) on KDE Platform 4.8.4 (4.8.4) using Qt 4.8.2

- What I was doing when the application crashed:

- Custom settings of the application:

changing the window manager Kwin to Openbox causes Knotifiy to crash

-- Backtrace (Reduced):
#7  0xb5e947a4 in _IO_vfprintf_internal (s=0xbfcf0f80, format=0xb18c4ed8 "%s.%s", ap=0xbfcf1060 "\242L\251\261\002") at vfprintf.c:1623
#8  0xb5f36597 in ___vsprintf_chk (s=0x97e9848 "pcm.\360\323\372\265s", flags=1, slen=128, format=0xb18c4ed8 "%s.%s", args=0xbfcf1060 "\242L\251\261\002") at vsprintf_chk.c:87
#9  0xb5f364dd in ___sprintf_chk (s=0x97e9848 "pcm.\360\323\372\265s", flags=1, slen=128, format=0xb18c4ed8 "%s.%s") at sprintf_chk.c:33
[...]
#11 0xb1838cc8 in snd_device_name_hint () from /usr/lib/i386-linux-gnu/libasound.so.2
[...]
#14 0xb1a5fcbe in libvlc_audio_output_device_count () from /usr/lib/libvlc.so.5
Comment 36 Maarten De Meyer 2012-11-27 13:00:53 UTC
*** Bug 310750 has been marked as a duplicate of this bug. ***
Comment 37 Christoph Feck 2012-12-06 14:49:42 UTC
*** Bug 311248 has been marked as a duplicate of this bug. ***
Comment 38 Jekyll Wu 2013-01-03 21:22:28 UTC
*** Bug 312565 has been marked as a duplicate of this bug. ***
Comment 39 Christoph Feck 2013-01-15 22:24:26 UTC
*** Bug 313232 has been marked as a duplicate of this bug. ***
Comment 40 Martin Sandsmark 2013-01-20 23:40:16 UTC
this should fix it, would be nice if anyone could test it:

diff --git a/src/control/namehint.c b/src/control/namehint.c
index 19352be..089c67a 100644
--- a/src/control/namehint.c
+++ b/src/control/namehint.c
@@ -545,7 +545,7 @@ static int add_software_devices(struct hint_list *list)
 int snd_device_name_hint(int card, const char *iface, void ***hints)
 {
 	struct hint_list list;
-	char ehints[24];
+	char ehints[512];
 	const char *str;
 	snd_config_t *conf;
 	snd_config_iterator_t i, next;
@@ -600,7 +600,7 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
 				goto __error;
 		}
 	}
-	sprintf(ehints, "namehint.%s", list.siface);
+	snprintf(ehints, "namehint.%s", sizeof(ehints), list.siface);
 	err = snd_config_search(snd_config, ehints, &conf);
 	if (err >= 0) {
 		snd_config_for_each(i, next, conf) {
Comment 41 Colin Guthrie 2013-01-27 13:45:44 UTC
While I'm not 100% sure if it is causing the problem, I know Ubuntu (where at least a few of the traces here are generated on) uses a kind of dynamic adjustment of the alsa config when PA is running.

I'd recommend disabling this automatic stuff in the alsa config and defaulting to a static PulseAudio config (e.g. http://git.alsa-project.org/?p=alsa-plugins.git;a=blob;f=pulse/99-pulseaudio-default.conf.example;h=4f5885806898a76f5a5c9b3ec76b804fe54e2480;hb=HEAD) and seeing if you can reproduce this issue.

If that's the case then I would probably recommend that a bug be opened against Ubuntu and propose to remove this automatic config stuff (I've always thought this was a bad approach as it papers over sound bugs by giving the user a half-working system when an essential component fails, masking where the real error is - it's better to fail and fail hard (with good error messages) when this component fails, not fallback to some totally alternative way of working.
Comment 42 denis 2013-01-27 20:55:33 UTC
Colin, thanks a lot!! I'll  try to usr your recommendations.

2013/1/27 Colin Guthrie <colin@mageia.org>:
> https://bugs.kde.org/show_bug.cgi?id=268185
>
> Colin Guthrie <colin@mageia.org> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |colin@mageia.org
>
> --- Comment #41 from Colin Guthrie <colin@mageia.org> ---
> While I'm not 100% sure if it is causing the problem, I know Ubuntu (where at
> least a few of the traces here are generated on) uses a kind of dynamic
> adjustment of the alsa config when PA is running.
>
> I'd recommend disabling this automatic stuff in the alsa config and defaulting
> to a static PulseAudio config (e.g.
> http://git.alsa-project.org/?p=alsa-plugins.git;a=blob;f=pulse/99-pulseaudio-default.conf.example;h=4f5885806898a76f5a5c9b3ec76b804fe54e2480;hb=HEAD)
> and seeing if you can reproduce this issue.
>
> If that's the case then I would probably recommend that a bug be opened against
> Ubuntu and propose to remove this automatic config stuff (I've always thought
> this was a bad approach as it papers over sound bugs by giving the user a
> half-working system when an essential component fails, masking where the real
> error is - it's better to fail and fail hard (with good error messages) when
> this component fails, not fallback to some totally alternative way of working.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 43 Christoph Feck 2013-01-29 22:02:22 UTC
*** Bug 314102 has been marked as a duplicate of this bug. ***
Comment 44 Colin Guthrie 2013-01-30 12:54:09 UTC
Additional to my last quote.

If you would like to remove the dynamic config adjustment that happens in Ubuntu:
 mv /usr/share/alsa/alsa.conf.d/pulse.conf /usr/share/alsa/alsa.conf.d/pulse.conf.disabled
 ln -s ../pulse-alsa.conf /usr/share/alsa/alsa.conf.d/zz-pulse-alsa.conf

And to revert back:
 mv /usr/share/alsa/alsa.conf.d/pulse.conf.disabled /usr/share/alsa/alsa.conf.d/pulse.conf
 rm -f /usr/share/alsa/alsa.conf.d/zz-pulse-alsa.conf

If you can (semi) reliably reproduce the original crash with a default setup, but cannot with the modified setup as above, it would point at the config hook as something that generally messes with the alsa config a bit too much...

If not then it's likely not to blame.
Comment 45 Christoph Feck 2013-01-31 13:19:13 UTC
*** Bug 314180 has been marked as a duplicate of this bug. ***
Comment 46 Harald Sitter 2013-01-31 22:43:23 UTC
This was fixed in alsa-lib git master in f49b2dc522a2564315c76d075203b15a39941e8a (and previous 3 commits). The function in question was not reentrant before, leading to bogus behavior in combination with certain pulseaudio integration configs [1].

I can confirm that this at least fixes the segfaults from strcpy and sprintf, which seem to be the most common symptom.

[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2013-January/059168.html
Comment 47 Jekyll Wu 2013-02-07 17:46:44 UTC
*** Bug 314584 has been marked as a duplicate of this bug. ***
Comment 48 Jekyll Wu 2013-02-20 03:02:08 UTC
*** Bug 315486 has been marked as a duplicate of this bug. ***
Comment 49 Jekyll Wu 2013-02-23 04:09:19 UTC
*** Bug 315663 has been marked as a duplicate of this bug. ***
Comment 50 Jekyll Wu 2013-02-26 01:03:30 UTC
*** Bug 315782 has been marked as a duplicate of this bug. ***
Comment 51 devsk 2013-03-04 00:50:46 UTC
Can someone please confirm which version of alsa-lib was the above change released in?
Comment 52 Jekyll Wu 2013-03-10 16:20:05 UTC
*** Bug 316471 has been marked as a duplicate of this bug. ***
Comment 53 Christoph Feck 2013-04-25 18:42:03 UTC
*** Bug 318866 has been marked as a duplicate of this bug. ***
Comment 54 Jekyll Wu 2013-05-02 12:42:49 UTC
*** Bug 319141 has been marked as a duplicate of this bug. ***
Comment 55 Myriam Schweingruber 2013-05-14 08:06:44 UTC
*** Bug 319805 has been marked as a duplicate of this bug. ***
Comment 56 Myriam Schweingruber 2013-06-07 10:09:46 UTC
*** Bug 320854 has been marked as a duplicate of this bug. ***
Comment 57 Harald Sitter 2013-07-03 22:53:17 UTC
*** Bug 319797 has been marked as a duplicate of this bug. ***
Comment 58 Christoph Feck 2013-07-16 01:37:28 UTC
*** Bug 322417 has been marked as a duplicate of this bug. ***
Comment 59 Christoph Feck 2013-07-20 12:53:08 UTC
*** Bug 319266 has been marked as a duplicate of this bug. ***
Comment 60 Harald Sitter 2013-07-25 12:43:24 UTC
*** Bug 322811 has been marked as a duplicate of this bug. ***
Comment 61 Harald Sitter 2013-07-25 12:46:42 UTC
(In reply to comment #51)
> Can someone please confirm which version of alsa-lib was the above change
> released in?

1.0.27
http://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=812e4b0c5ba74fecb6e086cadeb10e19df0e1e88
Comment 62 Jekyll Wu 2013-08-29 01:15:40 UTC
*** Bug 324175 has been marked as a duplicate of this bug. ***
Comment 63 Harald Sitter 2013-11-10 23:15:32 UTC
*** Bug 327378 has been marked as a duplicate of this bug. ***
Comment 64 Martin von Gagern 2013-11-11 00:45:34 UTC
(In reply to comment #63)
> *** Bug 327378 has been marked as a duplicate of this bug. ***

So this is apparently NOT fixed in alsa-lib 1.0.27.1. At least not completely. Are you still certain that what remains broken after the commit mentioned in comment 61 is still not a bug inside KDE? Just asking, I don't know one way or the other.
Comment 65 Harald Sitter 2013-11-11 00:54:07 UTC
I'd not exclude the option of broken asoundrc, for what it's worth ;). 

But yes, I am reasonable certain that there is no problem with how the kded module uses alsa, so whatever remains is an upstream issue. Best talk to the alsa guys, but unless it's reproducible these kinds of crashes are insanely hard to get a hold of.
Comment 66 Jekyll Wu 2014-01-01 00:38:16 UTC
*** Bug 329474 has been marked as a duplicate of this bug. ***
Comment 67 Christoph Feck 2014-06-15 14:56:48 UTC
*** Bug 336265 has been marked as a duplicate of this bug. ***