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

midi.sendShortMsg result in segmentation fault - armhf - 2.2.4 - 2.3.1 - 2.40-alpha #10632

Closed
mixxxbot opened this issue Aug 23, 2022 · 17 comments
Milestone

Comments

@mixxxbot
Copy link
Collaborator

Reported by: mhe1234
Date: 2022-01-01T14:46:36Z
Status: Fix Released
Importance: Undecided
Launchpad Issue: lp1956144
Attachments: [mixxx debug.zip](https://bugs.launchpad.net/bugs/1956144/+attachment/5550539/+files/mixxx debug.zip), [mixxx debug 2.3.1.zip](https://bugs.launchpad.net/bugs/1956144/+attachment/5550637/+files/mixxx debug 2.3.1.zip), [mixxx debug 2.4.0-alpha.zip](https://bugs.launchpad.net/bugs/1956144/+attachment/5550678/+files/mixxx debug 2.4.0-alpha.zip), [gdb dump.txt](https://bugs.launchpad.net/bugs/1956144/+attachment/5552718/+files/gdb dump.txt)


Version 2.2.4
Raspberry pi

dpkg-query -s mixxx
Package: mixxx
Status: install ok installed
Priority: optional
Section: sound
Installed-Size: 13128
Maintainer: Debian Multimedia Maintainers <email address hidden>
Architecture: armhf
Version: 2.2.4~dfsg-1

When starting mixxx:

mixxx -platform vnc:size=1920x1280 --developer

To reproduce:

Options -> Preferences
Controllers -> Midi Through Port-0

Tick box Enabled
Load preset: Midi for light

Click apply.

Result in direct segmentation fault.

If you restart mixxx, the controller is enabled, you see debug information and resulting again in a segmentation fault.

Attachment has gdb and terminal output information

Thank you !

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-01T14:46:36Z
Attachments: [mixxx debug.zip](https://bugs.launchpad.net/mixxx/+bug/1956144/+attachment/5550539/+files/mixxx debug.zip)

@mixxxbot
Copy link
Collaborator Author

Commented by: ronso0
Date: 2022-01-01T23:45:23Z


Mixxx 2.2 doesn't receive bug fixes or support anymore.

Can you build 2.3 (or main branch 2.4) for the Pi?

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-02T10:13:23Z
Attachments: [mixxx debug 2.3.1.zip](https://bugs.launchpad.net/mixxx/+bug/1956144/+attachment/5550637/+files/mixxx debug 2.3.1.zip)


Yes,

2.3.1 -> 2.3.1-30-gecab893971 platform Linux ARM

Options -> preferences
Controllers -> Midi Through Port-0
Load Mapping -> Midi for light
Apply -> Crash

main release building right now

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-02T17:01:53Z
Attachments: [mixxx debug 2.4.0-alpha.zip](https://bugs.launchpad.net/mixxx/+bug/1956144/+attachment/5550678/+files/mixxx debug 2.4.0-alpha.zip)


2.4.0-alpha-pre platform Linux ARM

Options -> preferences
Controllers -> Midi Through Port-0
Load Mapping -> Midi for light
Apply -> Crash

All versions gave segmentation faults.

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-02T17:31:27Z


#0  0xb534b1b0 in XForceScreenSaver () at /lib/arm-linux-gnueabihf/libX11.so.6
mixxxdj/mixxx#4910  0xb534b230 in XResetScreenSaver () at /lib/arm-linux-gnueabihf/libX11.so.6
mixxxdj/mixxx#4911  0x004df488 in mixxx::ScreenSaverHelper::triggerUserActivity() () at /code/src/util/screensaver.cpp:177
mixxxdj/mixxx#4912  0x006dd174 in Controller::triggerActivity() (this=0xa68e4a60) at /code/src/controllers/controller.cpp:112
mixxxdj/mixxx#4913  0x00907540 in MidiController::receivedShortMessage(unsigned char, unsigned char, unsigned char, mixxx::Duration)
    (this=this@entry=0xa68e4a60, status=status@entry=144 '\220', control=<optimized out>, value=<optimized out>, timestamp=...) at /code/src/controllers/midi/midicontroller.cpp:234
mixxxdj/mixxx#4914  0x006feb3c in PortMidiController::poll() (this=0xa68e4a60) at /code/src/controllers/midi/portmidicontroller.cpp:155
mixxxdj/mixxx#4915  0x0021bcd8 in ControllerManager::pollDevices() (this=0x2a13ae4) at /code/src/controllers/controllermanager.cpp:362
mixxxdj/mixxx#4916  0xb2ee9044 in  () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
mixxxdj/mixxx#4917  0xb2eedc2c in QTimer::timeout(QTimer::QPrivateSignal) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
mixxxdj/mixxx#4918  0xb2edd468 in QObject::event(QEvent*) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
mixxxdj/mixxx#4919 0xb5b60534 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/arm-linux-gnueabihf/libQt5Widgets.so.5
mixxxdj/mixxx#4920 0xb2ea9c2c in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
mixxxdj/mixxx#4921 0xb2f0fb80 in QTimerInfoList::activateTimers() () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
mixxxdj/mixxx#4922 0xb2f105b0 in  () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
mixxxdj/mixxx#4923 0xb1ea172c in g_main_context_dispatch () at /lib/arm-linux-gnueabihf/libglib-2.0.so.0

@mixxxbot
Copy link
Collaborator Author

Commented by: ronso0
Date: 2022-01-02T23:18:11Z


I can't comment on the actual root issue here (how user data can crash Mixxx) but it seems the script trying to stop nonexistant timers may be the trigger.

Please try to reproduce the crash with the overhauled script MIDI-Output for lightcontrol script version from the forums
https://mixxx.discourse.group/t/midi-output-for-lightcontrol/13224/37

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-03T09:05:12Z


Tested on my 2.3.1-30-gecab893971 build. Forgot to save the previous deb (2.4 alpha).

The updated script changed the behavior. Instead of crashing when hitting apply. It now crash when starting the song.

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-03T13:46:29Z


Did some extra digging, if i comment all midi.sendShortMsg out, script is not crashing.

midi.sendShortMsg( 1, 0x32, 0x64);

it result in

Warning [Controller]: Error sending short message "Midi Through Port-0: outgoing: status 0x1"
Warning [Controller]: PortMidi error: PortMidi: `Invalid MIDI message Data'

if i change it in:
midi.sendShortMsg(0x8F + 1, 0x32, 0x64);

Debug [Controller]: Midi Through Port-0: t:95512 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x32, val 0x64
No protocol specified

The No protocol specified is displayed, just before segmentation fault.

I dont think problem is in the Midi for light script.

// edit

if i use a command from other script:
midi.sendShortMsg(0x90,0x2A,0x00);

Just to be sure if the format is correct, it crashes.

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-04T13:34:36Z


Allright, fiddling more around.

Instead of Selecting MIDI for light with Midi Through Port-0 result in segmentation fault Edit

The title should be changed to:

midi.sendShortMsg result in segmentation fault.

@mixxxbot
Copy link
Collaborator Author

Commented by: JoergAtGithub
Date: 2022-01-08T08:37:52Z


You could try to comment out the line Controller::triggerActivity() in /code/src/controllers/controller.cpp:112
This function just prevents that the screen saver occurs. Does it crash without this line too?

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-08T16:07:17Z


Hi,

Recompiled the 2.3.1 version.

Same result as described before.

Thank you

@mixxxbot
Copy link
Collaborator Author

Commented by: Pegasus-RPG
Date: 2022-01-08T17:22:46Z


That piece of information and your last back trace suggests this may be an issue with your video driver or within XWindows. Can you see if there are any updates for both on your system and re-test? Can you get a new back trace with Controller::triggerActivity() commented out? Thank you for your help!

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-08T17:32:52Z


I am starting mixxx without xwindows:

mixxx -platform vnc:size=1920x1280 --developer --controllerDebug --logLevel debug

Will make new back trace.

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-08T18:45:11Z
Attachments: [gdb dump.txt](https://bugs.launchpad.net/mixxx/+bug/1956144/+attachment/5552718/+files/gdb dump.txt)


I think inside midicontroller.cpp the two triggerActivity() should also be commented out..

// compiling now.

@mixxxbot
Copy link
Collaborator Author

Commented by: mhe1234
Date: 2022-01-08T19:12:36Z


Can confirm, that with removing the other two triggerActivity, it isnt segfaulting anymore.

@mixxxbot
Copy link
Collaborator Author

Commented by: uklotzde
Date: 2022-01-18T23:52:03Z


#4635

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 2.3.2 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant