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.26k stars 2.65k forks source link

Changing the Actual Value of Measure Duration in 3/4 Time Signature from 3/4 to 3/8 crashes Musescore #24298

Closed TheRealBluePhoenix135 closed 1 month ago

TheRealBluePhoenix135 commented 2 months ago

Issue type

Crash or freeze

Description with steps to reproduce

Loading up a score with a time signature of 3/4 Creating a pickup measure of 3/8 for 3/4 measure

  1. Right-click a measure to be used as a pickup
  2. Click Measure properties
  3. Change 3/4 to 3/8

Supporting files, videos and screenshots

https://github.com/user-attachments/assets/c4573b56-14c9-4d75-9ea6-91d83dc67164

musescore.zip

What is the latest version of MuseScore Studio where this issue is present?

Musescore Studio 4.4

Regression

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

Operating system

Windows 11

Additional context

No response

Checklist

zacjansheski commented 2 months ago

I haven't been able to reproduce this. I also can't see what you are doing in the video.

Does it happen on any score for you or only specific files?

zacjansheski commented 2 months ago

@cbjeukendrup please take a look at the logs attached by OP

cbjeukendrup commented 2 months ago

The archive contains multiple different crash logs, and I'm not sure which one is relevant for this issue. I found one that may be. An excerpt from the stack looks like this:

Click to expand ``` 4507 MuseScore4.exe!mu::engraving::populateRhythmicList(std::vector > *,mu::engraving::Fraction const &,bool,mu::engraving::Fraction const &,mu::engraving::TimeSigFrac const &,int) [durationtype.cpp : 603 + 0x1d] rbx = 0x0000000000000000 rbp = 0x00000000000541d8 rsp = 0x000000000014a580 r12 = 0x0000000000000001 r13 = 0x000000000014a698 r14 = 0x0000000000054178 r15 = 0x0000000000000000 rip = 0x0000000140a990fd Found by: call frame info 4508 MuseScore4.exe!mu::engraving::toRhythmicDurationList(mu::engraving::Fraction const &,bool,mu::engraving::Fraction,mu::engraving::TimeSigFrac const &,mu::engraving::Measure *,int) [durationtype.cpp : 524 + 0x3f] rbx = 0x0000000000000000 rbp = 0x00000000000541d8 rsp = 0x000000000014a660 r12 = 0x0000000000000001 r13 = 0x000000000014a698 r14 = 0x0000000000054178 r15 = 0x0000000000000000 rip = 0x0000000140a9ab16 Found by: call frame info 4509 MuseScore4.exe!mu::engraving::Measure::adjustToLen(mu::engraving::Fraction,bool) [measure.cpp : 1804 + 0x146] rbx = 0x0000000000000000 rbp = 0x00000000000541d8 rsp = 0x000000000014a6f0 r12 = 0x0000000000000001 r13 = 0x000000000014a698 r14 = 0x0000000000054178 r15 = 0x0000000000000000 rip = 0x0000000140b0bc93 Found by: call frame info 4510 MuseScore4.exe!mu::notation::MeasurePropertiesDialog::apply() [measureproperties.cpp : 345 + 0x29] rbx = 0x0000000000000000 rbp = 0x00000000000541d8 rsp = 0x000000000014aa70 r12 = 0x0000000000000001 r13 = 0x000000000014a698 r14 = 0x0000000000054178 r15 = 0x0000000000000000 rip = 0x00000001415116e3 Found by: call frame info 4511 Qt6Core.dll + 0xd3160 rbx = 0x0000000000000000 rbp = 0x00000000000541d8 rsp = 0x000000000014ab50 r12 = 0x0000000000000001 r13 = 0x000000000014a698 r14 = 0x0000000000054178 r15 = 0x0000000000000000 rip = 0x00007ffd26273160 Found by: call frame info ```

and then it gets into seemingly infinite recursion in populateRhythmicList, leading to a stack overflow.

I would say that stack overflow crashes should be deterministically reproducible, so there must be some special circumstances. @TheRealBluePhoenix135 Could you upload the score file where this is happening? (wrap it in a ZIP file for GitHub to accept it)

mercuree commented 1 month ago

Maybe text frame is a key here

https://github.com/user-attachments/assets/db474d83-3c17-4392-9a00-adec3f24f0df

Based on report here

cadiz2 commented 1 month ago

Came up again: https://musescore.org/en/node/368364

cbjeukendrup commented 1 month ago

Seems introduced in https://github.com/musescore/MuseScore/commit/8d53ce0b0f5870034327e37a195626f4d95086d8#diff-ff5532262d8116ddcb0bd58ac8acb207e1e3dee8860e2f70f69f6ba5c1e463deR1801, although that commit itself may not be at fault