Bug 189516 - crash when no cdrom devices detected by solid
Summary: crash when no cdrom devices detected by solid
Status: RESOLVED FIXED
Alias: None
Product: kdemultimedia
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Multimedia Developers
URL:
Keywords:
: 157680 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-13 11:33 UTC by Chris Burel
Modified: 2010-10-12 03:58 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Burel 2009-04-13 11:33:22 UTC
Version:            (using KDE 4.2.2)
Compiler:          gcc-4.3.2 
OS:                Linux
Installed from:    Compiled From Sources

The audiocd ioslave crashes if Solid does not return any cdrom devices.  It asks Solid for a QList of devices, and then without checking isEmpty() tries to examine the 0'th index of the list, which crashes the program.

Manifests itself by a message in Dolphin saying something like:
The process for the protocol audiocd:/ died unexpectedly

Also prints an error in .xsession-errors that looks like:
kdeinit4: preparing to launch
kioslave: ####### CRASH ###### protocol = audiocd pid = 6340 signal = 11

Expected behavior:
It should print a kDebug() or some more visible warning message that says "Unable to detect any cdrom devices.  Check your Solid/HAL configuration."

#0  0xb80bf424 in __kernel_vsyscall ()
#1  0xb6752bb9 in raise () from /lib/libc.so.6
#2  0xb6754138 in abort () from /lib/libc.so.6
#3  0xb7eccf0d in qt_message_output () from /opt/qt/lib/libQtCore.so.4
#4  0xb7eccff1 in qFatal () from /opt/qt/lib/libQtCore.so.4
#5  0xb7ecd09c in qt_assert_x () from /opt/qt/lib/libQtCore.so.4
#6  0xb5df986a in QList<QString>::at (this=0xbf8d872c, i=0) at /opt/qt-4.5.0/include/QtCore/qlist.h:395
#7  0xb5df7d66 in KCompactDisc::defaultCdromDeviceName ()
    at /usr/src/rpm/build/kdemultimedia-4.2.2/libkcompactdisc/kcompactdisc.cpp:148
#8  0xb5df7dd6 in KCompactDisc (this=0x97c794c, infoMode=KCompactDisc::Asynchronous)
    at /usr/src/rpm/build/kdemultimedia-4.2.2/libkcompactdisc/kcompactdisc.cpp:172
#9  0xb7e7d5e2 in Private (this=0x97c78b8) at /usr/src/rpm/build/kdemultimedia-4.2.2/kioslave/audiocd/audiocd.cpp:106
#10 0xb7e7a600 in AudioCDProtocol (this=0xbf8d8878, protocol=@0xbf8d88dc, pool=@0xbf8d88d4, app=@0xbf8d88cc)
    at /usr/src/rpm/build/kdemultimedia-4.2.2/kioslave/audiocd/audiocd.cpp:164
#11 0xb7e7ac39 in kdemain (argc=4, argv=0x9771910)
    at /usr/src/rpm/build/kdemultimedia-4.2.2/kioslave/audiocd/audiocd.cpp:88
#12 0x0804dced in launch ()
#13 0x0804e44d in handle_launcher_request ()
#14 0x0804e910 in handle_requests ()
#15 0x0804f05c in main ()
Comment 1 Dario Andres 2009-04-14 17:17:37 UTC
*** Bug 157680 has been marked as a duplicate of this bug. ***
Comment 2 Dario Andres 2009-05-01 03:16:27 UTC
I guess this could be workarounded by adding an invalid entry (dev="") to the cdromlist if no drives were found. in (kcompactdisc.cpp). But I don't know how application will react to this. At least they shouldn't crash
Comment 3 Christoph Feck 2010-10-12 03:58:36 UTC
Fixed in r1066613 by aacid.

WebSVN link: http://websvn.kde.org/?revision=1066613&view=revision