Bug 306338 - konsole freezes when i select text
Summary: konsole freezes when i select text
Status: ASSIGNED
Alias: None
Product: kmix
Classification: Unclassified
Component: Backend: Pulseaudio (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR critical with 105 votes (vote)
Target Milestone: ---
Assignee: Colin Guthrie
URL:
Keywords:
: 312053 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-06 12:20 UTC by kde
Modified: 2016-07-07 09:06 UTC (History)
26 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Freeze backtrace (5.69 KB, text/plain)
2012-09-06 19:58 UTC, kde
Details
yum log since the bug (24.88 KB, text/plain)
2012-11-11 20:17 UTC, Liviu Vasut
Details
Backtrace (6.05 KB, text/plain)
2012-11-13 16:48 UTC, Sandro Mani
Details
konsole DBus hang backtrace (4.95 KB, text/plain)
2014-01-08 20:45 UTC, Mihai DONȚU
Details
hanged kded4 backtrace (4.16 KB, text/plain)
2014-01-09 01:04 UTC, Mihai DONȚU
Details
kded backtrace with more symbols in kmix (4.82 KB, text/plain)
2014-01-09 03:03 UTC, Mihai DONȚU
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kde 2012-09-06 12:20:11 UTC
When I try to select text in konsole it freezes and has to be killed. The white selection highlighting box won't even show up.

If I can do anything to help debug this, please tell me.

Thank you

Reproducible: Always

Steps to Reproduce:
1. open konsole
2. try to select any text (even the prompt)
3. total freeze
Comment 1 Jekyll Wu 2012-09-06 12:53:01 UTC
Interesting. 

I notice you are using Gentoo (me too). There is a similar report at https://bugs.gentoo.org/show_bug.cgi?id=430286 . 

The first thing to check is whether this also happens konsole-2.8.x (that should be a easy task when you use Gentoo).  If not, it is quite likely to be related with the new feature of supporting KDE webshotcuts( http://reviewboard.kde.org/r/104493)

To check where the freeze happens, run "gdb -p <pid-of-konsole>" in another emulator(xterm) when konsole hangs, and see what "bt" command shows.
Comment 2 kde 2012-09-06 19:56:45 UTC
That gentoo bugreport seems exactly the same beast. 
Downgrading konsole fixes the problem, but I guess that is not real solution :)

I attach the requested backtrace.

Thank you
Comment 3 kde 2012-09-06 19:58:21 UTC
Created attachment 73711 [details]
Freeze backtrace
Comment 4 Thomas Bettler 2012-09-10 06:30:40 UTC
Same behaviour here with konsole-2.9.1 on gentoo.
Comment 5 Jekyll Wu 2012-09-12 08:20:26 UTC
So far all reporters are using Gentoo. I have been using Gentoo in the recent months after adding that feature, but I have never encountered that problem.

Looking at the backtrace, konsole is stuck with a dbus call which is triggered by some basic KDE libraries. My guess is the favicons kded module is not working correctly and does not reply that dbus call as expected. 

As I have mentioned in https://git.reviewboard.kde.org/r/104493/, the code for the webshortcut suporrt in konsole is basically the same as those in okular and konversation. The only difference might be that konsole tyies to update the context menu immediately after selecting any text, while other applications (meybe) update the context menu only when the context menu is to be shown.

So to check whether the problem is in konsole itself or not,  please select some text in konversation/okular/konqueror then try to show its context menu.  If konversation/okular/konqueror also hang after that, then the real problem is the favicons kded module is not working as expected.
Comment 6 kde 2012-09-14 21:29:24 UTC
For some reason I cannot reproduce the bug anymore :( I will check back if it returns.
Comment 7 Alexei Romanoff 2012-09-26 20:13:46 UTC
This bug annoys me too, but reproducibility is rather unstable.  My system is latest archlinux, konsole versionis 2.9.1.
Comment 8 xpj 2012-10-02 08:01:08 UTC
Same for Fedora 17, konsole 4.9.1-2.

Selection works, when the scrollback buffer is empty, when it scrolls (after eg. long `ls` list), konsole freezes after trying to select some text.
Comment 9 Christoph Feck 2012-10-06 13:15:44 UTC
According to bug 307973, it is caused by a kded module blocking the dbus call. Please try to find which kded module is responsible. For instructions, see http://kdepepo.wordpress.com/2011/05/11/troubleshooting-kded4-bugs/
Comment 10 Christoph Feck 2012-10-06 13:16:41 UTC
(of course you should not disable the favicon module, because this is actually the call that gets blocked, not causing the block)
Comment 11 Martin von Gagern 2012-10-06 21:55:49 UTC
(In reply to comment #9)
> According to bug 307973, it is caused by a kded module blocking the dbus
> call. Please try to find which kded module is responsible.

Difficult, but please read https://bugs.gentoo.org/show_bug.cgi?id=430286#c9 and later for the progress I've made with this so far. Perhaps this is of any use to you.
Comment 12 Jaime Torres 2012-10-07 06:58:36 UTC
It blocks the global dbus, not only the session dbus. My two sessions were blocked.
The problem has reproduced here again, not as I expected, but in any case: I know the (or one of the) kded4 module(s) that freezes all. 
A semaphore in libasound, used by phononServer. 

#0 0x00007f22addb4c77 in semop () from /lib64/libc.so.6 
#1 0x00007f2290821840 in snd_pcm_dsnoop_open () from /usr/lib64/libasound.so.2 
#2 0x00007f22908220d3 in _snd_pcm_dsnoop_open () from /usr/lib64/libasound.so.2 
#3 0x00007f22907e80ba in ?? () from /usr/lib64/libasound.so.2 
#4 0x00007f22907e8648 in ?? () from /usr/lib64/libasound.so.2 
#5 0x00007f22907ea632 in ?? () from /usr/lib64/libasound.so.2 
#6 0x00007f2290809ed1 in _snd_pcm_plug_open () from /usr/lib64/libasound.so.2 
#7 0x00007f22907e80ba in ?? () from /usr/lib64/libasound.so.2 
#8 0x00007f22907ea679 in ?? () from /usr/lib64/libasound.so.2 
#9 0x00007f2290825956 in _snd_pcm_asym_open () from /usr/lib64/libasound.so.2 
#10 0x00007f22907e80ba in ?? () from /usr/lib64/libasound.so.2 
#11 0x00007f22907ea679 in ?? () from /usr/lib64/libasound.so.2 
#12 0x00007f2290810292 in _snd_pcm_empty_open () from /usr/lib64/libasound.so.2 
#13 0x00007f22907e80ba in ?? () from /usr/lib64/libasound.so.2 
#14 0x00007f22907e8648 in ?? () from /usr/lib64/libasound.so.2 
#15 0x00007f228ed7f526 in PhononServer::findVirtualDevices (this=this@entry=0x7f2294cdddd0) at /g/kdegit/kde-runtime/phonon/kded-module/phononserver.cpp:252 
#16 0x00007f228ed82cdb in PhononServer::findDevices (this=this@entry=0x7f2294cdddd0) at /g/kdegit/kde-runtime/phonon/kded-module/phononserver.cpp:673
Comment 13 Christoph Feck 2012-10-25 23:32:52 UTC
Can anyone else confirm that disabling the phononserver kded module avoids the freeze?

Since this is an autostart service, to disable it, you have to remove it from /local/kde4/share/kde4/services/kded/ and restart kded4.
Comment 14 Liviu Vasut 2012-10-30 20:45:17 UTC
Same problem on Konsole 2.9., Kde 4.9.2, Fedora 17.

I can confirm that disabling the phononserver kded module avoids the freeze.

On Fedora 17:
# mv /usr/share/kde4/services/kded/phononserver.desktop ~/
Restarted kded4 and the problem disappeared.
Comment 15 Christoph Feck 2012-10-30 21:01:31 UTC
Thanks for the update, reassigning to Phonon developers.
Comment 16 Martin Sandsmark 2012-11-09 00:16:42 UTC
can we get a stacktrace with debugging symbols?
Comment 17 Liviu Vasut 2012-11-11 14:41:23 UTC
The problem is solved on my system (Fedora 17).

Last relevant updates:
Oct 13 15:32:44 Updated: konsole-part-4.9.2-2.fc17.i686
Oct 13 15:51:14 Updated: konsole-4.9.2-2.fc17.i686

Phonon did not had any updates since my last post.
Comment 18 Kevin Kofler 2012-11-11 17:50:01 UTC
That update cannot possibly fix this bug. All it does is removing the line setting the default startup directory in konsole.desktop (because [$e] doesn't work in non-KDE workspace environments; we also changed kdelibs to make $HOME the default again).
Comment 19 Liviu Vasut 2012-11-11 20:17:19 UTC
Created attachment 75180 [details]
yum log since the bug

Well, if those two updates didn't do it, it must have been some other update, because the file /usr/share/kde4/services/kded/phononserver.desktop is there. I have attached my yum.log since 2012-10-30 (when the bug was still present) until today, should it be of some use.
Comment 20 Kevin Kofler 2012-11-11 21:36:57 UTC
I think the bug is simply not 100% reproducible.
Comment 21 Sandro Mani 2012-11-13 10:42:44 UTC
I am on fedora rawide, kde 4.9.3. I see this issue despite having disabled the phononserver. Will try to debug further....
Comment 22 Sandro Mani 2012-11-13 16:48:27 UTC
Created attachment 75221 [details]
Backtrace

My observations so far:
Some possibly relevant background: The affected computer is behind a ntlm proxy in the office. I have installed cntlm to get through that ugly beast, but for some reason reason (probably service trying to start before network is up), the service does not successfully start on boot, and I always have to manually restart it when I log in. This is relevant for the following observations:
- if I log into kde without cntlm enabled, I konsole freezes when selection, plus many other applications (dolphin, rekonq, kfiledialog to name a few) take awfully long to start. Plus, logout does not work.
- if I do init 3 followed by init 5 to restart the session, in the subsequent login everything works fine
- if I start cntlm from a vritual terminal before logging into kde, everything works fine
The proxy is configured for all protocols in the respective kde control module.

Additionally, I've collected another stacktrace, which shows that the hanging dbus call is for service=org.kde.kded, path=/modules, interface=org.kde.FavIcon - see attachment.
Comment 23 Christoph Feck 2012-11-13 21:46:29 UTC
Sandro, we already know that that the FavIcon retrieval call is blocked, but we need to know which kded4 module is responsible for the blocking. For some reporters, the phononserver module was the culprit, if it is a different module on your system, please check which one it is and add the information here, or report a new bug with the findings.
Comment 24 Harald Sitter 2012-11-14 04:21:15 UTC
On a general note..... the phononserver module ought to only be active when pulseaudio is not used so that should have limited scope by default. If it is active even when using pulseaudio that is a bug and should be reported separately.
Comment 25 Ole Langbehn 2012-11-14 11:05:51 UTC
JFYI: after an upgrade to 4.9.3, this issue disappeared on my box (and another gentoo box, see associated gentoo bug)
Comment 26 Jaime Torres 2012-11-17 10:39:04 UTC
Finally the block happened again, this time with debug simbols for libasound.

#0  0x00007f1a1e9d5967 in semop () from /lib64/libc.so.6
#1  0x00007f1a05438250 in snd_pcm_dsnoop_open () from /usr/lib64/libasound.so.2
#2  0x00007f1a05438ae3 in _snd_pcm_dsnoop_open () from /usr/lib64/libasound.so.2
#3  0x00007f1a053fd27a in ?? () from /usr/lib64/libasound.so.2
#4  0x00007f1a053fd808 in ?? () from /usr/lib64/libasound.so.2
#5  0x00007f1a053ff7f2 in ?? () from /usr/lib64/libasound.so.2
#6  0x00007f1a0543fe65 in _snd_pcm_softvol_open () from /usr/lib64/libasound.so.2
#7  0x00007f1a053fd27a in ?? () from /usr/lib64/libasound.so.2
#8  0x00007f1a053ff839 in ?? () from /usr/lib64/libasound.so.2
#9  0x00007f1a05420361 in _snd_pcm_plug_open () from /usr/lib64/libasound.so.2
#10 0x00007f1a053fd27a in ?? () from /usr/lib64/libasound.so.2
#11 0x00007f1a053ff839 in ?? () from /usr/lib64/libasound.so.2
#12 0x00007f1a0543c396 in _snd_pcm_asym_open () from /usr/lib64/libasound.so.2
#13 0x00007f1a053fd27a in ?? () from /usr/lib64/libasound.so.2
#14 0x00007f1a053ff839 in ?? () from /usr/lib64/libasound.so.2
#15 0x00007f1a05426c12 in _snd_pcm_empty_open () from /usr/lib64/libasound.so.2
#16 0x00007f1a053fd27a in ?? () from /usr/lib64/libasound.so.2
#17 0x00007f1a053fd808 in ?? () from /usr/lib64/libasound.so.2
#18 0x00007f1a041d6526 in PhononServer::findVirtualDevices (this=this@entry=0x27ae7d0) at /g/kdegit/kde-runtime/phonon/kded-module/phononserver.cpp:252
#19 0x00007f1a041d9cdb in PhononServer::findDevices (this=this@entry=0x27ae7d0) at /g/kdegit/kde-runtime/phonon/kded-module/phononserver.cpp:673
#20 0x00007f1a041da3bd in PhononServer::PhononServer (this=0x27ae7d0, parent=<optimized out>) at /g/kdegit/kde-runtime/phonon/kded-module/phononserver.cpp:67
#21 0x00007f1a041e20d5 in KPluginFactory::createInstance<PhononServer, QObject> (parentWidget=<optimized out>, parent=<optimized out>, args=...) at /opt/kde4/include/KDE/../kpluginfactory.h:477
#22 0x00007f1a2115cf68 in KPluginFactory::create (this=0x24d8a20, iface=0x7f1a211ad980 <qt_meta_stringdata_KDEDModule> "KDEDModule", parentWidget=0x0, parent=0x21916e0, args=..., keyword=...)
    at /g/kdegit/kdelibs/kdecore/util/kpluginfactory.cpp:203
#23 0x00007f1a0d6d2406 in KPluginFactory::create<KDEDModule> (this=this@entry=0x24d8a20, parent=parent@entry=0x21916e0, args=...) at /g/kdegit/kdelibs/kdecore/util/kpluginfactory.h:507
#24 0x00007f1a0d6cf710 in Kded::loadModule (this=this@entry=0x21916e0, s=..., onDemand=onDemand@entry=true) at /g/kdegit/kdelibs/kded/kded.cpp:409
#25 0x00007f1a0d6cfa34 in Kded::loadModule (this=0x21916e0, obj=..., onDemand=onDemand@entry=true) at /g/kdegit/kdelibs/kded/kded.cpp:361
#26 0x00007f1a0d6cfbc9 in Kded::messageFilter (message=...) at /g/kdegit/kdelibs/kded/kded.cpp:204
#27 0x00007f1a20ceff3f in QDBusConnectionPrivate::handleMessage (this=this@entry=0x2185dd0, amsg=...) at /g/kdegit/qt/src/dbus/qdbusintegrator.cpp:563
#28 0x00007f1a20cf2b0d in qDBusSignalFilter (connection=<optimized out>, message=0x26af960, data=0x2185dd0) at /g/kdegit/qt/src/dbus/qdbusintegrator.cpp:552
#29 0x00007f1a0fb2548e in dbus_connection_dispatch () from /lib64/libdbus-1.so.3
#30 0x00007f1a20ce5975 in q_dbus_connection_dispatch (connection=0x218e7b0) at /g/kdegit/qt/src/dbus/qdbus_symbols_p.h:115
#31 QDBusConnectionPrivate::doDispatch (this=0x2185dd0) at /g/kdegit/qt/src/dbus/qdbusintegrator.cpp:1133
#32 0x00007f1a20969bde in QObject::event (this=0x2185dd0, e=<optimized out>) at /g/kdegit/qt/src/corelib/kernel/qobject.cpp:1194
#33 0x00007f1a1f957551 in QApplicationPrivate::notify_helper (this=this@entry=0x219a750, receiver=receiver@entry=0x2185dd0, e=e@entry=0x24b6a90) at /g/kdegit/qt/src/gui/kernel/qapplication.cpp:4562
#34 0x00007f1a1f95c5f9 in QApplication::notify (this=0x7fff1cc246d0, receiver=0x2185dd0, e=0x24b6a90) at /g/kdegit/qt/src/gui/kernel/qapplication.cpp:4423
#35 0x00007f1a219ed66e in KApplication::notify (this=0x7fff1cc246d0, receiver=0x2185dd0, event=0x24b6a90) at /g/kdegit/kdelibs/kdeui/kernel/kapplication.cpp:311
#36 0x00007f1a20952e8d in QCoreApplication::notifyInternal (this=0x7fff1cc246d0, receiver=receiver@entry=0x2185dd0, event=event@entry=0x24b6a90) at /g/kdegit/qt/src/corelib/kernel/qcoreapplication.cpp:946
#37 0x00007f1a20956817 in QCoreApplication::sendEvent (event=0x24b6a90, receiver=0x2185dd0) at ../../include/QtCore/../../../../kdegit/qt/src/corelib/kernel/qcoreapplication.h:231
#38 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x210b2b0) at /g/kdegit/qt/src/corelib/kernel/qcoreapplication.cpp:1570
#39 0x00007f1a20984573 in QCoreApplication::sendPostedEvents () at ../../include/QtCore/../../../../kdegit/qt/src/corelib/kernel/qcoreapplication.h:236
#40 postEventSourceDispatch (s=0x219bcc0) at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:279
#41 0x00007f1a1af0b815 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#42 0x00007f1a1af0bb48 in ?? () from /usr/lib64/libglib-2.0.so.0
#43 0x00007f1a1af0bc04 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#44 0x00007f1a209846e4 in QEventDispatcherGlib::processEvents (this=0x21117b0, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:424
#45 0x00007f1a1fa05f46 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at /g/kdegit/qt/src/gui/kernel/qguieventdispatcher_glib.cpp:204
#46 0x00007f1a209513ef in QEventLoop::processEvents (this=this@entry=0x7fff1cc24530, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:149
#47 0x00007f1a209516a8 in QEventLoop::exec (this=0x7fff1cc24530, flags=...) at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:204
#48 0x00007f1a20956c28 in QCoreApplication::exec () at /g/kdegit/qt/src/corelib/kernel/qcoreapplication.cpp:1218
#49 0x00007f1a0d6cebdc in kdemain (argc=1, argv=0x217a120) at /g/kdegit/kdelibs/kded/kded.cpp:924
#50 0x00000000004083cb in launch (argc=argc@entry=1, _name=_name@entry=0x40c7f9 "kded4", args=args@entry=0x0, cwd=cwd@entry=0x0, envc=envc@entry=0, envs=envs@entry=0x0, reset_env=reset_env@entry=false,
    tty=tty@entry=0x0, avoid_loops=avoid_loops@entry=false, startup_id_str=startup_id_str@entry=0x40c559 "0") at /g/kdegit/kdelibs/kinit/kinit.cpp:726
#51 0x0000000000405451 in main (argc=4, argv=<optimized out>, envp=0x7fff1cc24bd0) at /g/kdegit/kdelibs/kinit/kinit.cpp:1841
Comment 27 Sandro Mani 2012-11-17 13:40:39 UTC
FWIW, I've filed a new bug for my case (which shows the same symptoms, but the cause appears to be a different one), see Bug 310244
Comment 28 Harald Sitter 2012-11-17 14:15:37 UTC
(In reply to comment #26)
> Finally the block happened again, this time with debug simbols for libasound.

Does not look like it unfortunately.
Comment 29 Jekyll Wu 2012-11-17 14:32:48 UTC
(In reply to comment #26)
> Finally the block happened again, this time with debug simbols for libasound.
> 

> #1  0x00007f1a05438250 in snd_pcm_dsnoop_open () from
> /usr/lib64/libasound.so.2
> #2  0x00007f1a05438ae3 in _snd_pcm_dsnoop_open () from
> /usr/lib64/libasound.so.2

Unfortunately, it is still without debug symbols for libasound. Compare those lines with this line:

#15 0x00007f228ed7f526 in PhononServer::findVirtualDevices (this=this@entry=0x7f2294cdddd0) at /g/kdegit/kde-runtime/phonon/kded-module/phononserver.cpp:252 

you would see  what "with debug symbols" means.  You need to install libasound2-dbg or something like that (depending upon your distribution)
Comment 30 Jaime Torres 2012-11-17 19:18:35 UTC
libasound2-debuginfo is already installed. I can not get more.. I do not see any libasound2-debugsource package.

i | libasound2                 | Advanced Linux Sound Architecture Library | package
i | libasound2-32bit           | Advanced Linux Sound Architecture Library | package
i | libasound2-debuginfo       | Debug information for package libasound2  | package
i | libasound2-debuginfo-32bit | Debug information for package libasound2  | package

Are there so many mutexes in that snd_pcm_dsnoop_open () function?
Comment 31 Michael Pyne 2012-11-17 19:20:28 UTC
I'm glad that the reason SysV IPC was freezing KDE startup for me sometimes has been identified, but it is almost assuredly a deadlock in libasound given the backtraces mentioned. Even without debug symbols it might be possible to try and troubleshoot that by source review or Valgrind usage if we can get a very small testcase for the phononserver portion.
Comment 32 Kevin Kofler 2012-11-17 19:24:02 UTC
The libasound2-debuginfo package needs to match the libasound2 one exactly. The version and even the package release need to be identical (in fact they should come out of the same build process), otherwise the debugging information will be mismatched and thus get ignored.
Comment 33 Jaime Torres 2012-11-17 22:40:47 UTC
I'll check again if they get uptdated to the same version.. and wait for another lock.
The "good news" are than once this bug happens, I can reproduce it with my too sessions, just killing -9 one kded4, starting it again, and selecting text. It happens until I reboot (probably doing an init 3 and init 5 is enouthg).
Comment 34 Jaime Torres 2012-11-18 11:37:04 UTC
This time was fast.... (just when I inserted a data dvd)
(gdb) where
#0  0x00007f65f00f2967 in semop () from /lib64/libc.so.6
#1  0x00007f65d396b840 in snd_pcm_direct_semaphore_down (dmix=<optimized out>, sem_num=<optimized out>)
    at pcm_direct.h:254
#2  snd_pcm_dsnoop_open (pcmp=pcmp@entry=0x7fffda494860, name=name@entry=0x1e8cbe0 "dsnoop:SB", opts=opts@entry=
    0x7fffda494590, params=params@entry=0x7fffda4945c0, root=root@entry=0x1fb49e0, sconf=0x1e0b210, stream=stream@entry=
    SND_PCM_STREAM_CAPTURE, mode=mode@entry=1) at pcm_dsnoop.c:583
#3  0x00007f65d396c0d3 in _snd_pcm_dsnoop_open (pcmp=0x7fffda494860, name=0x1e8cbe0 "dsnoop:SB", root=0x1fb49e0, 
    conf=<optimized out>, stream=SND_PCM_STREAM_CAPTURE, mode=1) at pcm_dsnoop.c:829
#4  0x00007f65d39320ba in snd_pcm_open_conf (pcmp=pcmp@entry=0x7fffda494860, name=name@entry=0x1e8cbe0 "dsnoop:SB", 
    pcm_root=pcm_root@entry=0x1fb49e0, pcm_conf=0x1cce730, stream=stream@entry=SND_PCM_STREAM_CAPTURE, mode=mode@entry=
    1) at pcm.c:2171
#5  0x00007f65d3932648 in snd_pcm_open_noupdate (pcmp=pcmp@entry=0x7fffda494860, root=root@entry=0x1fb49e0, name=
    0x1e8cbe0 "dsnoop:SB", stream=stream@entry=SND_PCM_STREAM_CAPTURE, mode=mode@entry=1, hop=hop@entry=1) at pcm.c:2225
#6  0x00007f65d3934632 in snd1_pcm_open_named_slave (pcmp=pcmp@entry=0x7fffda494860, name=name@entry=0x0, 
    root=root@entry=0x1fb49e0, conf=0x1b7b850, stream=stream@entry=SND_PCM_STREAM_CAPTURE, mode=mode@entry=1, 
    parent_conf=parent_conf@entry=0x1e0ab40) at pcm.c:2335
