Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash when changing effect unit routing #9331

Closed
mixxxbot opened this issue Aug 23, 2022 · 16 comments
Closed

crash when changing effect unit routing #9331

mixxxbot opened this issue Aug 23, 2022 · 16 comments

Comments

@mixxxbot
Copy link
Collaborator

Reported by: Be-ing
Date: 2018-06-07T03:00:55Z
Status: In Progress
Importance: Critical
Launchpad Issue: lp1775497
Attachments: gdb.txt, gdb1.txt, gdb2.txt, gdb3.txt, gdb.txt, gdb.txt


I experienced a crash disabling the routing switches for effect units. I am not sure what state I started Mixxx with. I think I might not have had any state saved in mixxx.cfg for the routing switches because Mixxx started with the default routings (deck 1 to effect unit 1, deck 2 to effect unit 2...). I haven't figured out how to reproduce this yet, but I'll keep trying to figure it out...

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2020-05-09T07:01:28Z


Does this still happen with Mixxx 2.3 alpha?

@mixxxbot
Copy link
Collaborator Author

Commented by: ehmic
Date: 2021-04-05T15:03:32Z


I think while creating mappings for my self-built controller I may have experienced the same, or at least a related issue/crash.

Mixxx version in use is the latest 2.3 beta
My default routing for each deck is "crossfader bus through effect unit" (so FX L and FX R enabled)

For each deck I created a button-mapping which does the following if pressed (here for Deck1):

engine.setValue("[EffectRack1_EffectUnit1]", "group_[Channel1]_enable", 1);
engine.setValue("[EffectRack1_EffectUnit1]", "group_[BusLeft]_enable", 0);
engine.setValue("[EffectRack1_EffectUnit1_Effect3]", "enabled", 1);

For the sake of completeness - EffectRack1_EffectUnitX_Effect3 is an echo effect with the following same parameters for each deck:

Time: 0.5
Feedback: 0.7
Ping Pong: 0
Feedback: 0.7

On releasing the button all changes are reverted:

engine.setValue("[EffectRack1_EffectUnit1]", "group_[Channel1]_enable", 0);
engine.setValue("[EffectRack1_EffectUnit1]", "group_[BusLeft]_enable", 1);
engine.setValue("[EffectRack1_EffectUnit1_Effect3]", "enabled", 0);

The setup seemed to work fine, but after a while of just playing around (pressing the buttons for each deck randomly) Mixxx crashed due to a "segmentation fault" or "memory access violation" - the original german message is: Speicherzugriffsfehler (Speicherabzug geschrieben).

This issue is reproducible, even without any tracks loaded (with empty decks) - start Mixxx and use the above-mentioned controller mapping. Usually after 10-100 button presses the crash happens.

I was not able to observe a certain behaviour like "crash happens only if you press buttons for each deck simultaneously" or "if you press button long enough, for x seconds" or similar.

Hope this helps to identify the problem!

Happy Easter everyone!

@mixxxbot
Copy link
Collaborator Author

Commented by: ehmic
Date: 2021-04-20T11:58:49Z
Attachments: gdb.txt


Just learned that I could have used used gdb for a more helpful bug-report. Sorry!
Attached you now may find its output. 
Still not sure if the problem is related to this bug report, especially when noticing all the other warnings/errors in the debugger output.
So please forgive me if not, just trying to help ;D 

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2021-04-21T13:23:51Z


Thank you very much.

malloc(): unsorted double linked list corrupted

Happens if you have writen over the borders of a memory region allocated on the heap but not pass the borders of the page, leading to a real "segmentation fault". The issue here is that the crash is a symptom of a access violation that has happened before.

Can you install the debug symbols and try to reproduce a real segfault?

If you are using our ppa, you can install it via

Adding

deb http://ppa.launchpad.net/mixxx/mixxxbetas/ubuntu YOUR_UBUNTU_VERSION_HERE main/debug

to

/etc/apt/sources.list.d/mixxx-ubuntu-mixxxbetas-YOUR_UBUNTU_VERSION_HERE.list

sudo apt-get update
sudo apt-get install mixxx-dbgsym

Else you may build mixxx from source
https://github.com/mixxxdj/mixxx/wiki/compiling%20on%20linux

@mixxxbot
Copy link
Collaborator Author

Commented by: ehmic
Date: 2021-04-21T17:55:47Z
Attachments: gdb1.txt


You're welcome
Thanks for your explanation.

