MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

Tempo line click and drag to beginning of score crash

Open zacjansheski opened this issue 1 year ago • 1 comments

Issue type

Crash or freeze

Bug description

If you click/drag the tail of a tempo line and send it to the beginning of the score, MuseScore crashes.

In Master, not 4.3.1

Steps to reproduce

  1. Make a score with a tempo line (rit.../acel.../etc)
  2. Click and drag the end of the line to the beginning of the score
  3. Crash

Screenshots/Screen recordings

https://github.com/musescore/MuseScore/assets/69917893/f1300d90-4ae1-421c-8fc5-2e98943f0076

MuseScore Version

OS: Windows 11 Version 2009 or later, Arch.: x86_64, MuseScore Studio version (64-bit): 4.4.0-241420305, revision: github-musescore-musescore-449a64e

Regression

Yes, this used to work in a previous version of MuseScore 4.x

Operating system

All

Additional context

TempoLineCrash.zip

zacjansheski avatar May 21 '24 20:05 zacjansheski

Alright, I’ve investigated this but haven’t found a satisfying fix just yet. Posting my findings for now, will return to this later with fresh eyes.



The moment the right grip is dragged beyond the problematic point, the LineSegment is put into some sort of invalid state and disappears. This isn’t actually the point where crash happens - if you’re quick enough you can release the drag and you’re left with an invisible line segment (which can be brought back if you insert a measure before the first).

We then get a layout call which resets the explicit parent. Whatever the “invalid state” is exactly (I'm still figuring this out), it prevents the LineSegment from being re-assigned an explicit parent during the layout. This is eventually what causes the crash at the next drag event (sys is null in findSegmentForGrip due to no explicit parent).

mathesoncalum avatar May 23 '24 22:05 mathesoncalum

I can no longer reproduce this in the latest nightly. @zacjansheski @mathesoncalum could you perhaps please cross-check and verify?

bkunda avatar Jul 29 '24 08:07 bkunda

Dragging to the top menu crashes the app.

https://github.com/user-attachments/assets/de81dc44-2fc3-42bf-b673-367a2e0d9575

zacjansheski avatar Aug 05 '24 13:08 zacjansheski