#7  0x00007f65d3973425 in snd_pcm_open_slave (parent_conf=0x1e0ab40, mode=1, stream=SND_PCM_STREAM_CAPTURE, 
    conf=<optimized out>, root=0x1fb49e0, pcmp=0x7fffda494860) at pcm_local.h:864
#8  _snd_pcm_softvol_open (pcmp=0x7fffda494a80, name=0x0, root=0x1fb49e0, conf=0x1e0ab40, stream=
    SND_PCM_STREAM_CAPTURE, mode=1) at pcm_softvol.c:1083
#9  0x00007f65d39320ba in snd_pcm_open_conf (pcmp=pcmp@entry=0x7fffda494a80, name=name@entry=0x0, 
    pcm_root=pcm_root@entry=0x1fb49e0, pcm_conf=pcm_conf@entry=0x1e0ab40, stream=stream@entry=SND_PCM_STREAM_CAPTURE, 
    mode=mode@entry=1) at pcm.c:2171
#10 0x00007f65d3934679 in snd1_pcm_open_named_slave (pcmp=pcmp@entry=0x7fffda494a80, name=name@entry=0x0, 
    root=root@entry=0x1fb49e0, conf=0x1e0ab40, stream=stream@entry=SND_PCM_STREAM_CAPTURE, mode=mode@entry=1, 
    parent_conf=parent_conf@entry=0x1ff1780) at pcm.c:2337
#11 0x00007f65d3953ed1 in snd_pcm_open_slave (parent_conf=0x1ff1780, mode=1, stream=SND_PCM_STREAM_CAPTURE, 
    conf=<optimized out>, root=0x1fb49e0, pcmp=0x7fffda494a80) at pcm_local.h:864
#12 _snd_pcm_plug_open (pcmp=0x7fffda4951c8, name=0x1eee768 "sysdefault:CARD=SB", root=0x1fb49e0, conf=0x1ff1780, 
    stream=SND_PCM_STREAM_CAPTURE, mode=1) at pcm_plug.c:1311
#13 0x00007f65d39320ba in snd_pcm_open_conf (pcmp=pcmp@entry=0x7fffda4951c8, name=name@entry=
    0x1eee768 "sysdefault:CARD=SB", pcm_root=pcm_root@entry=0x1fb49e0, pcm_conf=pcm_conf@entry=0x1ff1780, 
    stream=stream@entry=SND_PCM_STREAM_CAPTURE, mode=mode@entry=1) at pcm.c:2171
#14 0x00007f65d3934679 in snd1_pcm_open_named_slave (pcmp=pcmp@entry=0x7fffda4951c8, name=name@entry=
    0x1eee768 "sysdefault:CARD=SB", root=root@entry=0x1fb49e0, conf=0x1ff1780, stream=stream@entry=
    SND_PCM_STREAM_CAPTURE, mode=mode@entry=1, parent_conf=parent_conf@entry=0x1e0b1c0) at pcm.c:2337
