Failed assert on MusicXML import
Reported version
3.0
Priority
P1 - High
Type
Functional
Frequency
Many
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
The changes for #277699: Staff properties corrupted on MusicXML import after Master Palette opened in commit 1edd676 indeed behave as expected and crash the MusicXML import with a failed assertion ('ASSERT: "!empty()" in file .../MuseScore/libmscore/stafftypelist.cpp, line 44').
This is consistent with the comment in the pull request: "and adds some assertions which may lead to crashes (and helps detecting bad code)". Apparently the MusicXML importer qualifies as "bas code" :-).
The change described in my Nov 3, 2018 - 17:53 reply to #277699: Staff properties corrupted on MusicXML import after Master Palette opened also fixes the failed assert.
Comments
But isn't that change pretty over-simplistic? Changing
if (st == StaffTypes::TAB_DEFAULT ...)
toif (true)
, rather than eliminating theif()
entirely?In reply to But isn't that change pretty… by Jojo-Schmitz
Yes, of course. I have no intention to leave "if (true)" in the code, but couldn't find a better way to phrase the change when I replied.
The change does not seem sufficient, as (besides fixing the failed assertion), it also introduces a warning: "libmscore/staff.cpp:Ms::Staff::setStaffType: there is already a type at 0". Am investigating.
Improved fix in PR4131
Fixed in branch master, commit 0b7baf2c1e
fix #278053 - Failed assert on MusicXML import
Fixed in branch master, commit 63d99763d8
Merge pull request #4131 from lvinken/278053-musicxml-setstafftype
fix #278053 - Failed assert on MusicXML import
Automatically closed -- issue fixed for 2 weeks with no activity.