Crash on select on score with slur ending on rest
Ubuntu 14.04, GIT commit: 6bba0d4
I've seen a coupple variations on what appears to be the same crash today. Here is an easy-to-reproduce case.
1) load attached score (created in 1.3, downloaded from musescore.com)
2) select all
Result: crash
The crash occurs in Spanner::endChord(), and it's an assert failure - the endElement in this case is a rest, not a chord. But I've also seen cases where it is 0 as a result of the assignment of nullptr a couple of lines above (meaning it had been a rest up until then). Those cases happened when I wasexperimenting with things in the code so maybe I was doing something incorrectly. But the crash as described above should happen without my code.
In all cases, this is being called from Selection::updateSelectedElements(), which is called from at the end of Score::pasteStaff().
Comments
Yes, critical, although the score might be corrupt. Would help if I attached it. Here it is.
That score doesn't open in 1.3, I understood it was created with that and loaded from MsueScore.com, unchanged?
This one?
http://musescore.com/nicolas/doctor-gradus-ad-parnassum
No crash here by selecting all (Ctrl + A)
Yes, correct. I saved again in 2.0 to see if that would change anything.
FWIW, I can reproduce on both my Linux systems, with the very latest sources (built a few minutes agi) as well as builds from a few days ago. Also crashes for me on Windows with the most recent build I have there (also from a few days ago).
Well, I tried on a few nightlies including the latest, and I still see no crash (under Windows7 and Windows8) after opening the file and select all.
I'm going to drop!
This issue is it reproducible from scratch?
It crashes in debug mode only. The crash is on Q_ASSERT() and they are ignored in release mode.
It easily reproducible from scratch in a68454ece6 if built in debug mode.
"reproducible if built in debug mode"
Ah :(
So I'll move on to something else...!
Doh! I should have thought of that. I even knew it was an assert failure.
I would say we could just remove the assert, then, but I still see a potential crash or two here. A couple of lines above the assert, we do a conditional assignment of _endElement, but then we dereference it without checking for null, And we potentially return null, yet the calling code doesn't check for that before dereferencing it. Hoepfully, _endElement is just never null in the first place.
Fixed in d4712da6a3
Automatically closed -- issue fixed for 2 weeks with no activity.