#15 0x00007f65d396f956 in _snd_pcm_asym_open (pcmp=0x7fffda4951c8, name=0x1eee768 "sysdefault:CARD=SB", root=0x1fb49e0,
    conf=0x1e0b1c0, stream=SND_PCM_STREAM_CAPTURE, mode=1) at pcm_asym.c:112
#16 0x00007f65d39320ba in snd_pcm_open_conf (pcmp=pcmp@entry=0x7fffda4951c8, name=name@entry=
    0x1eee768 "sysdefault:CARD=SB", pcm_root=pcm_root@entry=0x1fb49e0, pcm_conf=pcm_conf@entry=0x1e0b1c0, 
    stream=stream@entry=SND_PCM_STREAM_CAPTURE, mode=mode@entry=1) at pcm.c:2171
#17 0x00007f65d3934679 in snd1_pcm_open_named_slave (pcmp=pcmp@entry=0x7fffda4951c8, name=name@entry=
    0x1eee768 "sysdefault:CARD=SB", root=root@entry=0x1fb49e0, conf=0x1e0b1c0, stream=stream@entry=
    SND_PCM_STREAM_CAPTURE, mode=mode@entry=1, parent_conf=parent_conf@entry=0x1fba2f0) at pcm.c:2337
#18 0x00007f65d395a292 in _snd_pcm_empty_open (pcmp=0x7fffda4951c8, name=0x1eee768 "sysdefault:CARD=SB", root=
    0x1fb49e0, conf=0x1fba2f0, stream=SND_PCM_STREAM_CAPTURE, mode=1) at pcm_empty.c:103
