Introduce a time signature in a measure which the Actual duration is exactly identical leads to corruption/crash

• Dec 25, 2016 - 19:35
Type
Functional
Severity
S2 - Critical
Status
closed
Regression
No
Workaround
No
Project
Tags

2.0.3 3c7a69d (and currents 2.1 dev. bacccc4, and 3.0 dev. 4fc5d47/ Windows7

Steps :

1) "My First Score"

2) In a measure as you want (except the first one), let's say measure 6: right-click -> Measure Properties

3) Change the actual duration eg to 2/4 -> Ok

4) add (double-click, drag and drop, no matter) the corresponding time signature, ie 2/4, in this same measure 6
5) enter notes, eg many quarter notes, into this measure (not necessary) and into the following measures (necessary, but knowing the issue is already in place).

- You observe you can enter four beats (as with the initial time signature) into these following measures.
This is the main point.

6) Save -> Close

7) Reload

The test file at this step: test time sig actual.mscz

Result: corruption warning: from measure 7: expected 2/4, found 4/4

image corruption.jpg


Comments

Additional notes :

- A) Same result if you add the time signature 2/4 to the measure 6 not immediatly (ie just after the step 3 : change Actual duration).
In other words : after entering notes. And then add this time signature in measure 6 (before the step #6 : save/reload).

Or, even after save/reload the score, and by adding the time signature in measure 6 at this moment. Same result (after a new save/reload)

- The issue doesn't occur by applying a different time signature in this measure 6, because this erase the applied Actual duration.

This is not the case, of course, when Actual Duration and added time signature are similar : that is the behavior of this issue.

- B) at the step #5 (entering notes), all « seems » good (no corruption really visible, except for "average/advanced users"?) This will be different by adding an Actual duration/new Time sig eg of 6/8. See the difference :
ex binaire.jpg
vs.
ex ternaire.jpg

- C) To get a crash, it's easy of course: eg select the note just before a barline (from a corrupted measure) and select/apply a higher note value, eg half note or whole note.

About the 1.4 time signature appearing as a pickup measure in the different mentioned threads (and their attached files) ie:

- https://musescore.org/en/node/123486
- https://musescore.org/en/node/141021
- https://musescore.org/en/node/149781
- https://musescore.org/en/node/148066,

such is my assumption (only an assumption). But as I can reproduce all this, maybe...

So, let us imagine the following scenario:

- create a new score → in the Wizard, keep the default 4/4 time signature → and check "Pickup measure" while also keeping the default 1/4.

It is possible that some users, perhaps by unknowledge, by confusion, really expect to see this 1/4 indication displayed as a pickup measure when the newly created file is opened.
This is not the case of course, since one sees, as it should be, the 4/4 time signature with a quarter rest.

So they probably try different things. Add directly a 1/4 time signature does not work, well, not in the direction desired by these users.

At one time, they find this procedure ie: in a following measure: change in Measure properties the "Actual measure duration" (for 1/4) -> then in this measure, add the 1/4 time signature. In the case of a (not) compound-time, the "illusion" works by continuing to enter notes.
ex pickup.jpg
And in straight line of their confusion, they remove, Ctrl + Del, the initial pickup (this action, as you have understood now, has nothing to do with the root of this issue), to get the 1/4 time signature/pickup measure, showed at the beginning of the score.
ex 2 pickup.jpg
This is an illusion because the problem will appear severely (euphemism) when the file will be saved/reopened.
final result.jpg

To say in more, and without real surprise (I felt this way): I observe that this issue is really a very former one.

Indeed, I can reproduce until May 19, 2014.

Image below produced with:56177c3
2014.jpg

There are other issues that emerge from changing the time signature via bar properties also. If we follow the OP steps to replicate the error i.e. you must close and then reopen the file - it is only then that the alert dialog says there is a corrupt bar.

Today I have tried to look into where the bug is coming from but with no success yet... I am new to the software and am only just finding my way around! I am from a Java/C# background. I managed to get an exception in the debugger by putting a breakpoint somewhere but I cannot remember where I put it! The error I got is a segmentation error (not very helpful) which is I believe related to pointers? / memory ... Sounds ominous. Of course this error does nothing much to help pin point the bad code.

I always thought the point of having a debugger is that it will alert you when there is an error and this should not depend on you being able to put the breakpoint in the exact required location?!!

The issue at hand here has been fixed 3 years ago with MuseScore 2.2
If you have a similar issue now and in MuseScore 3.4 or later, open a new issue with a sample score and a step by step description how to reproduce