Hang on up/down of note tied to itself

• Jun 19, 2014 - 19:24
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Ubuntu 14.04, GIT commit: 2c43586

1) new score
2) note input, "7 C +" to create tied whole notes
3) exit note input mode
4) double click tie, drag end point back to first note & release when it highlights
5) exit edit mode
6) click first note
7) up or down

Result: hang

The code at the beginning of Selection::uniqueNotes that tries to find the beginning of the tie is in an infinite loop, because tieBack points back to itself.

Easy enough to fix here, but I wonder where else there might be similar problems?

Maybe we should simply disable creating these sorts of ties. On the other hand, I'm still wondering is it is supposed to be supported to create one-sided ties. It's a common request, it more or less is supported in the code, and it seems we used to have it exposed in the GUI. Ties to oneself could be a substitute for a true one-sided tie.

Although this is a hang, which is essentially a crash-in-waiting, I don't know that it needs to be critical, as few will encounter this unless we choose to document this as an official way to simulate one-sided ties.


Comments

What we need to do is decide if we intend to support one-side ties, and whether this will be a supported way of creating them. If yes, we fix the issue. if no, we disallow a note to be tied to itself in the first place.

But most users will never encounter this, so compared to other crashes it's much *less* critical.

Note that it's probably not only a tied note to itself but it could be note 1 tied to note2 tied to note 3 tied to note 1... which will also cause a loop here and probably other issues...

Yes, indeed, and more work to detect. Easy fix would be to detect not an actual loop but any "backwards" tie - one where the end tick is not greater than the start. But still, it would help to clarify what we intend to actually support.

BTW, I'm pretty sure the code I added to deal with ties in repitch mode does the same thing; I remember being aware of this at the time.