crash deleting EffectState after starting up with an effect unit assigned to multiple input channels

Bug #1740531 reported by Stefan
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Critical
Be

Bug Description

I build current master on github (last commit https://github.com/mixxxdj/mixxx/commit/310e459b1979cab5950bc76140e9b71adab223ce)

started Mixxx, selected Skin Shade and enabled the Effects via "FX" Button.

If I now switch the selected effect on effectunit 2 (the right side) Effect 1 by pressing one of the arrows of Effect 1, followed by pressing any of the arrows of Effect 1/2 in effectunit 1 or 2 mixxx crash with a "segmentation fault".

In fact after you pressed one's one of the two arrows of Effect 1 of effectunit 2 all buttons/sliders of all effects units will crash mixxx..

back-trace:
https://www.pastebin.ca/3952987

This only appears with Skin Shade, as the other Skins have different approaches to change the effects.

With mixxx 2.0 this doesn't happens.

running on Linux x64
Kernel 4.10.0-42-generic #46~16.04.1-Ubuntu
gcc v5.4.0 20160609
scons v2.4.1

Tags: crash
Revision history for this message
Stefan (nopeppermint) wrote :

just compiled branch 2.1, it also happens with last commit (https://github.com/mixxxdj/mixxx/commit/adf8d4bfe1e2a1bd6af69524cb04da1c78ddb598)

In the new back-trace you find as well some "SKIN ERROR" they were here also before, but I didn't copied them to pastebin.

https://pastebin.ca/3953020

Be (be.ing)
Changed in mixxx:
status: New → Confirmed
milestone: none → 2.1.0
importance: Undecided → Critical
summary: - mixxx 2.1 beta, skin Shade, crash on second effect change
+ crash deleting GraphicEQEffectGroupState when graphic EQ effect is
+ loaded from effects.xml
Revision history for this message
Be (be.ing) wrote : Re: crash deleting GraphicEQEffectGroupState when graphic EQ effect is loaded from effects.xml

Can you attach ~/.mixxx/effects.xml?

Revision history for this message
Be (be.ing) wrote :

This seems to happen whenever either the graphic or parametric EQ effects are loaded from effects.xml. I don't know why it doesn't happen when those effects are not loaded on startup...

Revision history for this message
Be (be.ing) wrote :

Ah, actually the problem seems to be when starting up with an effect unit assigned to one of the crossfader buses..

Be (be.ing)
summary: - crash deleting GraphicEQEffectGroupState when graphic EQ effect is
- loaded from effects.xml
+ crash deleting EffectState after starting up with an effect unit
+ assigned to a crossfader bus
Revision history for this message
Be (be.ing) wrote : Re: crash deleting EffectState after starting up with an effect unit assigned to non-deck channel and a deck

I think I have identified exactly the conditions to reproduce this. On startup, an effect unit must:
1. Load an effect from effects.xml
2. Be routed to any deck
3. Be routed to any non-deck input. This could be a special bus like a crossfader bus or a non-deck EngineChannel like an auxiliary or mic input.

Changed in mixxx:
assignee: nobody → Be (be.ing)
summary: crash deleting EffectState after starting up with an effect unit
- assigned to a crossfader bus
+ assigned to non-deck channel and a deck
Revision history for this message
Stefan (nopeppermint) wrote :

>> attach ~/.mixxx/effects.xml

https://www.sendspace.com/file/67mtxp

Revision history for this message
Stefan (nopeppermint) wrote :

I now deleted my directory ~/.mixxx/effects.xml
and now I do no longer have this crash...

Revision history for this message
Stefan (nopeppermint) wrote :

to be precise i deleted the whole ~/.mixxx directory

Revision history for this message
Stefan (nopeppermint) wrote :

now after some effects loaded again a crash

https://pastebin.ca/3953080

https://www.sendspace.com/file/4itulx

attached the selected Effects (in all 4 Effect units) in Tango, after this is switched to Shade (which only has two effect units)

a second time the crash Error message was different:

https://pastebin.ca/3953082

let me know if you need something else

Revision history for this message
Stefan (nopeppermint) wrote :

and here the tango screenshot

Revision history for this message
Be (be.ing) wrote :

Did you try to enable effects within Shade since deleting all of ~/.mixxx? Note that the state of the routing switches is stored in ~/.mixxx/mixxx.cfg, not ~/.mixxx/effects.xml.

Revision history for this message
Be (be.ing) wrote :

Currently Shade only shows the routing switches for the left and right crossfader buses but no other skins show those yet. On startup, if there are no states set for the deck assignment switches, unit 1 will be assigned to deck 1, unit 2 to deck 2, and so on, but the deck assignment switches are not implemented in Shade.

Revision history for this message
Stefan (nopeppermint) wrote :

<Did you try to enable effects within Shade since deleting all of ~/.mixxx? Note that the state of the routing switches is stored in ~/.mixxx/mixxx.cfg, not ~/.mixxx/effects.xml.

My steps:
1. delete ~.mixxx completely with "rm -rf ~.mixxx/
2. gdb ./mixxx
3. (gdb) set height 0
4. (gdb) run
5. mixxx dialog to select library directory
6. mixxx starts with skin latenight
7. switch to skin shade
8. select some effects
9. switch to skin Tango, enable fx 3/4
10 switch back to Shade, change effects
everything ok till here, so I decided to do a restart of mixxx, and then after two button pressed, a crash happend again.

https://www.pastebin.ca/3953307

I see some interesting lines in the log:

during the shutdown of mixxx, I pressed the exit Button on the top right (before the crash):
<Warning [LibraryScanner 1]: QSqlDatabasePrivate::removeDatabase: connection 'MIXXX-2' is still in use, all queries will cease to work.

but then:
<[Inferior 1 (process 4671) exited normally]

Then during startup (after which I can crash mixxx with two effect changes):

<(gdb) run
<Starting program: /home/stefan/mixxx_master/mixxx/mixxx
<Warning [Main]: Configuration file is at version "2.0.0-release" instead of the <current 2.1.0-beta1

Be (be.ing)
summary: crash deleting EffectState after starting up with an effect unit
- assigned to non-deck channel and a deck
+ assigned to multiple input channels
Revision history for this message
Be (be.ing) wrote :

I figured out what is causing this. EffectChain::enableForInputChannel keeps reusing the same array for EffectStates and putting a pointer to this on the effects MessagePipe. This assumes that the engine has a chance to process the message to load the states by calling EffectProcessorImpl::loadStatesForInputChannel before the next call to EffectChain::enableForInputChannel. On startup, before the engine starts, this assumption is not true. The result is that EffectProcessorImpl ends up storing pointers to the same EffectStates for multiple input channels. This causes a crash when ~EffectProcessorImpl tries to delete the EffectStates for the second input channel because the EffectState has already been deleted when deleting the EffectStates for the first input channel. The solution is to decouple the array of EffectStates for the MessagePipe from the EffectChain and send a new array for each ENABLE_EFFECT_CHAIN_FOR_INPUT_CHANNEL message.

Revision history for this message
Be (be.ing) wrote :
Be (be.ing)
Changed in mixxx:
status: Confirmed → In Progress
Revision history for this message
Be (be.ing) wrote :
Be (be.ing)
Changed in mixxx:
status: In Progress → Fix Committed
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/9033

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.