Skip to content

fix segfault by guarding mixdevice

Hoi Pok Wu requested to merge wuhoipok/kmix:md_guard into master

This is a followup to !8 (merged). By not guarding mixdevice in VolumeFeedback::volumeChanged(), it is proven that segfault could possibly happen. I have put both my log and gdb backtrace down below.

[ 8041.450640] kmix[7677]: segfault at 30 ip 00007ff99e651c72 sp 00007fffa533aa30 error 4 in libkmixcore.so.22.11.70[7ff99e640000+41000] [ 8041.450648] Code: fe ff 48 89 c7 e8 90 05 00 00 c9 c3 55 48 89 e5 48 89 7d f8 48 8b 45 f8 0f b6 40 20 5d c3 55 48 89 e5 48 89 7d f8 48 8b 45 f8 <48> 8b 50 18 48 8b 45 f8 48 8b 40 10 48 39 c2 0f 95 c0 5d c3 55 48

Thread 1 "kmix" received signal SIGSEGV, Segmentation fault. 0x00007ffff7dc7c72 in Volume::hasVolume (this=0x18) at /home/jay/kmix/core/volume.h:138 138 bool hasVolume() const { return (_maxVolume!=_minVolume); } (gdb) backtrace #0 0x00007ffff7dc7c72 in Volume::hasVolume (this=0x18) at /home/jay/kmix/core/volume.h:138 #1 0x00007ffff7dcbeef in MixDevice::userVolumeLevel (this=0x0) at /home/jay/kmix/core/mixdevice.cpp:418 #2 0x00005555555858e6 in VolumeFeedback::volumeChanged (this=0x555555accae0) at /home/jay/kmix/apps/volumefeedback.cpp:118 #3 0x000055555558587f in VolumeFeedback::controlsChange (this=0x555555accae0, changeType=ControlManager::First) at /home/jay/kmix/apps/volumefeedback.cpp:105 #4 0x00005555555752ff in VolumeFeedback::qt_static_metacall (_o=0x555555accae0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fffffffcf70) at /home/jay/kmix/build/kmix_autogen/JWUTCYHTGB/moc_volumefeedback.cpp:79

Merge request reports