musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.27k stars 2.65k forks source link

Crash when undoing a split measure. #11488

Closed Tantacrul closed 2 years ago

Tantacrul commented 2 years ago

To Reproduce Steps to reproduce the behavior:

  1. Open this score: https://www.dropbox.com/s/dzwvbhobmxo9yzl/MS4_Advert_01.mscz?dl=0

  2. Go to measure no.9 and select the following note in the Oboe

    image
  3. Select Tools > Measures > Split measure before selected note/rest

  4. Observe that the measure is now split:

    image
  5. Now press Ctrl+Z undo the action (this regularly causes a crash)

  6. If it doesn't crash then redo the split measure action again (this should produce the crash)

This crash is not 100% reproducible on new scores. However, once you perform the split action, it doesn't take long for the app to crash when trying to do something else. The score I provided above is one where the problem was most easily reproduced.

donarturo11 commented 2 years ago

split-crash-20220501 Function EngravingObject* EngravingObject::explicitParent() const returns nullptr or pointer to m_parent

donarturo11 commented 2 years ago

backtrace-after-crash.txt So with gdb with backtrace I found problem in tie.cpp:976. I checked too that joining measures from menu doesn't cause SEGFAULT. I'll check this function. I think that in this place must be a risk to call to unavailable resource causing SEGFAULT.