#19 0x00007f65d39320ba in snd_pcm_open_conf (pcmp=pcmp@entry=0x7fffda4951c8, name=name@entry=
    0x1eee768 "sysdefault:CARD=SB", pcm_root=pcm_root@entry=0x1fb49e0, pcm_conf=0x1fba2f0, stream=stream@entry=
    SND_PCM_STREAM_CAPTURE, mode=mode@entry=1) at pcm.c:2171
#20 0x00007f65d3932648 in snd_pcm_open_noupdate (pcmp=0x7fffda4951c8, root=0x1fb49e0, name=
    0x1eee768 "sysdefault:CARD=SB", stream=SND_PCM_STREAM_CAPTURE, mode=1, hop=0) at pcm.c:2225
#21 0x00007f65d3bd0526 in PhononServer::findVirtualDevices (this=this@entry=0x1cfb850)
    at /g/kdegit/kde-runtime/phonon/kded-module/phononserver.cpp:252
#22 0x00007f65d3bd3cdb in PhononServer::findDevices (this=this@entry=0x1cfb850)
    at /g/kdegit/kde-runtime/phonon/kded-module/phononserver.cpp:673
#23 0x00007f65d3bd421f in PhononServer::timerEvent (this=0x1cfb850, e=<optimized out>)
    at /g/kdegit/kde-runtime/phonon/kded-module/phononserver.cpp:1058
