Closing a file after multiple delete of ties in file imported from MIDI causes crash

• Oct 13, 2015 - 21:44
Reported version
S2 - Critical

MS 2.0.2 / Win 7

1. Import the attached MIDI file. In MIDI import panel change "Max Voices" to "2" but leave other settings as default. Then press "Apply".

2. Click on a note tie, then right-click and chose "Select all similar elements." Then press "Delete" to delete all (selected) note ties.

3. Close the file (by clicking on the cross in the file tab). Chose "Discard" (but it probably makes no difference to the outcome if you save).

The program crashes.

Attachment Size
delete_ties_crash.mid 5.77 KB


Reproduced in Ubuntu nightly 6931c7f

Crash seems to happen for any MIDI file, regardless of the "Max Voices" setting.

Debug output:

RemoveElement::cleanup: delete 1 Tie
RemoveElement::cleanup: delete 1 Tie
[last line repeated many times...]
Segmentation fault (core dumped)
Title Closing a file after multiple delete of ties causes crash Closing a file after multiple delete of ties in file imported from MIDI causes crash

I can confirm the original bug andf that max voices is not relevant. However, it does not seem to happen for any MIDI file - others I tried work fine. Not sure what the trigger might turn out to be. But I am assuming for now it is specific to import of MIDI files.

I should add, this crash is not a rare event: it occurs frequently if the imported MIDI files contain a lot of note ties to begin with. Even after recovering from the first crash it is possible to crash the program again if you generate a lot of extra ties, delete them, then close the file.

Another one, with related/similar steps.

1) Load this MIDI file: 009_fantasia_milano.mid. In the import panel: change "Max Voices" to "2" -> Apply

2) Right-click on a tie -> Select -> all similar elements -> Cut -> Apply -> Save

Result: crash

- The workaround to avoid the crash is to save the score (Save as) just after the step #1
At the reopening, you can delete the ties.