AdjustReplayGainTest sometimes segfaults

Bug #1940589 reported by Jan Holthuis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Committed
Critical
Unassigned

Bug Description

This randomly happens when running tests on main (e.g. 2.4-alpha-767-g0774a046ca).

    The following tests FAILED:
     498 - AdjustReplayGainTest.AdjustReplayGainUpdatesPregain (SEGFAULT)

    $ coredumpctl -1 gdb
    Using host libthread_db library "/usr/lib/libthread_db.so.1".
    Core was generated by `/home/jan/Projects/mixxx/build/mixxx-test --gtest_filter=AdjustReplayGainTest.A'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0 0x000055bd8e0236fb in SyncControl::slotControlPlay (this=0x55bd8f83dc30, play=0) at /home/jan/Projects/mixxx/src/engine/sync/synccontrol.cpp:385
    385 m_pEngineSync->notifyPlayingAudible(this, play > 0.0 && m_audible);
    [Current thread is 1 (Thread 0x7f8a57579640 (LWP 175095))]
    >>> bt
    #0 0x000055bd8e0236fb in SyncControl::slotControlPlay(double) (this=0x55bd8f83dc30, play=0) at /home/jan/Projects/mixxx/src/engine/sync/synccontrol.cpp:385
    #1 0x00007f8a6b6de75b in () at /usr/lib/libQt5Core.so.5
    #2 0x000055bd8df3c080 in ControlProxy::valueChanged(double) (this=<optimized out>, _t1=<optimized out>) at /home/jan/Projects/mixxx/build/mixxx-lib_autogen/include/moc_controlproxy.cpp:164
    #3 0x00007f8a6b6de75b in () at /usr/lib/libQt5Core.so.5
    #4 0x000055bd8df30965 in ControlDoublePrivate::valueChanged(double, QObject*) (this=this@entry=0x55bd8f7ee060, _t1=<optimized out>, _t1@entry=0, _t2=<optimized out>) at /home/jan/Projects/mixxx/build/mixxx-lib_autogen/include/moc_control.cpp:145
    #5 0x000055bd8df310ee in ControlDoublePrivate::setInner(double, QObject*) (this=0x55bd8f7ee060, value=0, pSender=<optimized out>) at /home/jan/Projects/mixxx/src/control/control.cpp:223
    #6 0x00007f8a6b6de75b in () at /usr/lib/libQt5Core.so.5
    #7 0x000055bd8df308f3 in ControlDoublePrivate::valueChangeRequest(double) (this=this@entry=0x55bd8f7ee060, _t1=<optimized out>) at /home/jan/Projects/mixxx/build/mixxx-lib_autogen/include/moc_control.cpp:152
    #8 0x000055bd8df31228 in ControlDoublePrivate::set(double, QObject*) (this=0x55bd8f7ee060, value=<optimized out>, pSender=0x55bd8f7edfc0) at /home/jan/Projects/mixxx/src/control/control.cpp:208
    #9 0x000055bd8dff8c16 in ControlObject::set(double) (value=<optimized out>, this=<optimized out>) at /home/jan/Projects/mixxx/src/control/controlobject.h:83
    #10 EngineBuffer::slotTrackLoading() (this=0x55bd8f7e5fe0) at /home/jan/Projects/mixxx/src/engine/enginebuffer.cpp:523
    #11 0x00007f8a6b6de75b in () at /usr/lib/libQt5Core.so.5
    #12 0x00007f8a6b6de75b in () at /usr/lib/libQt5Core.so.5
    #13 0x000055bd8dfcb260 in CachingReaderWorker::loadTrack(std::shared_ptr<Track> const&) (this=0x55bd8f7e9478, pTrack=std::shared_ptr<Track> (use count 5, weak count 0) = {...}) at /home/jan/Projects/mixxx/src/engine/cachingreader/cachingreaderworker.cpp:136
    #14 0x000055bd8dfcd2ad in CachingReaderWorker::run() (this=0x55bd8f7e9478) at /home/jan/Projects/mixxx/src/engine/cachingreader/cachingreaderworker.cpp:104
    #15 0x00007f8a6b4bbfef in () at /usr/lib/libQt5Core.so.5
    #16 0x00007f8a6afd6259 in start_thread () at /usr/lib/libpthread.so.0
    #17 0x00007f8a6aeff5e3 in clone () at /usr/lib/libc.so.6

Changed in mixxx:
importance: Undecided → Critical
milestone: none → 2.4.0
description: updated
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote (last edit ):

The adjustment of replay gain values was introduced by this PR:

https://github.com/mixxxdj/mixxx/pull/4031

Owen Williams (ywwg)
summary: - AdjustReplainGainTest sometimes segfaults
+ AdjustReplayGainTest sometimes segfaults
Revision history for this message
Owen Williams (ywwg) wrote :

I am unable to reproduce on my own machine. Can you figure out what object is segfaulting? is m_pEngineSync null? I suspect this is an initialization race condition that likely only affects this test because it uses an unusual code path.

Revision history for this message
Jan Holthuis (holthuis-jan) wrote :
Download full text (3.6 KiB)

I actually don't know. I just happened again, but looking at the coredump I doesn't look like m_pEngineSync is null:

    Program terminated with signal SIGSEGV, Segmentation fault.
    #0 0x000055abf33c004b in SyncControl::slotControlPlay (this=0x55abf5c19cd0, play=0) at /home/jan/Projects/mixxx/src/engine/sync/synccontrol.cpp:385
    385 m_pEngineSync->notifyPlayingAudible(this, play > 0.0 && m_audible);
    [Current thread is 1 (Thread 0x7fe75f19f640 (LWP 245841))]
    >>> bt
    #0 0x000055abf33c004b in SyncControl::slotControlPlay(double) (this=0x55abf5c19cd0, play=0) at /home/jan/Projects/mixxx/src/engine/sync/synccontrol.cpp:385
    #1 0x00007fe77335f76b in () at /usr/lib/libQt5Core.so.5
    #2 0x000055abf32d7ef0 in ControlProxy::valueChanged(double) (this=<optimized out>, _t1=<optimized out>) at /home/jan/Projects/mixxx/build/mixxx-lib_autogen/include/moc_controlproxy.cpp:164
    #3 0x00007fe77335f76b in () at /usr/lib/libQt5Core.so.5
    #4 0x000055abf32cb755 in ControlDoublePrivate::valueChanged(double, QObject*) (this=this@entry=0x55abf5bca2d0, _t1=<optimized out>, _t1@entry=0, _t2=<optimized out>) at /home/jan/Projects/mixxx/build/mixxx-lib_autogen/include/moc_control.cpp:145
    #5 0x000055abf32cb8ce in ControlDoublePrivate::setInner(double, QObject*) (this=0x55abf5bca2d0, value=0, pSender=<optimized out>) at /home/jan/Projects/mixxx/src/control/control.cpp:280
    #6 0x00007fe77335f76b in () at /usr/lib/libQt5Core.so.5
    #7 0x000055abf32cb6e3 in ControlDoublePrivate::valueChangeRequest(double) (this=this@entry=0x55abf5bca2d0, _t1=<optimized out>) at /home/jan/Projects/mixxx/build/mixxx-lib_autogen/include/moc_control.cpp:152
    #8 0x000055abf32cc628 in ControlDoublePrivate::set(double, QObject*) (this=0x55abf5bca2d0, value=<optimized out>, pSender=0x55abf5bca230) at /home/jan/Projects/mixxx/src/control/control.cpp:265
    #9 0x000055abf33988d7 in ControlObject::set(double) (value=<optimized out>, this=<optimized out>) at /home/jan/Projects/mixxx/src/control/controlobject.h:83
    #10 EngineBuffer::slotTrackLoading() (this=0x55abf5bc2250) at /home/jan/Projects/mixxx/src/engine/enginebuffer.cpp:529
    #11 0x00007fe77335f76b in () at /usr/lib/libQt5Core.so.5
    #12 0x00007fe77335f76b in () at /usr/lib/libQt5Core.so.5
    #13 0x000055abf3366e50 in CachingReaderWorker::loadTrack(std::shared_ptr<Track> const&) (this=0x55abf5bc56e8, pTrack=std::shared_ptr<Track> (use count 3, weak count 0) = {...}) at /home/jan/Projects/mixxx/src/engine/cachingreader/cachingreaderworker.cpp:136
    #14 0x000055abf3368e9d in CachingReaderWorker::run() (this=0x55abf5bc56e8) at /home/jan/Projects/mixxx/src/engine/cachingreader/cachingreaderworker.cpp:104
    #15 0x00007fe77313cfef in () at /usr/lib/libQt5Core.so.5
    #16 0x00007fe772c57259 in start_thread () at /usr/lib/libpthread.so.0
    #17 0x00007fe772b805e3 in clone () at /usr/lib/libc.so.6
    >>> p m_audible
    $1 = {
      <QAtomicInteger<int>> = {
        <QBasicAtomicInteger<int>> = {
          _q_value = {
            <std::__atomic_base<int>> = {
              static _S_alignment = 4,
              _M_i = 0
            },
            members of std::atomic<int>:
   ...

Read more...

Revision history for this message
Jan Holthuis (holthuis-jan) wrote :
Revision history for this message
Jan Holthuis (holthuis-jan) wrote :

Just happened again, same issue.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :
Download full text (7.7 KiB)

Confirmed. Backtrace suggests a race condition when terminating the test.

280/717 Test #515: AdjustReplayGainTest.AdjustReplayGainUpdatesPregain .....................................***Exception: SegFault 1.70 sec
QML debugging is enabled. Only use this in a safe environment.
Note: Google Test filter = AdjustReplayGainTest.AdjustReplayGainUpdatesPregain

Thread 1 (Thread 0x7f2aea914640 (LWP 49758)):
#0 0x0000000000000000 in ()
#1 0x00007f2b080493a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#2 0x00000000009f6c20 in ControlProxy::valueChanged(double) (this=<optimized out>, _t1=<optimized out>) at mixxx-lib_autogen/include/moc_controlproxy.cpp:164
#3 0x00007f2b080493a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#4 0x00000000009ea38d in ControlDoublePrivate::valueChanged(double, QObject*) (_t2=<optimized out>, _t1=<optimized out>, this=0x2d114d0) at mixxx-lib_autogen/include/moc_control.cpp:145
#5 ControlDoublePrivate::setInner(double, QObject*) (this=0x2d114d0, value=0, pSender=<optimized out>) at ../src/control/control.cpp:280
#6 0x00007f2b080493a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#7 0x00000000009eb1e2 in ControlDoublePrivate::valueChangeRequest(double) (_t1=<optimized out>, this=0x2d114d0) at mixxx-lib_autogen/include/moc_control.cpp:152
#8 ControlDoublePrivate::set(double, QObject*) (this=0x2d114d0, value=<optimized out>, pSender=0x2d11430) at ../src/control/control.cpp:265
#9 0x0000000000ab4e56 in ControlObject::set(double) (value=<optimized out>, this=<optimized out>) at ../src/control/controlobject.h:82
#10 EngineBuffer::slotTrackLoading() (this=0x2d093e0) at ../src/engine/enginebuffer.cpp:528
#11 0x00007f2b080493a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#12 0x00007f2b080493a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#13 0x0000000000a861c0 in CachingReaderWorker::trackLoading() (this=0x2d0c878) at mixxx-lib_autogen/include/moc_cachingreaderworker.cpp:178
#14 CachingReaderWorker::loadTrack(std::shared_ptr<Track> const&) (this=0x2d0c878, pTrack=std::shared_ptr<Track> (use count 5, weak count 0) = {...}) at ../src/engine/cachingreader/cachingreaderworker.cpp:148
#15 0x0000000000a88364 in CachingReaderWorker::run() (this=0x2d0c878) at ../src/engine/cachingreader/cachingreaderworker.cpp:103
#16 0x00007f2b07e584a6 in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#17 0x00007f2b0794b299 in start_thread () at /lib64/libpthread.so.0
#18 0x00007f2b07873353 in clone () at /lib64/libc.so.6

Thread 4 (Thread 0x7f2afeff9280 (LWP 49749)):
#0 0x00007f2b07957a8a in __futex_abstimed_wait_common64 () at /lib64/libpthread.so.0
#1 0x00007f2b079512c0 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#2 0x00007f2b07e5e01b in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /lib64/libQt5Core.so.5
#3 0x00007f2b07e58189 in QThread::wait(QDeadlineTimer) () at /lib64/libQt5Core.so.5
#4 0x0000000000a85c29 in CachingReaderWorker::quitWait() (this=<optimized out>) at ../src/engine/cachingreader/cachingreaderworker.cpp:229
#5 0x000000...

Read more...

Revision history for this message
Owen Williams (ywwg) wrote (last edit ):

I think this is because I'm doing slotLoadTrack instead of loadTrack, which waits for the track to actually load. The test is quitting before the caching reader has a chance to finish

Revision history for this message
Owen Williams (ywwg) wrote :
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :
Download full text (8.9 KiB)

Not fixed yet, happened again:

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000000003 in ?? ()
[Current thread is 1 (Thread 0x7f7237fff640 (LWP 59741))]

Thread 1 (Thread 0x7f7237fff640 (LWP 59741)):
#0 0x0000000000000003 in ()
#1 0x00007f725dadf3a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#2 0x00000000009f86b0 in ControlProxy::valueChanged(double) (this=<optimized out>, _t1=<optimized out>) at mixxx-lib_autogen/include/moc_controlproxy.cpp:164
#3 0x00007f725dadf3a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#4 0x00000000009ebe1d in ControlDoublePrivate::valueChanged(double, QObject*) (_t2=<optimized out>, _t1=<optimized out>, this=0x3665b30) at mixxx-lib_autogen/include/moc_control.cpp:145
#5 ControlDoublePrivate::setInner(double, QObject*) (this=0x3665b30, value=0, pSender=<optimized out>) at ../src/control/control.cpp:280
#6 0x00007f725dadf3a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#7 0x00000000009ecc72 in ControlDoublePrivate::valueChangeRequest(double) (_t1=<optimized out>, this=0x3665b30) at mixxx-lib_autogen/include/moc_control.cpp:152
#8 ControlDoublePrivate::set(double, QObject*) (this=0x3665b30, value=<optimized out>, pSender=0x3665a90) at ../src/control/control.cpp:265
#9 0x0000000000ab6c66 in ControlObject::set(double) (value=<optimized out>, this=<optimized out>) at ../src/control/controlobject.h:82
#10 EngineBuffer::slotTrackLoading() (this=0x365df70) at ../src/engine/enginebuffer.cpp:528
#11 0x00007f725dadf3a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#12 0x00007f725dadf3a9 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#13 0x0000000000a87fc0 in CachingReaderWorker::trackLoading() (this=0x3661428) at mixxx-lib_autogen/include/moc_cachingreaderworker.cpp:178
#14 CachingReaderWorker::loadTrack(std::shared_ptr<Track> const&) (this=0x3661428, pTrack=std::shared_ptr<Track> (use count 3, weak count 0) = {...}) at ../src/engine/cachingreader/cachingreaderworker.cpp:148
#15 0x0000000000a8a164 in CachingReaderWorker::run() (this=0x3661428) at ../src/engine/cachingreader/cachingreaderworker.cpp:103
#16 0x00007f725d8ee4a6 in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#17 0x00007f725d3e1299 in start_thread () at /lib64/libpthread.so.0
#18 0x00007f725d309353 in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7f7254a85280 (LWP 59735)):
#0 0x00007f725d30404b in munmap () at /lib64/libc.so.6
#1 0x00007f725d2957fb in free () at /lib64/libc.so.6
#2 0x0000000000ad233f in ReadAheadManager::~ReadAheadManager() (this=0x361f9e0, __in_chrg=<optimized out>) at ../src/engine/readaheadmanager.cpp:35
#3 ReadAheadManager::~ReadAheadManager() (this=0x361f9e0, __in_chrg=<optimized out>) at ../src/engine/readaheadmanager.cpp:36
#4 0x0000000000ac1b29 in EngineBuffer::~EngineBuffer() (this=0x3466dc0, __in_chrg=<optimized out>) at ../src/engine/enginebuffer.cpp:301
#5 0x0000000000ac2049 in EngineBuffer::~EngineBuffer() (this=0x3466dc0, __in_chrg=<optimized out>) at ../src/engine/enginebuffer.cpp:331
--Type <RET> for more, q to...

Read more...

Revision history for this message
Owen Williams (ywwg) wrote :

Ah, the loadTrack function waits for "istrackloaded", which returns true because the *old* track was already loaded. It doesn't actually wait to see if the *new* track is loaded. This is just a problem with signalpathtest.h. I'll fix.

Revision history for this message
Owen Williams (ywwg) wrote :
Be (be.ing)
Changed in mixxx:
status: New → Fix Committed
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/10497

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.

Other bug subscribers

Remote bug watches

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