Crash by flipping an articulation or ornament on a grace note

• Mar 30, 2016 - 20:04
Type
Functional
Severity
S2 - Critical
Status
closed
Project

GIT commits : f440554 and b595cf6 / Windows7

First reported: https://musescore.org/en/node/104141

1) "My First Score"
2) Enter a note
3) Add an accacciatura (from palette or with shortcut Shift + /)
4) Double-click on an element of the Articulations and Ornaments palette
5) Press "X" for Flip direction

Result: crash

accent.jpg
articulation.jpg


Comments

Stack trace:
1 Ms::Element::setParent element.h 327 0xb83357
2 Ms::System::add system.cpp 652 0x7b3dc4
3 Ms::Score::layoutSystem layout.cpp 2197 0x7fb79b
4 Ms::Score::layoutSystemRow layout.cpp 2832 0x7fde35
5 Ms::Score::layoutSystems layout.cpp 3157 0x7ff9f3
6 Ms::Score::doLayout layout.cpp 1474 0x7f7c4c
7 Ms::Score::endCmd cmd.cpp 128 0x77c343
8 Ms::MuseScore::cmd musescore.cpp 3996 0x498699
9 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 820 0x689210
10 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a655a2
11 Ms::ScoreTab::actionTriggered moc_scoretab.cpp 178 0x68f1e9
12 Ms::ScoreTab::qt_static_metacall moc_scoretab.cpp 94 0x68ef22
13 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a655a2
14 ZN12QActionGroup7hoveredEP7QAction 0x61dc4b95
15 ?? 0x1fa05f68
16 ZN7QAction8activateENS_11ActionEventE 0x61dc3b6e
17 ?? 0x28cd88
18 ??

For the record, this issue occurs on January 5, 2015.

- This Nightly works: 712522e

- Not this one (there is only an other commit between): 9abad76
and followings the same day.

Don't see for now where might be the change.

Hmm, something seems very wrong. Thst stack trace makes no sense to me - System::add() should be being called at all, and isn't for me. This is used to add isntrument names, brackets, etc. That's not happening here. So why on some people's systems is that being called? There must be some deeper underlying problem. Can you see what is going with that - why is System::add() being called at all?

I confirmed this crash behaviour in 2.0.1 b25f81d running on Win7Pro. Here's the crash report:

Problem signature:
Problem Event Name: APPCRASH
Application Name: MuseScore.exe
Application Version: 0.0.0.0
Application Timestamp: 0d2e4580
Fault Module Name: StackHash_0a9e
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Code: c0000005
Exception Offset: 00000000
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 4105
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Hope this is useful.

Hmm, maybe the null element being added is supposed to be a C major key signature? But I still don't understand why for me that function never even gets called, and for others it does. It probably *shouldn't* be called though.

I found (following) the stack trace confusing too, but for sure Iit ended up in aadd(el) with el being NULL and that Change of mine solved the Crash
And making sure el is not NULL before dereferencing it makes sense in any case.

Crashes more sporadic here under Win10 and this Nightly: 7feb0fc
Seems related to a display (or not) of something: Start Center/or and Inspector/or and Workspace Advanced or Custom.
Attempt for understanding to come (I hope)

And I've just tested again: following the stepe in t#1 I do end up in `System::add(Element* el)` with `el` being NULL (or nulptr). However the previous call is `system->layoutSystem(xo);`, no idea how that ends up in add(), this is a mystery to me.

And on subsequentet tests I don't end up there at all, so I'm even more confused

Some random stack corruption?

Edit: I can reproduce again at will, when using -e
Edit 2: sometimes.... :-(

Other aspect (Win10 always) and c49c0d1. Little less sure now for the variables of displaying.
But I notice if I repeat the same steps (with the same note), and press X (one time or twice?), and repeat same process (steps + Close the file + repeat Steps + Close the file) two or three times (?), I get crashes rather easily.
But very curious or tricky (or not all understand for now) to obtain systematically.
EDIT:
for steps, I choose to enter the same note (eg A) -> double-click on acciaccatura -> double-click in Accent symbol in the palette of Articulations -> X (one time, maybe twice or more facilitates the process?)
And if it works, I close the file, and I repeat exactly the same steps. And again. At a certain moment, there is a crash.
EDIT1: curious always: after a RevertToFactorySettings with the same mentioned nightly above, I get a crash immediatly (with the same steps and same note "A" - no sure it's a main point - but I note this, neverless)
crash.jpg

New attempt with new steps (Windows 10) and c49c0d1
1) RevertToFactorySettings
2) You are in "My First Score": Enter a C -> double-click acciaccatura -> double-click "Accent" -> X (one time)
Result: ok
3) Close the file with the cross "X" (don't save)
4) Reload MuseScore ->Repeat exactly step #2
Result: crash after "X" (EDIT: eventually, if not crash, close again the file, and repeat step 2)

Then, if you want: repeat again steps 1, 2
Result: crash

Status (old) patch (code needs review) active

my PR certainly solves a problem, but just not this one, or if so, then only 'by accident'

and sure enough it still crashes :-(, now at a slightly different place:
1 ??
2 Ms::Score::layoutSystemRow layout.cpp 3114 0x7ff5b5
3 Ms::Score::layoutSystems layout.cpp 3157 0x7ffa7f
4 Ms::Score::doLayout layout.cpp 1474 0x7f7cd8
5 Ms::Score::endCmd cmd.cpp 128 0x77c3c3
6 Ms::MuseScore::cmd musescore.cpp 3996 0x498699
7 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 820 0x689210
8 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a655a2
9 Ms::ScoreTab::actionTriggered moc_scoretab.cpp 178 0x68f1e9
10 Ms::ScoreTab::qt_static_metacall moc_scoretab.cpp 94 0x68ef22
11 ZN11QMetaObject8activateEP7QObjectiiPPv 0x68a655a2
12 ZN12QActionGroup7hoveredEP7QAction 0x61dc4b95
13 ?? 0x1f921058
14 ZN7QAction8activateENS_11ActionEventE 0x61dc3b6e
15 ?? 0x28cd88
16 ??