Crash when deleting a measure, corrupted score
Priority
P2 - Medium
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project
Select measure 22, staff 1. Press control delete. Seg faults immediately on Ubuntu 14.04 or Fedora 16. File is downloaded here:
https://musescore.org/sites/musescore.org/files/issues/American%20Patro…
There's more information here: https://musescore.org/en/node/117596 . It's the same file, but this appears to be a different bug than #117696.
Comments
Crashes on Windows 7 and with the latest self-built from master too.
It is a crash, but on a corrupted file, so I downgrade to Major, on corrupted files anything can happen.
Stack trace:
1 Ms::SegmentList::first segmentlist.h 40 0xda80d8
2 Ms::Measure::first measure.h 176 0xdaf9bc
3 Ms::Score::undoRemoveMeasures undo.cpp 2713 0x7438d0
4 Ms::Score::cmdDeleteSelectedMeasures edit.cpp 2131 0x79bc29
5 Ms::Score::cmd cmd.cpp 2254 0x78c70c
6 Ms::ScoreView::cmd scoreview.cpp 3396 0x41483a
7 Ms::MuseScore::cmd musescore.cpp 4861 0x49edd3
8 Ms::MuseScore::cmd musescore.cpp 4433 0x49cc50
9 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 820 0x695136
10 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a08842
11 Ms::ScoreTab::actionTriggered moc_scoretab.cpp 193 0x69b4cb
12 Ms::ScoreTab::qt_static_metacall moc_scoretab.cpp 95 0x69b19d
13 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a08842
14 ZN12QActionGroup7hoveredEP7QAction 0x1b575295
15 ?? 0x2193ca00
16 ZN7QAction8activateENS_11ActionEventE 0x1b574248
17 ?? 0x28ce68
18 ?? 0x1d745ef8
19 ZN7QThread18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv 0x68a67dd0
20 ZN7QThreadD2Ev 0x6889aa20
...
undoRemoveMeasures(is, ie) gets called with 2 NULL pointers, as tick2measure(startTick) and tick2measure(endTick) return NULL pointer.
#117696: Crash when dragging time signature, corrupted score indeed seems to be a different issue
Well, this is a corrupted score...
just trying on latest 3.0 master, and deleting measure 22 does producing an exception...turns out in Score::deleteMeasures(MeasureBase* is, MeasureBase* ie) the following Measures mis and mie get set to NULL:
3.0 did report the score as corrupted upon import, so I don't know how important this bug is to fix...garbage in garbage out...
I've made a PR to include a Q_ASSERT for the start and end meaasure in calls to Score::undoRemoveMeasures(m1, m2): https://github.com/musescore/MuseScore/pull/4506
Note this is not a fix, so I'm not going to mark PR created, but rather I'm just adding the Q_ASSERT incase someone else runs into problem. I'm actually not sure we should investigate this bug because I think the real bug is why the corruption happened in the first place. If someone can make reproduction steps in 3.0 on how to produce this corruption from a blank score, then it will make sense to fix the bug, but until we know that I vote to close this bug report.