Copy-paste a note with a flat in a staff for a transposing instrument causes a crash or broke the layout

• Dec 16, 2016 - 12:38
Reported version
3.0
Type
Functional
Severity
S2 - Critical
Status
closed
Project

with the current git master I experience very frequent segfaults on Archlinux (qt5 5.7.0)

(gdb) run
Starting program: /usr/bin/mscore-git
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffd6903700 (LWP 13471)]
qt5ct: using qt5ct plugin
[New Thread 0x7fffc8def700 (LWP 13472)]
[New Thread 0x7fffbfffe700 (LWP 13473)]
[New Thread 0x7fffbf7fd700 (LWP 13474)]
[New Thread 0x7fffbeba6700 (LWP 13475)]
qt5ct: palette support is disabled
[New Thread 0x7fffac23d700 (LWP 13476)]
[New Thread 0x7fffaba3c700 (LWP 13477)]
qt5ct: custom style sheet is disabled
libpng warning: iCCP: known incorrect sRGB profile

Thread 1 "mscore-git" received signal SIGSEGV, Segmentation fault.
0x000000000391df90 in ?? ()
(gdb) bt
#0 0x000000000391df90 in ()
#1 0x0000000000e13701 in Ms::BspTree::items(QRectF const&) ()
#2 0x0000000000cd89da in Ms::Page::items(QRectF const&) ()
#3 0x000000000074d54c in Ms::ScoreView::paint(QRect const&, QPainter&) ()
#4 0x000000000074e7d5 in Ms::ScoreView::paintEvent(QPaintEvent*) ()
#5 0x00007ffff5247ef8 in QWidget::event(QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#6 0x00007ffff5200e0c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#7 0x00007ffff5208581 in QApplication::notify(QObject*, QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#8 0x00007fffee6a1df0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#9 0x00007ffff5240cca in QWidgetPrivate::sendPaintEvent(QRegion const&) () at /usr/lib/libQt5Widgets.so.5
#10 0x00007ffff5241319 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
at /usr/lib/libQt5Widgets.so.5
#11 0x00007ffff521105e in () at /usr/lib/libQt5Widgets.so.5
#12 0x00007ffff5211287 in () at /usr/lib/libQt5Widgets.so.5
#13 0x00007ffff52300ef in QWidgetPrivate::syncBackingStore() ()
at /usr/lib/libQt5Widgets.so.5
#14 0x00007ffff5247fc8 in QWidget::event(QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff534648b in QMainWindow::event(QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#16 0x00007ffff5200e0c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#17 0x00007ffff5208581 in QApplication::notify(QObject*, QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#18 0x00007fffee6a1df0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#19 0x00007fffee6a457d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#20 0x00007fffee6f6313 in () at /usr/lib/libQt5Core.so.5
#21 0x00007fffeba11587 in g_main_context_dispatch ()
at /usr/lib/libglib-2.0.so.0
#22 0x00007fffeba117f0 in () at /usr/lib/libglib-2.0.so.0
#23 0x00007fffeba1189c in g_main_context_iteration ()
at /usr/lib/libglib-2.0.so.0
#24 0x00007fffee6f671f in QEventDispatcherGlib::processEvents(QFlags) () at /usr/lib/libQt5Core.so.5
#25 0x00007fffee6a024a in QEventLoop::exec(QFlags) () at /usr/lib/libQt5Core.so.5
#26 0x00007fffee6a874c in QCoreApplication::exec() ()
at /usr/lib/libQt5Core.so.5


Comments

I was experiencing crashes with several of the latest commits (6a0fb3f, c5f46bb and b2e10c7). But I have to add that they were comiled earlier on my system.
I'm now running a fresh build of the very latest (29d6140) and sofar it hasn't crashed.
Maybe the reason were some incompatible updated libraries ... I'll report back or will close this in case it's solved by that.

Status (old) closed active

Well, actually, it just happened again with yesterday's rebuild. This is with commit 29d614 now:

(gdb) run
Starting program: /usr/bin/mscore-git
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffd6903700 (LWP 14132)]
qt5ct: using qt5ct plugin
[New Thread 0x7fffc8def700 (LWP 14133)]
[New Thread 0x7fffbfffe700 (LWP 14134)]
[New Thread 0x7fffbf7fd700 (LWP 14135)]
[New Thread 0x7fffbeba6700 (LWP 14136)]
qt5ct: palette support is disabled
[New Thread 0x7fffac23d700 (LWP 14137)]
[New Thread 0x7fffaba3c700 (LWP 14138)]
qt5ct: custom style sheet is disabled
libpng warning: iCCP: known incorrect sRGB profile
[New Thread 0x7fffaa673700 (LWP 14141)]

