Infinite loop on score internal element adding
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
Yes, checked again, previous commit imports the file, this commit does not.
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?
Fixed in 328503f0a8
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.
Indeed, it seems to have helped with the slowdown on score load I was seeing as well - thanks!
On a ~450 page score it still is very slow, takes 7 seconds to move a single note up/down a semitone
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?
No, I haven't. Don't think it got worse, but thought this change might have improved it. Apparently not...