Infinite loop on score internal element adding

• Dec 23, 2014 - 18:32
Type
Functional
Severity
S2 - Critical
Status
closed
Project

1. Open attached MIDI file.
2. Wait forever with 100% core load.

Git bisect and breakpoint on this line have shown that the issue is in this commit:
https://github.com/musescore/MuseScore/commit/df7ff007e8ff8536d6ea258b8…

After several steps it calls addSystemHeader() which calls again undoAddElement(keysig).

Current nightly (https://github.com/musescore/MuseScore/commit/bf97799751ad4c74adbaf7f48…),
Kubuntu 14.04 64 bit, Windows 7 64 bit.

Attachment Size
Pickup Measure test.mid 467.55 KB

Comments

Looking at the code here, I am a little uncomfortable with the thought that this might turn out to be not just an isolated issue with improt of this particular MIDI, but a more file that could be affecting all score layout to some degree. Part of this feeling comes from having worked on another area of code recently that is part of this chain and seeing that it was being called multiple times - but not infinitely. Part of this feeling comes from a sense that all score loading has become much slower since around the time of the change here - but that could be related to a change in my OS right around that same time, so if others are not noticing any slowdown, then I won't worry.

I wonder if perhaps the "new" call to cmdUpdateNotes() could perhaps be protected to not happen during score load or something like that - my guess it isn't needed except during score *edit* operations?

Status (old) fixed active

It was not an infinite loop, only slow (the score had > 800 pages). I removed uneccessary cmdUpdateNotes() calls outside of a command which speeds up things a lot.

Yes, but that's not new as a result of the change we were taking about. That's always the case with large scores due to the complete layout that takes place. I guess it is possible that it is worse now? Have you timed a comparison before and after the change (from mid December, I believe), with same build flags?