1.3 score using Pedal line with a middle symbol displays empty in 3.x, crashes in master

• Mar 11, 2022 - 17:08
Reported version
3.6
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
Yes
Project
  1. Open attached score (produced in 1.3).

Result: Displays empty.

Information: Displays in 2.3.2.

Using MuseScore 3.6.2 and 3.x nightly (2513676) - Mac 10.11.6.

Attachment Size
1x score displays empty in 3x.mscz 3.98 KB

Comments

Debug messages in a 3.x build:
Debug: tag in line 204 col 39: continueSymbolOffset (...\libmscore\xmlreader.cpp:208, void Ms::XmlReader::unknown())
Debug: empty score (...\libmscore\layout.cpp:5029, void Ms::Score::doLayoutRange(const Ms::Fraction&, const Ms::Fraction&))
Debug: empty score (...\libmscore\layout.cpp:5029, void Ms::Score::doLayoutRange(const Ms::Fraction&, const Ms::Fraction&))
Debug: tick2measureMM 0 (max -1) not found (...\libmscore\utils.cpp:93, Ms::Measure* Ms::Score::tick2measureMM(const Ms::Fraction&) const)
Debug: tick2measureMM 0 (max -1) not found (...\libmscore\utils.cpp:93, Ms::Measure* Ms::Score::tick2measureMM(const Ms::Fraction&) const)

mcsx at the place of that first message (the unknown tag):

    <beginSymbol>197</beginSymbol>
    <beginSymbolOffset x="0" y="0"/>
    <continueSymbol>191</continueSymbol>
    <continueSymbolOffset x="0" y="0"/>
    </Pedal>

A master build complains about that unknown tag too. Some code:

            else if (tag == "continueSymbolOffset") // obsolete
                  e.readPoint();

So that's not the real issue here, instead the messages that follow, reg. empty score and tick2measureMM (the score doesn't use any multimeasure rests though?).
Some code:

      if (!last() || (lineMode() && !firstMeasure())) {
            qDebug("empty score");
            qDeleteAll(_systems);
            _systems.clear();
            qDeleteAll(pages());
            pages().clear();
            lc.getNextPage();
            return;
            }

and

      // check last measure
      if (lm && (tick >= lm->tick()) && (tick <= lm->endTick()))
            return lm;
      qDebug("tick2measureMM %d (max %d) not found", tick.ticks(), lm ? lm->tick().ticks() : -1);
      return 0;
      }

Debug output from a master build:

11:01:03.463 | INFO  | main_thread | WindowDropArea | dropEvent: 0x1bcaa5f0
11:01:03.463 | DEBUG | main_thread | ApplicationActionController | onDropEvent: "C:/Users/Jojo/Desktop/Rosalinda_Live-1.3.mscz" 
11:01:03.968 | DEBUG | main_thread | IpcChannel | syncRequestToAll: ret code: 1
11:01:03.968 | DEBUG | main_thread | NotationProject | load: try load: .../Rosalinda_Live-1.3.mscz
11:01:04.049 | DEBUG | main_thread | Qt         | unknown: tag in  line 204 col 39: continueSymbolOffset
11:01:04.049 | DEBUG | main_thread | EngravingElementsProvider | printStatistic: 

=== Load ===
Object              created             deleted             
BracketItem         3                   1                   
Part                2                   0                   
Pedal               1                   0                   
PedalSegment        8                   0                   
Staff               3                   0                   
Tempo               1                   1                   
Text                20                  4                   
-----------------------------------------------------
Total               38                  6                   

11:01:04.049 | DEBUG | main_thread | Qt         | onFireOpen: try open uri: musescore://project/migration, page: {"modal":"","params":{"appVersion":"1.3","isApplyAutoSpacing":false,"isApplyEdwin":true,"isApplyLeland":true,"migrationType":1,"sync":true},"path":"MuseScore/Project/MigrationDialog.qml","sync":true,"type":2,"uri":"musescore://project/migration"}
11:01:04.061 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:01:04.070 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxUnknown
11:01:29.360 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:01:29.363 | DEBUG | main_thread | Qt         | doLayoutRange: empty score
11:01:29.364 | DEBUG | main_thread | Score      | endCmd: Undo stack currentmacro child count: 3
11:01:29.364 | INFO  | main_thread | ProjectMigrator | migrateEngravingProjectIfNeed: success migration
11:01:29.364 | DEBUG | main_thread | Qt         | doLayoutRange: empty score
11:01:29.364 | DEBUG | main_thread | EngravingElementsProvider | printStatistic: 