Ok, will try to help.
It just so happened that I built 2.4.0-alpha-pre today anyhow and was also able to reproduce the issue with that specific version.
So after noticing your comment I recompiled mixxx with the CMake flags '-DCMAKE_BUILD_TYPE=Debug -DDEBUG_ASSERTIONS_FATAL=ON' in the hope that the debug symbols were included this way.

Started mixxx manually (compiled it without installation) with 'gdb --args ./mixxx -debugAssertBreak'
Typed 'thread apply all bt' into the gdb command prompt after the 'segfault' and copied the results. I then repeated the procedure two more times. First time because I forgot 'set height 0' and wanted to see the difference. The second time I disabled the 'Bessel4' effect on both decks, which I usually use for my MIDI controller. Just wanted to be sure that the self created scripts for said effect were not the cause of the 'segfault'. Turned out they were not.

So now I got three debugger outputs and tried to make sense out of them, or to learn something. I was expecting that a certain problem would stand out / could be identified, or isolated by the debugger, but the output for each run seems to be slightly different. The last one even indicates that a file is missing? Hope that the 'segfault' does not stem from a misconfiguration here on my computer.

I'm now posting three instead of just one compiler outputs. Hope that is ok.

@mixxxbot
Copy link
Collaborator Author

Commented by: ehmic
Date: 2021-04-21T17:57:13Z
Attachments: gdb2.txt


Run #⁠2

@mixxxbot
Copy link
Collaborator Author

Commented by: ehmic
Date: 2021-04-21T17:57:37Z
Attachments: gdb3.txt


Run #⁠3

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2021-04-21T20:35:06Z


gdb1.txt happens here:

void pauseFilter() {

This function is only accessing it's objects memory, a memory issue here is unlikely.
So the whole object "m_low2" might be void here: https://github.com/mixxxdj/mixxx/blob/main/src/effects/builtin/lvmixeqbase.h#L189
It is stored here:
EffectSpecificState* pState = m_channelStateMatrix[inputHandle][outputHandle];

gdb2.txt
gdb3.txt

is the same cause. An invalid group state. I will have a look.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2021-04-23T07:20:20Z


This might be an idea:
https://github.com/mixxxdj/mixxx/pull/2618/files#r588945308

@mixxxbot
Copy link
Collaborator Author

Commented by: ehmic
Date: 2021-04-23T13:52:44Z
Attachments: gdb.txt


I presume you mean it is a good idea to test whether the issue is still present in 'Be-ing:effects_refactoring'?
Ok, tried that. But with all this git-stuff being new to me, please let me explain what I did, more or less step-by-step. This way we can be sure that this test was meaningful.

'git clone https://github.com/Be-ing/mixxx.git .'
'cd mixxx'
'git switch effects_refactoring'
'cmake -S . -B ../build -DCMAKE_BUILD_TYPE=Debug -DDEBUG_ASSERTIONS_FATAL=ON'
'cmake --build ../build --parallel 8'
'cd ../build'
'gdb --args ./mixxx -debugAssertBreak'

Then I checked the version under 'Help->About'.
Version was '2.4.0-alpha-pre (build effects_refactoring r7086)', so I assumed everything worked as expected.

Switched interface from 'Shade' to 'Tango' and started experimenting.

I had the impression that it took me way longer to reproduce, but finally can confirm that the (or an) issue still exists.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2021-04-23T15:17:45Z


This was more like a remainder to myself.

But testing is also a good idea.
Your git sequence is looking good.
Thank you for confirming.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2021-05-19T22:55:51Z


This PR should lint the issue
#3882

@SchleichMichel: please verify if it makes a difference to you.

@mixxxbot
Copy link
Collaborator Author

Commented by: uklotzde
Date: 2021-05-20T22:12:18Z


Merged

@mixxxbot
Copy link
Collaborator Author

Commented by: ehmic
Date: 2021-06-04T13:47:56Z
Attachments: gdb.txt


Sorry, I'm a little bit late here. E-Mail notifications were disabled, so I saw your request just yesterday.

Checked version 2.3-beta-4120-g9e7e0c7066 today and, while this version seems to be more stable, I was unfortunately still able to crash Mixxx when experimenting with effects. The error seems to be different though.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2021-12-19T11:44:52Z


I have no longer work in progress, sorry.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 2.4.0 milestone Aug 24, 2022
@mixxxdj mixxxdj deleted a comment from Victor07877 Oct 30, 2022
@daschuer
Copy link
Member

This should be fixed here: #4707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants