Can't open an mscz file (file corruption?)
Whenever I open the attached mscz file(1), Musescore crashes and the problem report are shown(2)
Looks like the app encounters segmentation fault while reading the score. However, the others are fine.
I guess the mscz file has some corruption, but I have no idea to find and resolve it.
Thanks in advance.
(1) please see the attached file : attempt_to_open.txt
(2) please see the attached file: problem_report.txt
*Here's the version I use:
MuseScore Version: 3.5.2.312126096 (3.5.2.312126096)
OS Version: Mac OS X 10.15.7 (19H15)
*This is a part of the problem report when the crash occurred:
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000121
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [1361]
Attachment | Size |
---|---|
Sym_No9__From_The_New_World__4th_movement.mscz | 68.39 KB |
attempt_to_open.txt | 1.6 KB |
problem_report.txt | 84.65 KB |
Comments
Someone that can open it in a debug build will be able to find the line in the score that causes the crash. There are over 58,000 lines so I have no idea which one has the error.
In reply to Someone that can open it in… by mike320
Thanks for the reply. I'm trying to detect which measure causes the crash, moved roughly 2/3 of the measure elements to temporary text file, then an attempt to create a PDF from the mscx file has ended successfully.
$ wc -l
58195 Symphony_No9__From_The_New_World__4th_movement.mscx <- the full version
19938 Symphony_No9__From_The_New_World__4th_movement_debug.mscx <- 1/3 measure elements of the full
38262 ../mscx_temp.txt <- the rest measure elements
RESOLVED
Fortunately I found which measures cause the error, measure 307 and 308 on the treble clef. What I had done on the measures was swapping notes with keyboard shortcut.
Removed the bar 307 308 and added rest measures in the mscx file by a text editor, vim.
Investigating the measures one by one was really tough, but I’m glad to recover it, no need to write the score again.
Confirmed, in the latest 3.x development build, stack trace:
1 Ms::ChordRest::up chordrest.h 108 0x1030a1c
2 Ms::Chord::minAbsStemLength chord.cpp 1480 0x92362f
3 Ms::Chord::defaultStemLength chord.cpp 1432 0x9231e4
4 Ms::Chord::layoutStem1 chord.cpp 1516 0x9239b2
5 Ms::Score::getNextMeasure layout.cpp 2982 0x9d49e2
6 Ms::Score::collectSystem layout.cpp 3913 0x9da1d1
7 Ms::LayoutContext::collectPage layout.cpp 4721 0x9dfa09
8 Ms::LayoutContext::layout layout.cpp 5039 0x9e16c6
9 Ms::Score::doLayoutRange layout.cpp 5027 0x9e1624
10 Ms::Score::update cmd.cpp 302 0x52f4be
11 Ms::Score::update score.h 756 0xeff42a
12 Ms::readScore file.cpp 2363 0x4c86d6
13 Ms::MuseScore::readScore file.cpp 455 0x4b920a
14 Ms::MuseScore::openScore file.cpp 413 0x4b8e10
15 Ms::MuseScore::doLoadFiles file.cpp 346 0x4b85e0
16 Ms::MuseScore::openFiles file.cpp 311 0x4b824e
17 Ms::MuseScore::cmd musescore.cpp 6272 0x4307df
18 Ms::MuseScore::cmd musescore.cpp 6064 0x42f6f9
19 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 523 0x5e3e88
20 QMetaObject::activate(QObject *, int, int, void * *) 0x68a947f8
...
Apparently when trying to access a non-existing 2nd chord of a two-notes tremolo.
I found 2 of those, the last notes in top staff, measures 307 (see below)
and 308, fixed score (with those 2 tremolos removed) attached
Your score had been last saved with MuseScore 3.5.0, update to 3.5.2, even if that does not fix this crash!
Edit: I see just now that you found out about zthe culrpt measures yourself meanwhile
In reply to Confirmed, in the latedst 3… by Jojo-Schmitz
Code change to prevent the crash:
See https://github.com/musescore/MuseScore/pull/7201
In reply to Confirmed, in the latedst 3… by Jojo-Schmitz
Thank you so much for the confirmation, I have no idea even if reading the stack trace...
You’re right, when I had saved on 3.5.0 and uploaded it by save online function, I saw a message like this, “ The score cannot be uploaded, as we don't support this version of mscz files yet.” on the page. So I tried to update to 3.5.2, but the crash occurred while opening the mscz file.
In reply to Thank you so much for the… by Takernikov
So it didn't crash in 3.5.0?
Can you provide simple steps to reproduce this?
In reply to So it didn't crash in 3.5.0? by Jojo-Schmitz
It crashed in 3.5.0 as well.
I don’t understand what “reproduce this” means.
The error? or recovered mscz file?
In reply to It crashed in 3.5.0 as well… by Takernikov
Steps that cause this corruption, create those two-note tremolos without a 2nd chord.
I don't quite get what you meant above by swapping notes with keyboard shortcut
In reply to Steps that cause this… by Jojo-Schmitz
Okay, it happened again when I created a new sample score (attached file: 315002_7201.mscz) and redo the procedure.
Step1: Write two notes that I want to be tremolo.
Step2: Make them 2 notes tremolo.
Step3: However, change the mind, the tremolo should start from higher notes if playing the piano with right hands maybe, enter input mode.
Step4: Swap the two notes using shift + arrows, then close the mscz file. (see : https://musescore.org/en/handbook/note-input#keyboard-shortcuts )
Step5: Reopen the saved mscz file by double clicking, Musescore main window disappears immediately.
Step6: The problem report window shows up.
In reply to [inline:315002_step1_enter… by Takernikov
Thanks, with that description it should be possible find the and fix the real bug, my fix is nothing but a band aid
Now in the issue tracker as #315067: Swapping notes in a two-note tremolo causes corrupt tremolo (and crash)