Qt assertion failure sending events to TIO from wrong thread

Bug #1407124 reported by RJ Skerry-Ryan
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Critical
RJ Skerry-Ryan

Bug Description

Reported on the forums, reproducible:

Debug [AnalyserQueue 1]: Beat Calculation complete
Fatal [AnalyserQueue 1]: ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 110dc79d0. Receiver '' (of type 'TrackInfoObject') was created in thread 105500080", file kernel/qcoreapplication.cpp, line 539

This is caused when we delete a track's BeatGrid/BeatMap from the analyzer thread.

Oddly, setParent_helper should only be called in ~QObject when the object's parent is non-NULL and both BeatMap and BeatGrid have NULL parents.

#7 0x0000000101476fc7 in QCoreApplicationPrivate::checkReceiverThread (this=0x105566cf0, receiver=0x1bca41780) at kernel/qcoreapplication.cpp:531
#8 0x0000000101a37398 in QApplication::notify (this=0x7fff5fbff078, receiver=0x1bca41780, e=0x13656a588) at qapplication.cpp:3841
#9 0x0000000100672039 in MixxxApplication::notify (this=0x7fff5fbff078, target=0x1bca41780, event=0x13656a588) at src/mixxxapplication.cpp:138
#10 0x00000001014791d4 in QCoreApplication::notifyInternal (this=0x7fff5fbff078, receiver=0x1bca41780, event=0x13656a588) at kernel/qcoreapplication.cpp:953
#11 0x000000010147d4f4 in QCoreApplication::sendEvent (receiver=0x1bca41780, event=0x13656a588) at qcoreapplication.h:231
#12 0x000000010149a06b in QObjectPrivate::setParent_helper (this=0x1bca41e90, o=0x0) at kernel/qobject.cpp:1933
#13 0x0000000101499cdd in QObject::~QObject (this=0x1bca41d10) at kernel/qobject.cpp:931
#14 0x0000000100745308 in BeatMap::~BeatMap (this=0x1bca41d10) at src/track/beatmap.cpp:88
#15 0x00000001007453d5 in BeatMap::~BeatMap (this=0x1bca41d10) at src/track/beatmap.cpp:87
#16 0x0000000100745428 in BeatMap::~BeatMap (this=0x1bca41d10) at src/track/beatmap.cpp:87
#17 0x000000010073fed6 in BeatFactory::deleteBeats (pBeats=0x1bca41d20) at src/track/beatfactory.cpp:138
#18 0x000000010074236a in QtSharedPointer::executeDeleter<Beats, void (*)(Beats*)> (t=0x1bca41d20, d=0x10073fe30 <BeatFactory::deleteBeats(Beats*)>) at qsharedpointer_impl.h:118
#19 0x00000001007422e9 in QtSharedPointer::ExternalRefCountWithCustomDeleter<Beats, void (*)(Beats*)>::deleter (self=0x1bca423f0) at qsharedpointer_impl.h:249
#20 0x00000001004753db in QtSharedPointer::ExternalRefCountWithDestroyFn::destroy (this=0x1bca423f0) at qsharedpointer_impl.h:219
#21 0x000000010009c40a in QtSharedPointer::ExternalRefCount<Beats>::deref (d=0x1bca423f0, value=0x1bca41d20) at qsharedpointer_impl.h:341
#22 0x000000010009c3af in QtSharedPointer::ExternalRefCount<Beats>::deref (this=0x13656aa60) at qsharedpointer_impl.h:336
#23 0x000000010009c385 in QtSharedPointer::ExternalRefCount<Beats>::~ExternalRefCount (this=0x13656aa60) at qsharedpointer_impl.h:401
#24 0x000000010009c365 in QSharedPointer<Beats>::~QSharedPointer (this=0x13656aa60) at qsharedpointer_impl.h:466
#25 0x000000010009b025 in QSharedPointer<Beats>::~QSharedPointer (this=0x13656aa60) at qsharedpointer_impl.h:466
#26 0x000000010009ab42 in AnalyserBeats::finalise (this=0x110dc8700, tio=<value temporarily unavailable, due to optimizations>) at src/analyserbeats.cpp:259

RJ Skerry-Ryan (rryan)
Changed in mixxx:
importance: Undecided → Critical
status: New → Confirmed
milestone: none → 1.12.0
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

The event that is sent to the TIO is a QEvent::ChildRemoved event. I forgot that we parent the BeatGrid/BeatMap to the TIO here:
https://github.com/mixxxdj/mixxx/blob/master/src/track/beatfactory.cpp#L18

RJ Skerry-Ryan (rryan)
Changed in mixxx:
assignee: nobody → RJ Ryan (rryan)
status: Confirmed → Fix Committed
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :
Revision history for this message
Michael S. (arbeit-u) wrote :

I am nosey :-). But i must wait with testing until buildserver will start to work.

Revision history for this message
Michael S. (arbeit-u) wrote :

Test with W7/64 build 5124 over more as one hour:
Analysed over 170 flac in back. Playing with 2 decks. Pre hear songs and interupt loading song in free deck. YES it runs !

Grafik waveform has some hickups. Everytime while load file or scrolling in songlist. Not so critical because music is still playing correct. I remember (?) something read about this in other bugreport before.

Thanks ... looks gooooooood

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

Thank you for testing, Michael!

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

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.