#24 0x00007f65f20869fc in QObject::event (this=0x1cfb850, e=<optimized out>)
    at /g/kdegit/qt/src/corelib/kernel/qobject.cpp:1156
#25 0x00007f65f1074551 in QApplicationPrivate::notify_helper (this=this@entry=0x1941f00, receiver=receiver@entry=
    0x1cfb850, e=e@entry=0x7fffda496260) at /g/kdegit/qt/src/gui/kernel/qapplication.cpp:4562
#26 0x00007f65f10795f9 in QApplication::notify (this=0x7fffda496680, receiver=0x1cfb850, e=0x7fffda496260)
    at /g/kdegit/qt/src/gui/kernel/qapplication.cpp:4423
#27 0x00007f65f310966e in KApplication::notify (this=0x7fffda496680, receiver=0x1cfb850, event=0x7fffda496260)
    at /g/kdegit/kdelibs/kdeui/kernel/kapplication.cpp:311
#28 0x00007f65f206fe8d in QCoreApplication::notifyInternal (this=0x7fffda496680, receiver=0x1cfb850, event=
    0x7fffda496260) at /g/kdegit/qt/src/corelib/kernel/qcoreapplication.cpp:946
#29 0x00007f65f20a4392 in QCoreApplication::sendEvent (event=0x7fffda496260, receiver=<optimized out>)
    at ../../include/QtCore/../../../../kdegit/qt/src/corelib/kernel/qcoreapplication.h:231
#30 QTimerInfoList::activateTimers (this=0x1944660) at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_unix.cpp:622
#31 0x00007f65f20a0f84 in timerSourceDispatch (source=<optimized out>)
    at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:186
#32 timerSourceDispatch (source=<optimized out>) at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:180
#33 0x00007f65f20a0fb1 in idleTimerSourceDispatch (source=<optimized out>)
    at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:233
#34 0x00007f65ec628815 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#35 0x00007f65ec628b48 in ?? () from /usr/lib64/libglib-2.0.so.0
#36 0x00007f65ec628c04 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#37 0x00007f65f20a16e4 in QEventDispatcherGlib::processEvents (this=0x18b87b0, flags=...)
    at /g/kdegit/qt/src/corelib/kernel/qeventdispatcher_glib.cpp:424
#38 0x00007f65f1122f46 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...)
    at /g/kdegit/qt/src/gui/kernel/qguieventdispatcher_glib.cpp:204
#39 0x00007f65f206e3ef in QEventLoop::processEvents (this=this@entry=0x7fffda4964e0, flags=...)
    at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:149
#40 0x00007f65f206e6a8 in QEventLoop::exec (this=0x7fffda4964e0, flags=...)
    at /g/kdegit/qt/src/corelib/kernel/qeventloop.cpp:204
#41 0x00007f65f2073c28 in QCoreApplication::exec () at /g/kdegit/qt/src/corelib/kernel/qcoreapplication.cpp:1218
#42 0x00007f65dedebbdc in kdemain (argc=1, argv=0x1921870) at /g/kdegit/kdelibs/kded/kded.cpp:924
#43 0x00000000004083cb in launch (argc=argc@entry=1, _name=_name@entry=0x40c7f9 "kded4", args=args@entry=0x0, 
    cwd=cwd@entry=0x0, envc=envc@entry=0, envs=envs@entry=0x0, reset_env=reset_env@entry=false, tty=tty@entry=0x0, 
    avoid_loops=avoid_loops@entry=false, startup_id_str=startup_id_str@entry=0x40c559 "0")
    at /g/kdegit/kdelibs/kinit/kinit.cpp:726
#44 0x0000000000405451 in main (argc=4, argv=<optimized out>, envp=0x7fffda496b80)
    at /g/kdegit/kdelibs/kinit/kinit.cpp:1841