Thread 1 "mscore-git" received signal SIGSEGV, Segmentation fault.
0x0000000000e25dcb in Ms::BspTree::items(QRectF const&) ()
(gdb) bt
#0 0x0000000000e25dcb in Ms::BspTree::items(QRectF const&) ()
#1 0x0000000000ce5d4a in Ms::Page::items(QRectF const&) ()
#2 0x0000000000753d3c in Ms::ScoreView::paint(QRect const&, QPainter&) ()
#3 0x0000000000754fc5 in Ms::ScoreView::paintEvent(QPaintEvent*) ()
#4 0x00007ffff5247ef8 in QWidget::event(QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#5 0x00007ffff5200e0c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#6 0x00007ffff5208581 in QApplication::notify(QObject*, QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#7 0x00007fffee6a1df0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#8 0x00007ffff5240cca in QWidgetPrivate::sendPaintEvent(QRegion const&) () at /usr/lib/libQt5Widgets.so.5
#9 0x00007ffff5241319 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
at /usr/lib/libQt5Widgets.so.5
#10 0x00007ffff521105e in () at /usr/lib/libQt5Widgets.so.5
#11 0x00007ffff5211287 in () at /usr/lib/libQt5Widgets.so.5
#12 0x00007ffff52300ef in QWidgetPrivate::syncBackingStore() ()
at /usr/lib/libQt5Widgets.so.5
#13 0x00007ffff5247fc8 in QWidget::event(QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#14 0x00007ffff534648b in QMainWindow::event(QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff5200e0c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#16 0x00007ffff5208581 in QApplication::notify(QObject*, QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#17 0x00007fffee6a1df0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#18 0x00007ffff5211a65 in () at /usr/lib/libQt5Widgets.so.5
#19 0x00007ffff521272d in () at /usr/lib/libQt5Widgets.so.5
#20 0x00007ffff5232a18 in QWidget::repaint(QRect const&) ()
at /usr/lib/libQt5Widgets.so.5
#21 0x00007ffff5232a83 in QWidget::repaint() ()
at /usr/lib/libQt5Widgets.so.5
#22 0x00007ffff52e9711 in () at /usr/lib/libQt5Widgets.so.5
#23 0x00007ffff52e9924 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/libQt5Widgets.so.5
#24 0x00007ffff53b529a in QToolButton::mouseReleaseEvent(QMouseEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#25 0x00007ffff5247ef8 in QWidget::event(QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#26 0x00007ffff53b5379 in QToolButton::event(QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
---Type to continue, or q to quit---

Status (old) active needs info

In order to help we would need you to attach the score you are having problems with and precise steps to reproduce the problem.

Ok. Well in this case here (score attached) I have just started the score. I have set up the instruments and entered the first few notes with step input on the computer keyboard when it froze.

(gdb) run
Starting program: /usr/bin/mscore-git
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffd68f7700 (LWP 9445)]
qt5ct: using qt5ct plugin
[New Thread 0x7fffc8def700 (LWP 9446)]
[New Thread 0x7fffbfffe700 (LWP 9447)]
[New Thread 0x7fffbf7fd700 (LWP 9448)]
[New Thread 0x7fffbeba8700 (LWP 9449)]
qt5ct: palette support is disabled
qt5ct: custom style sheet is disabled
libpng warning: iCCP: known incorrect sRGB profile
[New Thread 0x7fffabc5d700 (LWP 9602)]
[New Thread 0x7fffab45c700 (LWP 9603)]
[New Thread 0x7fffaab86700 (LWP 9638)]
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
[New Thread 0x7fffaa129700 (LWP 9897)]

