dsacre/mididings

mididings crashes on ARM

Closed this issue · 4 comments

I tried to run mididings on my RaspberryPi. When I use a script which contains scenes, it crashes as soon as it gets any events:

# cat crash.py 
from mididings import *

run(
    scenes = {
        0:  Scene("Test Scene",
                Transpose(3) >> Channel(2)
            ),
    },
)
# mididings -f crash.py &
[1] 256
# aconnect -l
(...)
client 20: 'nanoPAD' [type=kernel]
    0 'nanoPAD MIDI 1  '
client 128: 'mididings' [type=user]
    0 'in_1            '
    1 'out_1           '
# aconnect 20:0 128:0
(after pressing a pad:)
[1]+  Segmentation fault      (core dumped) mididings -f crash.py

This doesn't happen in scripts which don't contain scenes.
I uploaded the core dump here: http://akling.org/tmp/core.mididings.0.5d87128af0374910a869ef16357bd834.256.1412381814000000.xz

I forgot to say, this happens both with stable version and the version I compiled from git last month (mididings 2014+reafd692, using Python 3.4.1).

I can reproduce the problem with your crash.py script, but the issue is not ARM specific. The crash is a result of the script using scene number 0. At mididings default settings (data_offset = 1), valid scene numbers start at 1. I'll fix the code so it produces a proper error message instead of just segfaulting.

By the way, I don't think a core dump can be analyzed without the corresponding executables/libraries from which it was produced. Often a stack trace of the crash is all that's needed to figure out where the problem is.

Thanks for your help!
I made a pull request to add this to the documentation.

Thanks! I merged your pull request, and also fixed the argument checking so that your example now results in this error message:

ValueError: invalid value for parameter 'scenes' of function run():
scene number 0 is out of range