musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.08k stars 2.61k forks source link

Some MSCZ files contain bad CRC checksums for score_style.mss #23807

Open shoogle opened 1 month ago

shoogle commented 1 month ago

Background

MSCZ files are compressed Zip archives.

Zip archives contain a CRC checksum (actually two CRC checksums) to prove that the contents are not corrupted.

Problem

The unzip utility reports a checksum mismatch for some MSCZ files in the repository. In each case, it is the score_style.mss file within the MSCZ that is apparently corrupt.

I say "apparently corrupt" because the files still open in MuseScore Studio, and on inspection the contents of the file appear to be valid. So it seems that it's only the checksum that is wrong.

Nevertheless, I thought it worth reporting this as another chapter in the saga of mysteriously corrupt MSCZ files, which I know @cbjeukendrup has been researching quite thoroughly.

Example files

Run this command in the repository to see which MSCZ files are "corrupt":

git ls-files '*.mscz' | xargs -I% sh -c 'o="$(unzip -p % 2>&1 1>/dev/null | grep -F "bad CRC")" && echo "$o  %"'
Output (click to show/hide) ``` score_style.mss bad CRC 5b61a3dc (should be a362b620) vtest/scores/articulation-2.mscz score_style.mss bad CRC 7c46f871 (should be 8445ed8d) vtest/scores/beams-20.mscz score_style.mss bad CRC 19aecf0e (should be 6ae65576) vtest/scores/beams-manual-adjust.mscz score_style.mss bad CRC c8ebff02 (should be 30e8eafe) vtest/scores/chord-layout-18.mscz score_style.mss bad CRC 52323080 (should be 45abecc9) vtest/scores/chord-layout-19.mscz score_style.mss bad CRC a078f7ad (should be b7e12be4) vtest/scores/chord-layout-20.mscz score_style.mss bad CRC a132ff70 (should be 5931ea8c) vtest/scores/cross-5.mscz score_style.mss bad CRC e22c9f99 (should be 1a2f8a65) vtest/scores/customCrossStaffBeams.mscz score_style.mss bad CRC 6bb233af (should be 93b12653) vtest/scores/fingeringSpacing.mscz score_style.mss bad CRC 5b61a3dc (should be a362b620) vtest/scores/grace-9.mscz score_style.mss bad CRC f52e389a (should be e2b7e4d3) vtest/scores/hideEmptyStaves.mscz score_style.mss bad CRC a878c25b (should be ca3d6fe3) vtest/scores/invisible.mscz score_style.mss bad CRC 76b4bf35 (should be 612d637c) vtest/scores/kerning-3.mscz score_style.mss bad CRC ca8c9f19 (should be 1b300ab9) vtest/scores/polyrythm-1.mscz score_style.mss bad CRC c33cc1ee (should be b0745b96) vtest/scores/slur-adjust-for-tie.mscz score_style.mss bad CRC 959ca3df (should be 87fe9e3d) vtest/scores/slurs-11.mscz score_style.mss bad CRC f894cd6c (should be eaf6f08e) vtest/scores/slurs-13.mscz score_style.mss bad CRC 916d77b8 (should be 86f4abf1) vtest/scores/slurs-16.mscz score_style.mss bad CRC 65e0f758 (should be 8dd594e4) vtest/scores/slurs-18.mscz score_style.mss bad CRC ecf6fac9 (should be 04c39975) vtest/scores/slurs-19.mscz score_style.mss bad CRC 85fef8fc (should be f6b66284) vtest/scores/slurs-tremside.mscz score_style.mss bad CRC 7380c971 (should be 8b83dc8d) vtest/scores/stemSlash-2-bravura.mscz score_style.mss bad CRC 819ff843 (should be 799cedbf) vtest/scores/stemSlash-2-gonville.mscz score_style.mss bad CRC f68767fb (should be 0e847207) vtest/scores/stemSlash-2-maestro.mscz score_style.mss bad CRC a1b872cb (should be 59bb6737) vtest/scores/stemSlash-2.mscz score_style.mss bad CRC 3c77c831 (should be c474ddcd) vtest/scores/stemSlash-3.mscz score_style.mss bad CRC 0ebb70a0 (should be e68e131c) vtest/scores/tempoChangeLines.mscz score_style.mss bad CRC aeaab838 (should be ccef1580) vtest/scores/tremolo-hooks-flat.mscz score_style.mss bad CRC 6541ac4c (should be 070401f4) vtest/scores/tremolo-hooks-trad.mscz score_style.mss bad CRC 2b3e8efa (should be 3ca752b3) vtest/scores/tremolo-min-size.mscz ```

This command shows the last commit to touch each of these files:

git ls-files '*.mscz' | xargs -I@ sh -c 'unzip -p @ 2>&1 1>/dev/null | grep -Fq "bad CRC" && git log -1 --format="%h %as %an  %s  @" -- "@"'
Output (click to show/hide) ``` 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/articulation-2.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/beams-20.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/beams-manual-adjust.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/chord-layout-18.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/chord-layout-19.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/chord-layout-20.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/cross-5.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/customCrossStaffBeams.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/fingeringSpacing.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/grace-9.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/hideEmptyStaves.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/invisible.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/kerning-3.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/polyrythm-1.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/slur-adjust-for-tie.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/slurs-11.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/slurs-13.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/slurs-16.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/slurs-18.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/slurs-19.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/slurs-tremside.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/stemSlash-2-bravura.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/stemSlash-2-gonville.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/stemSlash-2-maestro.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/stemSlash-2.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/stemSlash-3.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/tempoChangeLines.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/tremolo-hooks-flat.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/tremolo-hooks-trad.mscz 8f285680bd 2024-02-29 XiaoMigros 'Musical Symbols Scale' for markers vtest/scores/tremolo-min-size.mscz ```

So these files were all lasted edited in PR #21758. In fact, all the MSCZ files added by that PR contain faulty checksums.

@XiaoMigros, I'm not suggesting you did anything wrong here, but is there anything different about your system that might have caused this? Do you have non-ASCII characters in your home directory path, for example?

cbjeukendrup commented 1 month ago

If this will indeed lead to a clue about #16339, that would be very exciting!

XiaoMigros commented 1 month ago

@XiaoMigros, I'm not suggesting you did anything wrong here, but is there anything different about your system that might have caused this? Do you have non-ASCII characters in your home directory path, for example?

This PR changed one style value in many score templates, and I used Notepad++'s 'Find and Replace in Files' option to make the change to all scores at once. It seemed to operate fine within the MSCZ files, and I opened some of the files in MuseScore Studio to check they weren't corrupted. I would assume that the issue, in this case, arose from there, since I'm assuming this is the only instance of this happening with changes I made, and it was the only instance I used the above method to make the changes.

shoogle commented 1 month ago

@XiaoMigros, you used a program besides MuseScore to decompress the MSCZ, edit, and then recompress it again? So it's not MuseScore's fault if the CRC checksums don't match in the recompressed files?

XiaoMigros commented 1 month ago

@shoogle that's correct.