create album of continuous-view scores will fail ASSERT(score()->nstaves() == staves.size()) in Measure::layout2

• Apr 11, 2016 - 07:48
Reported version
2.1
Type
Functional
Severity
S2 - Critical
Status
closed
Project

If I try to create album of two scores that were saved in continuous view, then this assert:

https://github.com/musescore/MuseScore/blob/master/libmscore/measure.cp…

Q_ASSERT(score()->nstaves() == staves.size());

will fail. staves.size() seems to always be twice of score()->nstaves().

Replication steps:

  1. File->album
  2. add "album_layout2-assert-staves.mscx" two times
  3. Join scores

Result: The ASSERT fails. (I haven't tried outside of debug mode yet)

Attachment Size
album_layout2-assert-staves.mscx 3.53 KB

Comments

I should note that the assert failure happens not in the actual joining, but rather in the thumbnail generation code. Here is the relevant call stack when the assert failure occurs:

1	raise			0x7fffee8d42a8	
2	abort			0x7fffee8d572a	
3	QMessageLogger::fatal(const char *, ...) const			0x7fffef26cf41	
4	qt_assert(const char *, const char *, int)			0x7fffef26826e	
5	Ms::Measure::layout2	measure.cpp	531	0x122ebce	
6	Ms::Score::doLayout	layout.cpp	1556	0x120cb8b	
7	Ms::Score::switchToPageMode	score.cpp	4477	0x128f811	
8	Ms::Score::createThumbnail	scorefile.cpp	477	0x13812fa	
9	Ms::Score::saveCompressedFile	scorefile.cpp	540	0x1381b2f	
10	Ms::Score::saveCompressedFile	scorefile.cpp	466	0x138120b	
11	Ms::Album::createScore	album.cpp	220	0xdd0f59	
12	Ms::AlbumManager::createScoreClicked	albummanager.cpp	144	0xdd390d	
13	Ms::AlbumManager::qt_static_metacall	moc_albummanager.cpp	113	0x1022df5	
14	QMetaObject::activate(QObject *, int, int, void * *)			0x7fffef484870	
15	QAbstractButton::clicked(bool)			0x7ffff05082f2	
16	??			0x7ffff0276484	
17	??			0x7ffff0277937	
18	QAbstractButton::mouseReleaseEvent(QMouseEvent *)			0x7ffff0277ab4	
19	QWidget::event(QEvent *)			0x7ffff01c0a58	
20	QApplicationPrivate::notify_helper(QObject *, QEvent *)			0x7ffff017c68c	
...	
Reported version 2.1

Not an issue in master, which handles this completely different (and joining scores in continues view leads to other problems)
I wonder whether we could fix this for 2.2