Comment 35 Jeremy Bowers 2012-12-03 22:18:21 UTC
I am running Ubuntu Server 12.10, with konsole installed via "apt-get install konsole", with XMonad as my window manager. Following the directions linked by Christoph Feck, removing the "nepomuksearchmodule.desktop" (and following all other directions in that article) has resolved this problem. I have *only* removed nepomuksearchmodule.desktop, and nothing else, and made no other KDE-related changes. (Fortunately, I got it in one, based on reading the strace output.)

I appear to have a nepomuk binary installed, but I have nothing running with that in its process name. I have done no further testing as this resolves my issue, but I can try other things if necessary.
Comment 36 Jeremy Bowers 2012-12-06 16:49:30 UTC
Alas, I have to take that back. It can still crash even after that removal.
Comment 37 Christoph Feck 2012-12-21 21:20:30 UTC
*** Bug 312053 has been marked as a duplicate of this bug. ***
Comment 38 Michael Pyne 2012-12-23 22:33:13 UTC
This libasound deadlock bug has also been noted by some GNOME developers (in the Ekiga application). See also: https://mail.gnome.org/archives/ekiga-list/2010-March/msg00006.html, http://wiki.ekiga.org/index.php/Troubleshooting#Freeze_when_using_ALSA, and https://bugzilla.gnome.org/show_bug.cgi?id=593064
Comment 39 Micha 2013-01-26 17:53:20 UTC
I had the click-to-freeze-konsole-bug.
Solution for me:
I removed /usr/share/kde4/services/kded/phononserver.desktop --> bug fixed.
I shortened /usr/share/kde4/services/kded/phononserver.desktop (removed all translations except [de]) --> bug fixed!

Looks like some text parsing in this config file is not working.