=== Update and Layout ===
Object              created             deleted             
Page                1                   1                   
-----------------------------------------------------
Total               1                   1                   

11:01:29.365 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:01:29.369 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:01:29.380 | DEBUG | main_thread | MscMetaReader | readMeta: Can't find thumbnail
11:01:29.483 | DEBUG | main_thread | Qt         | onFireOpen: try open uri: musescore://notation, page: {"modal":"","params":{"sync":true},"path":"","sync":true,"type":1,"uri":"musescore://notation"}
11:01:29.484 | DEBUG | main_thread | WorkspacesDataProvider | setRawData: set data to default workspace, key: ui_states
11:01:29.489 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:01:29.564 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:01:29.575 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxNotationFocused
11:01:30: ...\win64install\bin\MuseScore4.exe crashed.

Stack trace:

1 QListData::begin qlist.h 118 0x134119c
2 QList::begin qlist.h 339 0x1321c8c
3 Ms::Score::partById score.cpp 5206 0x4ac4be
4 mu::engraving::PlaybackModel::resolveTrackPlaybackData playbackmodel.cpp 141 0x7c6b18
5 mu::notation::NotationPlayback::trackPlaybackData notationplayback.cpp 106 0xa51b18
6 mu::playback::PlaybackController::addTrack playbackcontroller.cpp 503 0xb78d92
7 mu::playback::PlaybackController::setupSequenceTracks playbackcontroller.cpp 664 0xb7b7b1
8 mu::playback::PlaybackController::setupNewCurrentSequence playbackcontroller.cpp 607 0xb7aa56
9 mu::playback::PlaybackController::::::operator()(const mu::audio::TrackSequenceId &) const playbackcontroller.cpp 72 0xb72645
10 std::__invoke_impl::&, int>(std::__invoke_other, mu::playback::PlaybackController:::: &, int &&) invoke.h 60 0xb9461f
11 std::__invoke::&, int>(mu::playback::PlaybackController:::: &, int &&) invoke.h 95 0xb93b3e
12 std::__apply_impl::&, std::tuple, 0>(mu::playback::PlaybackController:::: &, std::tuple &&, std::index_sequence) tuple 1678 0xb9316c
13 std::apply::&, std::tuple>(mu::playback::PlaybackController:::: &, std::tuple &&) tuple 1687 0xb931ac
14 deto::async::Promise::ResolveCall::, int>::resolved(const deto::async::NotifyData &) promise.h 126 0xb931f0
15 deto::async::Promise::PromiseInvoker::doInvoke promise.h 172 0x114fdf8
16 deto::async::AbstractInvoker::invokeCallback abstractinvoker.cpp 62 0x40353f
17 deto::async::AbstractInvoker::QInvoker::invoke abstractinvoker.h 123 0x114133c
18 deto::async::AbstractInvoker::::operator()(void) const abstractinvoker.cpp 49 0x403173
19 std::_Function_handler>::_M_invoke(const std::_Any_data &) std_function.h 297 0x40de5f
20 std::function::operator()() const std_function.h 687 0x13b8092
...

Crash at

    const Ms::Part* part = m_score->partById(trackId.partId.toUint64());

with m_score being 0. Changging that to

    const Ms::Part* part = m_score ? m_score->partById(trackId.partId.toUint64()) : nullptr;

fixes the crash, I'll submit a PR for that.

Debug output from a master build with that crash fixed (see above):

11:19:07.482 | DEBUG | main_thread | NotationProject | load: try load: .../Rosalinda_Live-1.3.mscz
11:19:07.558 | DEBUG | main_thread | Qt         | unknown: tag in  line 204 col 39: continueSymbolOffset
11:19:07.558 | DEBUG | main_thread | EngravingElementsProvider | printStatistic: 

=== Load ===
Object              created             deleted             
BracketItem         3                   1                   
Part                2                   0                   
Pedal               1                   0                   
PedalSegment        8                   0                   
Staff               3                   0                   
Tempo               1                   1                   
Text                20                  4                   
-----------------------------------------------------
Total               38                  6                   

