-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix realtime noteentry 8th crash (fixes #321716) #9593
Conversation
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal.
The linked issue should be pretty self-explanatory, and this definitely fixes the issue for me, but I'm not familiar at all with MuseScore development. How should I go about getting this included in the next point release? In particular, is it OK if I just check the checkmark here to signify that I agree to the CLA for this commit only? How should I go about adding tests here? |
Better rebase the PR to the master branch. There won't be any merges to the 3.6.2 branch and most probably not to the 3.x branch either (I've You do need to sign the CLA though, on musescore.org. |
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Intgration of PR musescore#9593
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
Thank you, that's one big PR but I'm glad some of the issues of 3.6.3 are getting fixed while 4.0 is being worked on! I'm very much okay with it in the context of this small bugfix, hence the PR, but I was a bit iffy about signing the CLA irrevocably, that particular bit sounds like it just ignores the GPL for any contribution (which is never actually defined in that document...) that I might later do close to MuseScore:
Trivial contributions (which this is IMO) should be fine, according to this:
|
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
The CLA doesn't change anything about the MuseScore code being under GPL (GPL2 for 3.x, GPL3 for master), only whether parts of the code can also get used in other closed source stuff, like the mobile apps. At least that's my understanding. |
Gotcha, I've thought about it and don't want to sign the CLA. Thanks for the help in any case! |
It'd still need to get rebased onto master. |
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
I'm just here to say thanks and please merge if possible, this issue is very annoying... 😓 |
So you mean that #9000 will never be merged and than this PR should be rebased on top of master to be merged? |
Thanks! Then maybe this can be closed... |
Indeed. |
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
When comparing a Fraction (ticks2measureEnd) to the TDuration of the note being entered (is.duration()), the Fraction is implicitly converted by the TDuration(const Fraction&) ctor. Because of extra logic in TDuration, this can trigger a Q_ASSERT and crash Musescore in case the remaining Fraction cannot be exactly converted into a proper TDuration. In this case, this point is reached when ticks2measureEnd = 5/8 and is.duration() = 1/8. Since what we really want here is to compare the Fraction to the exact note duration (and not the other way around), we can just do an exact comparison between is.duration().fraction() and ticks2measureEnd to achieve the same goal. Integration of PR musescore#9593
Resolves: https://musescore.org/en/node/321716
To reproduce (on MuseScore 3.6.2):