My system:
Gentoo, Kernel 3.6.11, 64bit, KDE 4.9.3
Comment 40 Jens Weibler 2013-02-14 15:57:28 UTC
Also happens with Kubuntu quantal. Removing /usr/share/kde4/services/kded/phononserver.desktop fixed it.
Comment 41 Johannes Huber 2013-10-24 17:44:50 UTC
(In reply to comment #40)
> Also happens with Kubuntu quantal. Removing
> /usr/share/kde4/services/kded/phononserver.desktop fixed it.

Seems like a bad entry in .desktop file or a bad parsing for me. Is this already fixed? I am asking because no activity in this bug since feb.
Comment 42 Ole Langbehn 2013-10-24 17:55:26 UTC
(In reply to comment #40)
> Also happens with Kubuntu quantal. Removing
> /usr/share/kde4/services/kded/phononserver.desktop fixed it.

Still seeing this, just yesterday. kde 4.11.2, gentoo, don't even have a phononserver.desktop file anywhere on my box.
Comment 43 Christoph Feck 2013-10-24 18:20:51 UTC
Ole, if you have no phononserver.desktop file, then you do not have Phonon installed.

In this case, a different kded module is causing the issue. Please try to isolate the offending kded module by following http://kdepepo.wordpress.com/2011/05/11/troubleshooting-kded4-bugs/ and report a new bug.
Comment 44 Mihai DONȚU 2014-01-08 20:44:06 UTC
I have the same issue with konsole 2.12 (kde 4.12.0), but it only reproduces after a random number of reboots. When I select a piece of text and right-click, it hangs for 1 minute or so (probably more) after which it gets back to normal (right-click works every time). If I restart konsole the bug appears again. I guess one failed communication with DBus is enough to ignore it completely afterwards. If I reboot my laptop it all gets back to normal (zero hangs no matter what).
Comment 45 Mihai DONȚU 2014-01-08 20:45:51 UTC
Created attachment 84519 [details]
konsole DBus hang backtrace

Attached you can find my backtrace.
Comment 46 Mihai DONȚU 2014-01-08 21:03:18 UTC
Using 'dbus-monitor' I can see the following requests being made:

signal sender=:1.42 -> dest=(null destination) serial=27 path=/StatusNotifierItem; interface=org.kde.StatusNotifierItem; member=NewToolTip
method call sender=:1.61 -> dest=org.freedesktop.DBus serial=15 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch string "type='signal',interface='org.kde.KSycoca',member='notifyDatabaseChanged'"
method call sender=:1.61 -> dest=org.freedesktop.DBus serial=16 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameHasOwner string "org.kde.klauncher"
method call sender=:1.61 -> dest=org.freedesktop.DBus serial=17 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch string "type='signal',path='/',interface='org.kde.KUriFilterPlugin',member='configure'"
method call sender=:1.61 -> dest=org.freedesktop.DBus serial=18 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner string "org.kde.kded"
method call sender=:1.61 -> dest=org.kde.kded serial=19 path=/modules/favicons; interface=org.freedesktop.DBus.Introspectable; member=Introspect

So the communication with DBus is OK. It's just this 'favicon' requests that hangs which, judging from the destination, I'd say 'kded' is to blame. I'll try and dig out the module behind it.
Comment 47 Mihai DONȚU 2014-01-08 21:16:14 UTC
Fixed it with 'killall kded4 && kded4'. Unfortunately I did not get a change to find out where it was hanged (it wasn't answering _any_ dbus requests).
Comment 48 Mihai DONȚU 2014-01-09 00:58:59 UTC
After reading _all_ comments to this issue I've realized I have rediscovered the hot water. Not too bad, because all this exercise got me in the mood to trace down this mofo and after three reboots I've managed reproduce it: kded4 hangs when loading the kmixd which in turn hangs in the pulseaudio client library (see attached kded_kmixd-backtrace.txt).
Comment 49 Mihai DONȚU 2014-01-09 01:04:45 UTC
Created attachment 84529 [details]
hanged kded4 backtrace
Comment 50 Mihai DONȚU 2014-01-09 03:03:31 UTC
Created attachment 84530 [details]
kded backtrace with more symbols in kmix
Comment 51 Mihai DONȚU 2014-01-09 04:20:18 UTC
I think I see what's going on, at least with the pulseaudio backend.

The short story: the pulse audio client is waiting for someone to call pa_mainloop_wakep() because the connection to the daemon went dead and kmix is still asking for events with pa_mainloop_iterate().

The long story: inspecting the backtrace I can see that kmix ends up calling ppoll() (via the pulseaudio client library) with a single file descriptor, 23. Using 'lsof' I can also see that 23 is the read end of a pipe:

$ pgrep kded4
6348

$ ls -l /proc/6348/fd
total 0
lr-x------ 1 mihai mihai 64 Jan  9 04:24 0 -> /dev/null
l-wx------ 1 mihai mihai 64 Jan  9 04:24 1 -> /home/mihai/.xsession-errors
lr-x------ 1 mihai mihai 64 Jan  9 04:24 10 -> /var/tmp/kdecache-mihai/ksycoca4
lrwx------ 1 mihai mihai 64 Jan  9 04:24 11 -> socket:[17299]
lrwx------ 1 mihai mihai 64 Jan  9 04:24 12 -> socket:[18132]
lr-x------ 1 mihai mihai 64 Jan  9 04:24 13 -> anon_inode:inotify
lrwx------ 1 mihai mihai 64 Jan  9 04:24 14 -> anon_inode:[eventfd]
lrwx------ 1 mihai mihai 64 Jan  9 04:24 15 -> socket:[17361]
lrwx------ 1 mihai mihai 64 Jan  9 04:24 16 -> anon_inode:[eventfd]
l-wx------ 1 mihai mihai 64 Jan  9 04:24 2 -> /home/mihai/.xsession-errors
lrwx------ 1 mihai mihai 64 Jan  9 04:24 21 -> anon_inode:[eventfd]
lrwx------ 1 mihai mihai 64 Jan  9 04:24 22 -> anon_inode:[eventfd]
lr-x------ 1 mihai mihai 64 Jan  9 04:24 23 -> pipe:[20500]
lrwx------ 1 mihai mihai 64 Jan  9 04:24 24 -> socket:[17391]
l-wx------ 1 mihai mihai 64 Jan  9 04:24 25 -> pipe:[20500]
lrwx------ 1 mihai mihai 64 Jan  9 04:24 3 -> anon_inode:[eventfd]
lr-x------ 1 mihai mihai 64 Jan  9 04:24 4 -> pipe:[16173]
lrwx------ 1 mihai mihai 64 Jan  9 04:24 5 -> socket:[17261]
l-wx------ 1 mihai mihai 64 Jan  9 04:24 6 -> pipe:[16173]
lrwx------ 1 mihai mihai 64 Jan  9 04:24 7 -> socket:[16174]
lrwx------ 1 mihai mihai 64 Jan  9 04:24 8 -> socket:[16181]
lr-x------ 1 mihai mihai 64 Jan  9 04:24 9 -> anon_inode:inotify

$ sudo lsof -n | grep 20500
Password: 
kded4      6348            mihai   23r     FIFO                0,8       0t0      20500 pipe
kded4      6348            mihai   25w     FIFO                0,8       0t0      20500 pipe
QInotifyF  6348  6400      mihai   23r     FIFO                0,8       0t0      20500 pipe
QInotifyF  6348  6400      mihai   25w     FIFO                0,8       0t0      20500 pipe
QProcessM  6348  6459      mihai   23r     FIFO                0,8       0t0      20500 pipe
QProcessM  6348  6459      mihai   25w     FIFO                0,8       0t0      20500 pipe
KCupsConn  6348  6502      mihai   23r     FIFO                0,8       0t0      20500 pipe
KCupsConn  6348  6502      mihai   25w     FIFO                0,8       0t0      20500 pipe
QThread    6348  6503      mihai   23r     FIFO                0,8       0t0      20500 pipe
QThread    6348  6503      mihai   25w     FIFO                0,8       0t0      20500 pipe

Those file descriptors are created by pa_mainloop_new() and are used to forcefully exit from pa_mainloop_poll(). The only reason they'd be the last ones in the 'p_test_mainloop' descriptor set is if the connection to the pulseaudio was never established. Unfortunately, kmix does not appear to be prepared to handle this weird situation, because inspecting kded's state I've determined that p_test_context is in state PA_CONTEXT_FAILED but since pa_mainloop_iterate() never exited (because it would've abandoned the forever loop) I think pa_context_connect() returned with (>= 0) even though the connection was never pending.

So far it appears to be a bug in the pulseaudio client library, but I need more time to be sure. In the mean time, maybe it would be nice to do a non-blocking pa_mainloop_iterate() and abandon the for() after 5s or so.
Comment 52 Martin Sandsmark 2014-01-09 13:52:40 UTC
awesome debugging, thanks!

Re-assigning to kmix for now, maybe coling or esken knows more.
Comment 53 Christian Esken 2014-04-04 12:50:15 UTC
Status: I don't know anything about pa_mainloop_iterate(), so I'll leave this ticket assigned to coling.  Someone with deep PA library knowledge must look into this issue.
Comment 54 Christian Esken 2014-04-04 12:51:12 UTC
@coling: Could you take a look here please.
Comment 55 Wouter Van Hemel 2014-11-26 09:58:00 UTC
This bug is still manifesting itself in Debian unstable (KDE 4.14.2). Same pattern: selecting text, right-click, hang-up instead of context menu. Konsole and Yakuake seem to hang on a dbus call via search engine and favicon functionality.