MusicXML import causes corruption, attempts to fix causes crash
Reported version
2.3
Priority
P1 - High
Type
Functional
Severity
S1 - Blocker
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project
MuseScore 2.3.2 on Windows 7
Came up in http://notensatz.forumprofi.de/index.php?topic=1882.0
Opening the attached MusicXML file (taken from http://www1.cpdl.org/wiki/index.php/Psalm_23_%28Franz_Schubert%29) reports
Measure 20 Staff 3 incomplete. Expected: 4/4; Found: 1918/1920
Measure 63 Staff 3 incomplete. Expected: 4/4; Found: 1918/1920
Swapping voice 1 and 2 twice doesn't fix it.
Attempts to delete those measure causes a crash
Saving as mscz and reopening additionally complains about similar corruptions in measure 28-55, staff 3 and 4
The file seems to stem from a direct (i.e. non-Dolet) Sibelius 7.5.1 export. And the problem seems to be related to tuplets.
Current master crashes directly on opening the file.
Attachment | Size |
---|---|
Ws-schb-p23.mxl | 45.71 KB |
Comments
In reply to (No subject) by Anatoly-os
asdasd
In reply to asdasd by Leon Vinken
Please ignore previous comment.
Current master still crashes ... Spent some time debugging about four weeks ago. Cause of the crash is that one of the notes used in tuplet layout is in a measure with _parent set to nullptr. Unfortunately, I have been unable to find the cause and solution for this.
Here is a reduced version of the file isolating the problematic measures (i.e. measures 30 and 31 of part P3), where I deleted some additional notations (e.g. the tremolos).
From what I can see, a tuplet of 7 elements (??) is created with some elements belonging to one measure and some elements belonging to another measure.
The "tuplet" notation "starts" and "stops" are messed up, but I don't think they are taken into account when reconstructing the actual tuplets in the MusicXml importer.
Attached also the result of import in Finale Notepad 2012.
[ Additional note: if I delete the whole "print" tag of measure 2 I obtain a crash on assert "!empty()" in libmscore/stafftypelist.cpp line 44. ]
Thanks for isolating the offending MusicMXL snippet, I had no clue where to start looking. Your abbreviated file still crashes with the same stack trace (that helps). Indeed the crash seems tuplet related, as the console shows "importmxmlpass2.cpp:Ms::addTupletToChord: tuplet already started" errors. Will have a try at finding the cause again.
In reply to Thanks for isolating the… by Leon Vinken
Attached another snippet, even more reduced. I believe this is the minimum sized file that still reproduces the crash: two measures, each with one note, each note having a tuplet start.
In reply to Attached another snippet,… by Leon Vinken
It looks like the cause of the crash is the MusicXML importer creating tuplets crossing measure boundaries. I believe this is not supported by MuseScore.
When I prevent this, file Ws-schb-p23.mxl imports correctly and no further ill effects are created. Currently I only have a crude and experimental fix implemented, but I will clean this up and provide a PR shortly.
Pull request 4296.
Fixed in branch master, commit 2d88e02a4f
fix #276227 MusicXML import causes corruption, attempts to fix causes crash
Fixed in branch master, commit 9a5ebb9ec5
Merge pull request #4296 from lvinken/276227-musicxml-tuplet-crash
fix #276227 MusicXML import causes corruption, attempts to fix causes…
Automatically closed -- issue fixed for 2 weeks with no activity.