Thread 1 "mscore-git" received signal SIGBUS, Bus error.
0x0000000000d18394 in Ms::Selection::clear() ()
(gdb) bt
#0 0x0000000000d18394 in Ms::Selection::clear() ()
#1 0x0000000000dbf7dd in Ms::Score::upDown(bool, Ms::UpDownMode) ()
#2 0x0000000000dc02ca in Ms::Score::cmdPitchUpOctave() ()
#3 0x0000000000dbdaa4 in Ms::Score::cmd(QAction const*) ()
#4 0x00000000007526cd in Ms::ScoreView::cmd(QAction const*) ()
#5 0x000000000083485f in Ms::MuseScore::cmd(QAction*, QString const&) ()
#6 0x0000000000834ae1 in Ms::MuseScore::cmd(QAction*) ()
#7 0x0000000000b0dbd5 in ()
#8 0x00007fffee6c40c9 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#9 0x0000000000b07be2 in Ms::ScoreTab::actionTriggered(QAction*) ()
#10 0x00007fffee6c40c9 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#11 0x00007ffff51fb48f in QActionGroup::triggered(QAction*) () at /usr/lib/libQt5Widgets.so.5
#12 0x00007ffff51fc009 in () at /usr/lib/libQt5Widgets.so.5
#13 0x00007fffee6c40c9 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#14 0x00007ffff51f7992 in QAction::triggered(bool) () at /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff51fa380 in QAction::activate(QAction::ActionEvent) () at /usr/lib/libQt5Widgets.so.5
#16 0x00007ffff51facfc in QAction::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#17 0x00007ffff51fe35c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#18 0x00007ffff5205ad1 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#19 0x00007fffee6988e0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#20 0x00007fffef569d98 in QShortcutMap::dispatchEvent(QKeyEvent*) () at /usr/lib/libQt5Gui.so.5
#21 0x00007fffef569e59 in QShortcutMap::tryShortcut(QKeyEvent*) () at /usr/lib/libQt5Gui.so.5
#22 0x00007fffef52279d in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) () at /usr/lib/libQt5Gui.so.5
#23 0x00007fffef539ca4 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () at /usr/lib/libQt5Gui.so.5
#24 0x00007fffef53f1c5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) ()
at /usr/lib/libQt5Gui.so.5
#25 0x00007fffef51d15b in QWindowSystemInterface::sendWindowSystemEvents(QFlags) () at /usr/lib/libQt5Gui.so.5
#26 0x00007fffd8ab8dc0 in () at /usr/lib/libQt5XcbQpa.so.5
#27 0x00007fffeba06587 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#28 0x00007fffeba067f0 in () at /usr/lib/libglib-2.0.so.0
#29 0x00007fffeba0689c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#30 0x00007fffee6ed2bf in QEventDispatcherGlib::processEvents(QFlags) () at /usr/lib/libQt5Core.so.5
#31 0x00007fffee696d3a in QEventLoop::exec(QFlags) () at /usr/lib/libQt5Core.so.5
#32 0x00007fffee69f23c in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#33 0x0000000000708f17 in main ()

Attachment Size
supper_1_64_ms.mscz 11.35 KB

What I did exactly was:
- Clicked on the rest in the Soprano stave
- hit 4 to enter a quaver
- hit g
- hit R_Control + arrow-up to move the note an octave up
That's exactly when it crashed already.

Hmm, I can't reproduce on Windows. I can only guess that is some sort of version incompatibiity in the libraries you have installed. FWIW, I am using Qt 5.6

I have no idea if this is any more helpful, but at least here I found a reliable way to crash mscore on my system:
In the attached score select the 4th bar in the first stave (James) and copy it with Ctrl+c, then select the 4th bar of the stave below (Andrew) and paste with Ctrl+v.

Attachment Size
supper_1_64_ms.mscz 21.28 KB
Status (old) needs info closed

Compile instructions state that we are on Qt5.6 for master, which is an LTS version.

Last time I tried (which admittedly is almost two months ago), I couldn't even build against 5.7.

Title recent segfaulting on Archlinux Crash on copy-paste of particular measure
Status (old) closed active

I can confirm the crash on copy/paste. Well, on my system it hangs. It's probably unrelated to whatever was going on in the original report, but since that is probably not reproducible and might be a result of a version incompatibility, I guess it makes sense to just use this issue for the copy and paste.

Title Crash on copy-paste of particular measure Copy-paste a note with a flat in a staff for a transposing instrument causes a crash or broke the layout

4fc5d47 / Windows7

Steps from scratch:

1) New score for Flute and Bb Clarinet
2) Enter a quarter note with a flat (eg Bb or Eb, no issue with Gb or other note with flat or not) in the flute staff first measure

The test file: file test.mscz

First scenario:

3) Copy-paste this note (or the measure) into the first measure of the Clarinet staff.

Result: crash
flat.jpg
- Same result by copying-pasting natural notes (C and F naturals) from the Clarinet staff into the Flute staff.

Second scenario:

3) Copy-paste this note (or the measure) into the second or following measures of the Clarinet staff.

Result: the layout is completely broken (broken staves, worse after Undo)

- No issue by pressing "Concert Pitch", or with a note/measure without flat: as on the attached file in this issue report.

No stack trace (in that first scenario), but an assertion failure:
Fatal: ASSERT failure in QList::erase: "The specified iterator argument 'afirst' is invalid", file C:/Qt/5.6/mingw49_32/include/QtCore/qlist.h, line 908 (:0, )