Infinite loop in SoundManager when no SoundDevices detected

Bug #1026343 reported by Patrick Lömker
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Critical
RJ Skerry-Ryan
1.10
Won't Fix
Critical
RJ Skerry-Ryan
1.11
Fix Released
Critical
RJ Skerry-Ryan

Bug Description

running ubuntu 12.04 with gnome 3 on an i3 64bit setup mixxx fails to start giving repeatedly the following message
Warning [Main]: failed to resolve JACK name method
segmentation fault (and it somewhere writes a reciecpt / printout of this error but it does not tell where)

backtrace : http://pastebin.com/EpgVs0VW

the complete story in a nut shell: first i tried to install from ubuntus software center, gave the above error. ubuntus internal bug reporting tool started and asked whether i wanted to report, which i agreed to, it then asked again whether i really wanted because it seemed that libportaudio2 had to do with it, i again said, go ahead anyways.

after that, i went to the mixxx homepage and did what i needed to do to compile it my self. build deps first reported, that there was a conflict with libjackaudio which i overrode since it seemed that this was necessary to get a full build. then i ran the build process and installed it in /usr using mixxx from the command prompt, it seems i went long ways to reproduce the error yet again. im out of ideas... how about you ?

Related branches

description: updated
description: updated
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

The issue is that SoundManager gets into an infinite loop if there are no sound devices on the system.

Patrick sent a backtrace where the relevant part is this:

.... infinite loop continues until SIGSEGV from stack overflow...
#45078 0x00007ffff6529281 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#45079 0x0000000000789916 in SoundManager::queryDevices (this=0xf16e20)
    at src/soundmanager.cpp:373
#45080 0x000000000078a328 in SoundManager::getDeviceList (this=0xf16e20,
    filterAPI=..., bOutputDevices=true, bInputDevices=false)
    at src/soundmanager.cpp:161
#45081 0x000000000047a10c in DlgPrefSound::refreshDevices (this=0x170eca0)
    at src/dlgprefsound.cpp:404
#45082 0x0000000000845878 in DlgPrefSound::qt_static_metacall (_o=0x170eca0,
    _id=17, _a=0x7fffffffc7c0, _c=<optimized out>)
    at lin64_build/moc_dlgprefsound.cc:100
#45083 0x00007ffff6529281 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#45084 0x0000000000789916 in SoundManager::queryDevices (this=0xf16e20)
    at src/soundmanager.cpp:373
#45085 0x000000000078a328 in SoundManager::getDeviceList (this=0xf16e20,
    filterAPI=..., bOutputDevices=true, bInputDevices=false)
    at src/soundmanager.cpp:161
#45086 0x0000000000795462 in SoundManagerConfig::filterOutputs (this=0xf16e88,
    soundManager=0xf16e20) at src/soundmanagerconfig.cpp:247
#45087 0x000000000078c37a in SoundManager::setupDevices (this=0xf16e20)
    at src/soundmanager.cpp:390
#45088 0x0000000000587ec5 in MixxxApp::MixxxApp (this=0xef5020,
    pApp=0x7fffffffdcf0, args=...) at src/mixxx.cpp:404
#45089 0x000000000043c593 in main (argc=3, argv=0x7fffffffde98)
    at src/main.cpp:290

SoundManager::getDeviceList does not call queryDevices() unless there are no sound devices detected. Since queryDevices() does not produce any sound devices, the next time getDeviceList is called (which is invoked by signal/slot) the loop continues.

Changed in mixxx:
status: New → Confirmed
importance: Undecided → Critical
summary: - does not start ubuntu 12.04 amd64 Warning [Main]: failed to resolve JACK
- name method
+ Infinite loop in SoundManager when no SoundDevices detected
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

BTW -- it appears Patrick has no sound devices because his portaudio is compiled without ALSA, JACK, or OSS support (as a result of following our wiki instructions :X). It's fair to say this is a rare bug but the infinite loop is real.

To fix the infinite loop, I'd like to just remove the call to queryDevices() in getDeviceList(). We call queryDevices() in the SoundManager constructor so we should never not have any devices just because we haven't called queryDevices yet. queryDevices() will still get called when the user specifically requests it via the query button.

Any objections Bill?

Changed in mixxx:
assignee: nobody → RJ Ryan (rryan)
status: Confirmed → In Progress
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: In Progress → Fix Committed
Revision history for this message
William Good (bkgood) wrote :

This is retroactively fine by me :) I usually watch for bugmail with my name on it (either explicitly or implicitly) but this one went under the radar.

I'm remembering one really tiny corner case that this might affect but it's been so long and my memory is so hazy that I really have no business talking about it.

RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/6581

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.