Lmms: Piano Roll - Crash on mouse wheel scroll in the note edit area on a new/empty project

Created on 2 Jun 2018  路  10Comments  路  Source: LMMS/lmms

In an empty Song Editor, new project before any notes has been entered. If you scroll the mouse wheel in the note edit area (bottom), lmms crashes.

Replicated on lmms-1.1.3 and the latest betas.

Original report in the forum and video (from the forum post):
https://lmms.io/forum/viewtopic.php?f=7&t=27410
https://www.youtube.com/watch?v=P8cQTYuCiJE

Program received signal SIGSEGV, Segmentation fault.
0x00000000005f1ba0 in QVector<Note*>::begin (this=0x1f0) at /usr/include/qt4/QtCore/qvector.h:248
248     inline const_iterator begin() const { return p->array; }
(gdb) bt
#0  0x00000000005f1ba0 in QVector<Note*>::begin (this=0x1f0) at /usr/include/qt4/QtCore/qvector.h:248
#1  0x00000000005eb694 in PianoRoll::wheelEvent (this=0x15b3d50, we=0x7fffffffd410) at /home/zonkmachine/builds/lmms/lmms/src/gui/editors/PianoRoll.cpp:3203
#2  0x00007ffff71220e4 in QWidget::event (this=0x15b3d50, event=0x7fffffffd410) at kernel/qwidget.cpp:8395
#3  0x00007ffff70d2e2c in QApplicationPrivate::notify_helper (this=this@entry=0x9ad590, receiver=receiver@entry=0x15b3d50, e=e@entry=0x7fffffffd410)
    at kernel/qapplication.cpp:4567
#4  0x00007ffff70da4f4 in QApplication::notify (this=<optimized out>, receiver=0x15b3d50, e=0x7fffffffd410) at kernel/qapplication.cpp:4165
#5  0x00007ffff695c4dd in QCoreApplication::notifyInternal (this=0x99ead0, receiver=receiver@entry=0x15b3d50, event=event@entry=0x7fffffffd410)
    at kernel/qcoreapplication.cpp:953
#6  0x00007ffff7147adf in sendSpontaneousEvent (event=0x7fffffffd410, receiver=0x15b3d50)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#7  QETWidget::translateWheelEvent (this=this@entry=0xf04550, global_x=<optimized out>, global_y=<optimized out>, delta=-120, buttons=..., modifiers=..., 
    orient=Qt::Vertical) at kernel/qapplication_x11.cpp:4672
#8  0x00007ffff714decc in QETWidget::translateMouseEvent (this=this@entry=0xf04550, event=event@entry=0x7fffffffd8a0) at kernel/qapplication_x11.cpp:4449
bug

All 10 comments

Putting if( !hasValidPattern() ){return;} before the for loop fixes this. I'm a bit unsure to as precisely where though.

I can find some more places where the check is missing. I'll try to find more crashes tomorrow.

Oki! I suggest you assign this to yourself then.

Functions which need the check:

shiftSemiTone
shiftPos
keyPressEvent // Alt + L/R arrow
wheelEvent

Functions which lack of the check, but don't need the check:

isSelection
selectionCount

testPlayNote
pauseTestNotes
testPlayKey

mouseReleaseEvent // ActionMoveNote
dragNotes // ActionMoveNote, ActionResizeNote

desiredPlayModeForAccompany

noteUnderMouse

Another one. <Shift> + <Arrow key>

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000000005f1bfa in QVector<Note*>::begin (this=0x1f0) at /usr/include/qt4/QtCore/qvector.h:248
248     inline const_iterator begin() const { return p->array; }
(gdb) bt
#0  0x00000000005f1bfa in QVector<Note*>::begin (this=0x1f0) at /usr/include/qt4/QtCore/qvector.h:248
#1  0x00000000005e2c05 in PianoRoll::isSelection (this=0x2615f10) at /home/zonkmachine/builds/lmms/lmms/src/gui/editors/PianoRoll.cpp:1013
#2  0x00000000005e2a4d in PianoRoll::shiftPos (this=0x2615f10, amount=12) at /home/zonkmachine/builds/lmms/lmms/src/gui/editors/PianoRoll.cpp:976
#3  0x00000000005e3328 in PianoRoll::keyPressEvent (this=0x2615f10, ke=0x7ffd6aaaef00)
    at /home/zonkmachine/builds/lmms/lmms/src/gui/editors/PianoRoll.cpp:1117
#4  0x00007f4f7872d3e4 in QWidget::event (this=0x2615f10, event=0x7ffd6aaaef00) at kernel/qwidget.cpp:8422

That's also included, too.

It doesn't seem to be. The above crash is on 7f1ffd0982d3372d3a695fa7a7dc2a77e5bd859f . I should probably have posted this in the PR.

Okay. It seems like I missed one call. I'll fix it.

Fixed that. Please re-test the pull request!

Was this page helpful?
0 / 5 - 0 ratings