Summary: | Increasing/decreasing volume using multimedia keys crashes KMix when using OSS [[MixDevice::isMuted], Mixer_OSS::writeVolumeToHW, KMixWindow::increaseOrDecreaseVolume] | ||
---|---|---|---|
Product: | [Applications] kmix | Reporter: | Adam Kovari <kovariadam> |
Component: | general | Assignee: | Christian Esken <esken> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | andresbajotierra, edward.hades, lme, toma |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
patch that fixes the oss crash
patch that fixes the oss crash New crash information added by DrKonqi |
Description
Adam Kovari
2009-11-03 18:39:40 UTC
*** Bug 213601 has been marked as a duplicate of this bug. *** *** Bug 213670 has been marked as a duplicate of this bug. *** From bug 227421: -- Information about the crash: "Decrease volume" multimedia key cases crash, using OSSv4 happens all the time, but scrolling on the tray icon works well. The crash can be reproduced every time. *** Bug 227421 has been marked as a duplicate of this bug. *** SVN commit 1128461 by esken: Backport a fix to 4.3 for a possible crash on shwowing the Volume OSD. CCBUGS: 212944 M +3 -0 kmix.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1128461 Fixed in KDE4.4.1, the future KDE4.5, and in the KDE4.3 branch (for a possible vendor service release). Problems were suboptimal Master selection, and non-guarded null-pointers. With the patches it won't crash even when there is no master at all. *** Bug 205621 has been marked as a duplicate of this bug. *** Somehow this still happens in KDE 4.4.4. Let me debug it a bit... Here's the backtrace: Program received signal SIGSEGV, Segmentation fault. 0xb789ba81 in Volume::getVolume (this=0xc, chid=Volume::CHIDMIN) at /home/hades/dev/kmix/kdemultimedia-4.4.4/kmix/volume.cpp:178 178 if ( (chmask & _chmask) != 0 ) { (gdb) bt #0 0xb789ba81 in Volume::getVolume (this=0xc, chid=Volume::CHIDMIN) at /home/hades/dev/kmix/kdemultimedia-4.4.4/kmix/volume.cpp:178 #1 0xb788ebcb in Mixer_OSS4::writeVolumeToHW (this=0x92992a0, id=..., md=0x0) at /home/hades/dev/kmix/kdemultimedia-4.4.4/kmix/mixer_oss4.cpp:637 #2 0xb788c48f in Mixer::decreaseVolume (this=0x9279678, mixdeviceID=...) at /home/hades/dev/kmix/kdemultimedia-4.4.4/kmix/mixer.cpp:625 #3 0xb787657a in KMixWindow::increaseOrDecreaseVolume (this=0x91602c0, increase=false) at /home/hades/dev/kmix/kdemultimedia-4.4.4/kmix/kmix.cpp:624 #4 0xb78765c9 in KMixWindow::slotDecreaseVolume (this=0x91602c0) at /home/hades/dev/kmix/kdemultimedia-4.4.4/kmix/kmix.cpp:636 #5 0xb78780dd in KMixWindow::qt_metacall (this=0x91602c0, _c=QMetaObject::InvokeMetaMethod, _id=19, _a=0xbf89204c) at /home/hades/dev/kmix/kdemultimedia-4.4.4/build/kmix/kmix.moc:123 #6 0xb6d551df in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/qt4/libQtCore.so.4 #7 0xb6d6318b in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/qt4/libQtCore.so.4 #8 0xb6305df4 in QAction::triggered(bool) () from /usr/lib/qt4/libQtGui.so.4 #9 0xb6307e23 in QAction::activate(QAction::ActionEvent) () from /usr/lib/qt4/libQtGui.so.4 #10 0xb7331622 in KGlobalAccelPrivate::_k_invokeAction(QStringList const&, long long) () from /usr/lib/libkdeui.so.5 #11 0xb7336337 in KGlobalAccel::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkdeui.so.5 #12 0xb6d551df in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/qt4/libQtCore.so.4 #13 0xb6d6318b in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/qt4/libQtCore.so.4 #14 0xb74412f0 in OrgKdeKGlobalAccelInterface::invokeAction(QStringList const&, long long) () from /usr/lib/libkdeui.so.5 #15 0xb74422c5 in OrgKdeKGlobalAccelInterface::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkdeui.so.5 #16 0xb6e80eb6 in QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&, QList<int> const&, int) () from /usr/lib/qt4/libQtDBus.so.4 #17 0xb6e8b391 in QDBusCallDeliveryEvent::placeMetaCall(QObject*) () from /usr/lib/qt4/libQtDBus.so.4 #18 0xb6d60214 in QObject::event(QEvent*) () from /usr/lib/qt4/libQtCore.so.4 #19 0xb630bf2d in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/qt4/libQtGui.so.4 #20 0xb6312e9d in QApplication::notify(QObject*, QEvent*) () from /usr/lib/qt4/libQtGui.so.4 #21 0xb72da82e in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5 #22 0xb6d503f5 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/qt4/libQtCore.so.4 #23 0xb6d51243 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/qt4/libQtCore.so.4 #24 0xb6d513e2 in QCoreApplication::sendPostedEvents(QObject*, int) () from /usr/lib/qt4/libQtCore.so.4 #25 0xb6d79e3e in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib/qt4/libQtCore.so.4 #26 0xb5fe798e in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #27 0xb5fead61 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0 #28 0xb5feaec2 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 #29 0xb6d799ce in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/qt4/libQtCore.so.4 #30 0xb63be2be in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/qt4/libQtGui.so.4 #31 0xb6d4ec8f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/qt4/libQtCore.so.4 #32 0xb6d4f095 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/qt4/libQtCore.so.4 #33 0xb6d5148f in QCoreApplication::exec() () from /usr/lib/qt4/libQtCore.so.4 #34 0xb630bfc2 in QApplication::exec() () from /usr/lib/qt4/libQtGui.so.4 #35 0xb7875c92 in kdemain (argc=1, argv=0xbf893034) at /home/hades/dev/kmix/kdemultimedia-4.4.4/kmix/main.cpp:71 #36 0x08048712 in main (argc=Cannot access memory at address 0xc ) at /home/hades/dev/kmix/kdemultimedia-4.4.4/build/kmix/kmix_dummy.cpp:3 The md is null in Mixer::decreaseVolume( const QString& ): mixer.cpp:625 _mixerBackend->writeVolumeToHW(mixdeviceID, md); Created attachment 48043 [details]
patch that fixes the oss crash
Created attachment 48044 [details]
patch that fixes the oss crash
Sorry, swapped sides accidentally.
The observation is correct: ID is actually an index in the Mixer::_mixerBackend->m_mixDevices array. Or it should be so at least, as Edward found out it doesn't work: The core reason for the bug is that the OSSv4 backend neglects to implement/ overload the id2num() method. While the patch is working, I can't apply it. It makes all backends more inefficient (because a "full scan" is done on each call). Correct would be to implement the id2num() method in the OSSv4 backend. I personally can't support OSSv4 (due to lack of driver), but surely I am still interested in a patch. If you could do it (or Maxime, who did the KDE4 port)., I'll integrate it. As a starting point you can look at Mixer_PULSE::id2num() or Mixer_ALSA::id2num(). First uses a search loop, the latter a hashmap. Created attachment 51422 [details]
New crash information added by DrKonqi
Same here on PCBSD 8.1 with KDE 4.4.5.
As a side note: Rasing volume shows an empty Volume OSD.
Then the id2num in parent class Mixer_Backend is incorrect, because it does not implement sufficiently generic behavior. Update: The crash only occurs when the "wrong" main channel is selected. It was set to "monitor" here. Now I changed it to PCM and it's working again. I re-read the comments of this bug report. Something went wrong here. The original bug report is about OSS(3). Actually its a generic issue and it is resolved. The latest comments - starting with comment 9 - are about OSS4. In any case it looks I did not detect the following line until today: 0xb788ebcb in Mixer_OSS4::writeVolumeToHW (this=0x92992a0, id=..., md=0x0) Ouch. md=0x0 means, I produced a NPE. Probably I found it now, as I applied a fix for this today. The KDE4.7 branch has been patched, and also Trunk. SVN commit 1248941 by esken: BUGS: 245383 BUGS: 212944 Fix NPE when decreasing volume. Forward port to trunk. M +14 -27 mixer.cpp M +1 -1 mixer.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1248941 |