Crash when deleting title frame
- Open attached score (produced in 2.x).
- Click on title frame.
- 'Delete'.
Result: Crash (see attached log).
Using MuseScore 3.0 Nightly cad046a - Mac 10.11.6.
Attachment | Size |
---|---|
Crash.mscz | 4.78 KB |
Crash [Log].txt | 74.65 KB |
Comments
Apologies for the vague title, but developers can determine, as I don't know the cause (perhaps related to layout?). Couldn't immediately see whether an issue existed either.
I originally encountered it by pasting notes or navigating via keyboard. Sometimes a different log appeared (attached).
I think I was able to reproduce with different steps (aforementioned pasting and navigation, rather than deleting the title frame), but possibly with a similar log. This is why I was not specific in the title - I'm assuming more investigation will reveal the root problem/cause.
I do not think it was the same crash. The logs look completely different to me. Are you sure you are able to reproduce this crash with the steps you provided? I get no crash when I try.
So you tried with my steps?
What OS are you using?
macOS, same as you.
In reply to macOS, same as you. by mattmcclinch
But which one, specifically?
macOS High Sierra 10.13.6. Testing with the current master branch of MuseScore.
I will say that I have encountered what appears to be a race condition where one thread is trying to access a certain object while another thread is deleting that same object. Unfortunately, a characteristic of race conditions is that they can be very difficult to reproduce.
At least twice I failed to reproduce, but could upon undo and deleting again.
I got a log that mentions BspTree.
I am able to reproduce this on macOS 10.11.6. As you say, it crashes sometimes, but not always. The crash can be prevented by forcing a complete relayout every time a vertical frame is deleted, but I really don't want to do that. I'm not even completely happy with my solution to related issue #274446: Crash by deleting vertical(s) frame(s) in first page of large scores, which is to force a complete relayout if the page is empty after a vertical frame is deleted.
Thanks for your investigation.
Is the core issue about the frame? I can reproduce another way without deleting it (how I found the issue originally, incidentally):
Result: Crash (see attached log).
Note: Sometimes not all steps (namely 6 or 7) may be needed to reproduce.
Using MuseScore 3.0 Nightly 6a015b8 - Mac 10.11.6.
It does indeed crash in the same place. It is not necessary to repeat steps 5-6. Just scroll to the last page. However, if you perform a "Re-Layout" from the "Debug" menu after step 6, then it does not crash. I did notice that step 6 results in an error similar to #22440: Selection of bar visible after being hidden, which is not remedied by the relayout.
I don't think I can reproduce, but I'll take your word for it, as I encountered something similar weeks ago when scrolling; perhaps that was it.
In reply to I don't think I can… by chen lung
I could reproduce the bug only under Mac (not under Linux), but I found, thanks to AddressSanitizer (which can be enabled in clang), that it is related to the presence of ledger lines.
Indeed, if in file "Crash.mscz" from the first post the notes in the final measure are transposed so that no ledger lines are used, deleting the title frame does not lead to a crash.
Attached the log files from AddressSanitizer for both example files of this issue thread. It shows that in both cases the program is somehow trying, during a paint event, to access an address which was previously referring to a ledger line.
Thanks @ABL for your investigation too.
Are you also using 10.11.6?
The reason I was not experiencing a crash earlier had nothing to do with the version of macOS that I was running. It was because the page in question was entirely offscreen, and thus not affected by the paint event.
I believe I have found the correct solution to the actual problem. Please see https://github.com/musescore/MuseScore/pull/3835.
Fixed in branch master, commit 5b430d9931
fix #274439: Crash when deleting title frame
Fixed in branch master, commit 2e801f54d1
Merge pull request #3835 from mattmcclinch/274439-crash
fix #274439: Crash when deleting title frame
Automatically closed -- issue fixed for 2 weeks with no activity.