Mixxx crashes while analyzing crate

Bug #1744550 reported by Rudolf Gallander
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Critical
Unassigned

Bug Description

I just had a crash while analyzing a crate (--> Analyze entire Crate).

What I did:
* Analyze crate (everything went fine)
* Play around with some tracks
* Stop both decks
* Start analyzing another crate
--> Crash

After the crash I tried to analyze the same crate again. This time it went through without crashing.

***********************
* EXCEPTION DETAILS *
***********************

DetailID = 1
 Count: 1
 Exception #: 0XC0000005
 Stack:
  mixxx!QMutex::lock+0xf
  mixxx!Track::isDirty+0x5c [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\track\track.cpp @ 826]
  mixxx!BaseTrackCache::replaceRecentTrack+0x55 [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\library\basetrackcache.cpp @ 185]
  mixxx!BaseTrackCache::refreshRecentTrack+0xbd [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\library\basetrackcache.cpp @ 161]
  mixxx!BaseTrackCache::getRecentTrack+0x3c [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\library\basetrackcache.cpp @ 151]
  mixxx!BaseTrackCache::data+0xff [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\library\basetrackcache.cpp @ 425]
  mixxx!BaseSqlTableModel::getBaseValue+0x221 [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\library\basesqltablemodel.cpp @ 1021]
  mixxx!BaseSqlTableModel::data+0x9b [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\library\basesqltablemodel.cpp @ 646]
  mixxx!QModelIndex::data+0x48 [e:\mixxx\buildserver\2.1-j00023-x64-release-static-1b6c054-minimal\qt-4.8.7\src\corelib\kernel\qabstractitemmodel.h @ 402]
  mixxx!BaseSqlTableModel::data+0x160 [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\library\basesqltablemodel.cpp @ 728]
  mixxx!QModelIndex::data+0x48 [e:\mixxx\buildserver\2.1-j00023-x64-release-static-1b6c054-minimal\qt-4.8.7\src\corelib\kernel\qabstractitemmodel.h @ 402]
  mixxx!QStyledItemDelegate::initStyleOption+0x374
  mixxx!QStyledItemDelegate::paint+0x5e
  mixxx!QTableViewPrivate::drawCell+0x1c5
  mixxx!QTableView::paintEvent+0xa46
  mixxx!QWidget::event+0x685
  mixxx!QAbstractScrollArea::viewportEvent+0x64
  mixxx!QAbstractItemView::viewportEvent+0x454
  mixxx!QCoreApplicationPrivate::sendThroughObjectEventFilters+0x83
  mixxx!QApplicationPrivate::notify_helper+0xf1
  mixxx!QApplication::notify+0x1be5
  mixxx!MixxxApplication::notify+0x50c [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\mixxxapplication.cpp @ 181]
  mixxx!QCoreApplication::notifyInternal+0x91
  mixxx!QWidgetPrivate::drawWidget+0x880
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetPrivate::paintSiblingsRecursive+0x676
  mixxx!QWidgetPrivate::drawWidget+0xa37
  mixxx!QWidgetBackingStore::sync+0xbff
  mixxx!QWidget::event+0x9dc
  mixxx!QApplicationPrivate::notify_helper+0x105
  mixxx!QApplication::notify+0x1be5
  mixxx!MixxxApplication::notify+0x50c [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\mixxxapplication.cpp @ 181]
  mixxx!QCoreApplication::notifyInternal+0x91
  mixxx!QCoreApplicationPrivate::sendPostedEvents+0x283
  mixxx!qt_internal_proc+0x298
  USER32!CallWindowProcW+0x4dd
  USER32!DispatchMessageW+0x1af
  mixxx!QEventDispatcherWin32::processEvents+0x412
  mixxx!QGuiEventDispatcherWin32::processEvents+0x1d
  mixxx!QEventLoop::exec+0x1ee
  mixxx!QCoreApplication::exec+0xe0
  mixxx!`anonymous namespace'::runMixxx+0xf6 [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\main.cpp @ 53]
  mixxx!main+0x37a [e:\jenkins\workspace\v2.1\mixxx-2.1-release\architecture\amd64\platform\windows\src\main.cpp @ 125]
  mixxx!__scrt_common_main_seh+0x11d [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 253]
  KERNEL32!BaseThreadInitThunk+0x14
  ntdll!RtlUserThreadStart+0x21

Windows 10, 64 bit version
Intel Core i5 @ 1.60 Ghz, 8GB RAM, Intel HD Graphics 3000
Controller: Reloop Beatmix 2 Mk2

mixxx-2.1.0-beta1-2.1-git6486-release-x64

Revision history for this message
Rudolf Gallander (akkarin169) wrote :
Revision history for this message
Rudolf Gallander (akkarin169) wrote :
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

I had a similar crash just recently and thought it was caused by using an inconsistent, local development version. Your report now confirms that there actually is an issue!

Changed in mixxx:
importance: Undecided → Critical
assignee: nobody → Uwe Klotz (uklotzde)
milestone: none → 2.1.0
status: New → Confirmed
Changed in mixxx:
status: Confirmed → In Progress
Revision history for this message
Rudolf Gallander (akkarin169) wrote :

I just had a similar crash again (stack trace looks the same). This time I didn't analyze anything. The crash occurred, when I randomly loaded a song into a deck (which had previously been analyzed).

Revision history for this message
Rudolf Gallander (akkarin169) wrote :

And another one. This time it crashed, when I scrolled through my library with the song selection wheel on my controller

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Really complicated. It is supposed to be a race condition that is triggered
- when the last shared_ptr reference is dropped,
- while a new reference is requested from the cache, and
- before the expired reference has been evicted from the cache.

First I was afraid that this inevitable race condition couldn't be fixed within the current design. But then I found a way how to safely deal with it. I want to prove my assumptions with tests before publishing the fix. Not a dirty workaround, but rather an evolutionary improvement!

I also found a memory leak for temporary track objects that don't get deleted when using QObject::deleteLater().

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Confirmed by multi-threaded stress testing. A single-threaded and repeatable test with mocked parts would be more appropriate, but I think we can afford 90 ms and somehow unpredictable results during each test run. The new test will never fail, unless something is wrong or broken.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :
Revision history for this message
jus (jus) wrote :

2.1.0-beta1 git 2.1 r6493
macOS 10.13.2

I can reliable reproduce a crash while analyzing under some similar circumstances.

1. Load Track 1 to Deck A that never has been analyzed before, and start playback
2. While analysis on Track 1 is running, drop another track (Track 2) that never has been analyzed before, to the ANALYZE item in the library view.
3. Switch to the ANALYZE view
4. As soon as the status display in the ANALYZE view goes over 99% == Crash

Backtrace
https://pastebin.com/y0MLMmEP

Changed in mixxx:
status: In Progress → Fix Committed
Revision history for this message
Foss-4 (foss-4) wrote :

@rudolf @jus where you able to test recent beta builds to very the fix?
http://downloads.mixxx.org/builds/2.1/release/

Revision history for this message
Rudolf Gallander (akkarin169) wrote :

Yes, I have been using the latest beta builds for the past couple of weeks and did not have in problems so far. It seems to be very stable now :)

Revision history for this message
rafaelfrench (rafaelfrench) wrote :

Same for me. No crash any more from several beta builds.

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/9097

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.