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
11.8k stars 2.56k forks source link

Memory leak upon opening MusicXML file exported from Sibelius #23276

Closed barnabycollins closed 2 days ago

barnabycollins commented 2 weeks ago

Issue type

Import/export issue

Bug description

I'm currently collaborating on a score with a Sibelius user. He has sent me a MusicXML file with some changes, and when I open it MuseScore hangs and starts eating memory. The file is only 44KB, and it opens correctly in Soundslice, so I don't think it's corrupted.

I haven't had to import a MusicXML file since I switched to MS4, so I don't know if this is a new problem or if it's been present since the update. I also don't have MS3 installed on my current computer, so I'd rather not check if it opens in that. I do know that it happened both on the previous version I had installed (4.3.1, I believe) and the latest version (4.3.2), as I tried upgrading to see if it would resolve the problem. I definitely have opened MusicXML files from the same collaborator on MuseScore 3 without trouble, but as mentioned I haven't tested this specific file in MS3.

My system is running Windows 11 23H2, a Ryzen 7 7840HS, 32GB DDR5-5600 and a 500GB WD SN740. Let me know if you need anything more from me.

Thanks in advance for your help, and even bigger thanks for the awesome software! :)

Steps to reproduce

  1. Download Stayin' Alive.zip* and extract the .mxl file
  2. Open the mxl file in MuseScore 4.3.2, either by double-clicking it in a file manager and selecting MS4, or by launching MS4 and using the 'Open...' buttons

*compressed to ZIP as GitHub won't allow me to upload .mxl files

Screenshots/Screen recordings

In the below screenshot:

image

MuseScore Version

4.3.1, 4.3.2

Regression

I don't know

Operating system

Windows 11 23H2 (build 22631.3737)

Additional context

No response

barnabycollins commented 2 weeks ago

I should mention that I asked the collaborator to send me the individual parts that he'd tweaked instead of the whole score, and those opened fine. I noticed they'd been exported as .musicxml rather than .mxl files, which I guess might contribute. They're inside the ZIP attached below :)

Individual parts.zip

cbjeukendrup commented 1 week ago

It turned out that this was not a memory leak, and not even a real infinite loop, but a very bad case of exponential recursion. Fortunately, the solution was not too complicated.