11:19:07.558 | DEBUG | main_thread | Qt         | onFireOpen: try open uri: musescore://project/migration, page: {"modal":"","params":{"appVersion":"1.3","isApplyAutoSpacing":false,"isApplyEdwin":true,"isApplyLeland":true,"migrationType":1,"sync":true},"path":"MuseScore/Project/MigrationDialog.qml","sync":true,"type":2,"uri":"musescore://project/migration"}
11:19:07.565 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:19:07.574 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxUnknown
11:19:09.500 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:19:09.504 | DEBUG | main_thread | Qt         | doLayoutRange: empty score
11:19:09.504 | DEBUG | main_thread | Score      | endCmd: Undo stack current macro child count: 3
11:19:09.504 | INFO  | main_thread | ProjectMigrator | migrateEngravingProjectIfNeed: success migration
11:19:09.504 | DEBUG | main_thread | Qt         | doLayoutRange: empty score
11:19:09.504 | DEBUG | main_thread | EngravingElementsProvider | printStatistic: 

=== Update and Layout ===
Object              created             deleted             
Page                1                   1                   
-----------------------------------------------------
Total               1                   1                   

11:19:09.508 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:19:09.508 | DEBUG | main_thread | Qt         | checkHasMeasures: first create measure, then repeat operation
11:19:09.508 | DEBUG | main_thread | Qt         | checkHasMeasures: first create measure, then repeat operation
11:19:09.508 | DEBUG | main_thread | Qt         | checkHasMeasures: first create measure, then repeat operation
11:19:09.508 | DEBUG | main_thread | Qt         | checkHasMeasures: first create measure, then repeat operation
11:19:09.508 | DEBUG | main_thread | Qt         | checkHasMeasures: first create measure, then repeat operation
11:19:09.508 | DEBUG | main_thread | Qt         | checkHasMeasures: first create measure, then repeat operation
11:19:09.509 | DEBUG | main_thread | Qt         | checkHasMeasures: first create measure, then repeat operation
11:19:09.509 | DEBUG | main_thread | Qt         | checkHasMeasures: first create measure, then repeat operation
11:19:09.520 | DEBUG | main_thread | MscMetaReader | readMeta: Can't find thumbnail
11:19:09.797 | DEBUG | main_thread | Qt         | onFireOpen: try open uri: musescore://notation, page: {"modal":"","params":{"sync":true},"path":"","sync":true,"type":1,"uri":"musescore://notation"}
11:19:09.798 | DEBUG | main_thread | WorkspacesDataProvider | setRawData: set data to default workspace, key: ui_states
11:19:09.804 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:19:09.880 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxHomeOpened
11:19:09.886 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxNotationFocused
11:19:09.931 | DEBUG | main_thread | UiActionsRegister | updateEnabledAll: currentCtx: UiCtxNotationOpened
Title 1.3 score using Pedal line displays empty in 3.x, crashes in master 1.3 score using Pedal line with a middle symbol displays empty in 3.x, crashes in master

(and 1.x apparently has a bug there, it does show the Start Symbol on the last segment of such a line, not the Middle Symbol, the import into 2.x fixes that 'on the fly')

From read114.cpp:

            else if (tag == "continueSymbol") {                   // obsolete
                  }
...
            else if (tag == "continueSymbol") {
                  QString text(e.readElementText());
                  textLine->setContinueText(QString("<sym>%1</sym>").arg(
                        text[0].isNumber()
                              ? resolveSymCompatibility(SymId(text.toInt()), textLine->score()->mscoreVersion())
                              : text));
                  }

The 1st is for Ottave lines (in readOttava114()), the 2nd for text lines (in readTextLine114())
The

            else if (tag == "continueSymbolOffset") // obsolete
                  e.readPoint();

is also for text lines (in readTextLine114()). Marked obsolete but does get read.
However, it doesn't seem to get read in, else the 'unknown tag' message wouldn't show?

Hmm, there's also a readPedalLine114(), that does call readTextLineProperties114(), that in turn doesn't read any of the {begin,continue,end}Symbol* stuff though?

On reading a 1.x Pedal line apparently beginSymbol, beginSymbolOffset, endSymbol and endSymbolOffset (and also subtype) are ingnored already, so I guess the fix would be to just ignore continueSymbol and ContinueSymbolOffset too?

Status PR created fixed

Fixed in branch master, commit 5bb2cf3c31

_Partial fix #330270: Crash on importing a 1.x score using a Pedal line with a continueSymbol

a score that that even 3.x imports as being entirely empty, but 1.x and 2.x just opens cleanly._

Fixed in branch master, commit 406532427f

_Fix #330270: 1.x score using Pedal line with a continueSymbol imports empty

Also custom beginSymbol, endSymbol and their offset got ignored, the former got hard coded instead._

Fix version
4.0.0