Crash when adding tempo text to a beat with no elements for some staff with linked part

• Oct 21, 2014 - 18:46
Type
Functional
Severity
S2 - Critical
Status
closed
Project

When adding more than one tempo to a measure, musescore 2 beta crashes. This problem has been repeated and happens with both the UI and the drop down menu options for setting tempo.


Comments

Status (old) active needs info

If it crashes, it's critical, but I can't reproduce this. Could be something specific to the score you are working with or exactly where you are adding the tempo markings. Please post the score that is crashing for you, and the exact series of steps to reproduce the crash.

For me, its happening in measure 99 at the end of the current score (I threw in a rehearsal mark). I am attempting to create an audible ritardando but when I click beat 2 and add a second tempo the program crashes

Attachment Size
College_Symphony.mscz 98.1 KB
Title Musescore 2 beta crashes when multiple tempos added in a single bar Crashes when adding tempo text to a beat with no elements for some staff with linked part
Status (old) needs info active

Confirmed. The key to reproducing this is having a score with linked staves, where some staff does not have a chord or rest on the beat at which you are trying to add the tempo mark. This can be reproduced from scratch as following:

1) new score for two instruments
2) first measure top staff note entry: 6 C D (two half notes)
3) exit note entry
4) generate parts
4) click second half note
5) Alt+T to add tempo text

Result: crash

Title Crashes when adding tempo text to a beat with no elements for some staff with linked part Crash when adding tempo text to a beat with no elements for some staff with linked part

Point of reference - it doesn't crash if you add a rehearsal mark or system text at 5) in my steps above, but it doesn't work either. The marking gets added to the score and any parts that have a note at that position, but the mark isn't added to parts that have nothing at that position. This appears to be a simple matter of a segment not being created when necessary, which is mostly harmless - it just causes the element to not appear. But it crashes for tempo because the code is trying to add this null segment to the tempo map.

The fix appears to be as simple as changing a particular call from findSegment() to getSegment(). Assuming it pans out, I'll be submitting a PR soon.

I was just experiencing the same problem (well, a seemingly random crash when adding a temp text) and can confirm that this PR fix it for me.