Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
1.0.0, 1.1.0
-
None
-
OSX 10.6.6
-
f299d9ae2cac0f52e9d9cf5e4a015181203ba50f
Description
I've seen a sporadic fatal crash in QAudioDeviceInfo::availableDevices(), caused by it trying to follow a pointer that was invalid, presumably because the available devices changed (due to unplugging a USB audio device) while the function was executing.
Apparently QAudioDeviceInfo::availableDevices() queries the underlying low-level API over an extended period of time and thus may receive and act on inconsistent information. All queries relating to the same device should be turned into an atomic operation by temporarily disabling interrupts.
This is not quite as obscure a problem as it may seem, because due to QTBUG-10393 any program that wishes to maintain a QListModel of audio devices (e.g., for user selection) currently needs to frequently poll QAudioDeviceInfo::availableDevices().