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
[MU4 Issue] Entering Roman numeral analysis crashes when using screen reader #15897
Comments
Hi. Some clarification to your comment above. For me, the crash occurs immediately after invoking the "Roman numeral analysis" menu item. No Roman numeral entry is necessary to cause the crash in my case. |
Using orca, the following gets printed to the console in the window I started orca from (not the window I started MuseScore from): (orca:7559): dbind-CRITICAL **: 13:17:59.426: atspi_accessible_set_cache_mask: assertion 'accessible->parent.app != NULL' failed Which is probably a good clue. |
@MarcSabatella
You implemented it in this PR #5459 The regex looks invalid and the crash started to occur after replacing QRegularExpression with std::regex. Can you please explain how regex was supposed to work? |
Thanks for the analysis! As I recall, the overall point of the change was to make the screen understand to read "five" (translated as appropriate) instead of "vee" when reading the Roman number "V", and similarly for "flat" instead of "bee" for "b", etc. However, in RNA, the letter "b" can sometimes mean the letter "b" and not flat. This is accomplished while typing the RNA by preceding the "b" with a backslash. Backslash can also be used to escape other symbols that are otherwise interpreted specially. So the point of this particular section of code was supposed to be, to only match and perform the substitution (e.g., replacing "b" with the actual Unicode flat sign) if the first symbol is not preceded by a backslash. I'm not an expert in regular expressions and probably arrived at what I did through studying the Qt documentation specifically and also some trial and error, so no great surprise if it only worked accidentally in Qt and causes problems in a different implementation. Doing a little digging, I think this was meant to be an example of a "negative lookbehind assertion" as per https://www.regular-expressions.info/lookaround.html. I doubt I had ever heard of that before writing this code, and I must have instantly forgot anything I ever learned about it once I got it working, because I have no recollection of this anymore! But clearly, that was the intent - I wanted to match "b not preceded by backslash". So, hopefully there is a way to do that still. BTW, If I'm reading my code correctly, it seems like it will actually read the backslash if present. That's not good. I'd want "b" to read "flat" and "\b" to read "bee" (not "backslash bee"). If you're able to fix this, that would be fantastic! |
BTW, a brute force non-regex solution might be, first just replace all the b's with flat (♭) normally, but then do a second pass and replace occurrences of "\♭" with the letter b again. |
Here's a debug log from NVDA detailing what occurs from NVDA's perspective. This snippet begins immediately after I press enter on the "Roman numeral analysis" menu item. The full log is also attached. Finally, simply restarting NVDA after launching MuseScore is enough to prevent the crash when using Nightly-230190506-4.0.1-9b70a8c-x86_64, however this does not work in version 4.0.1.230121751 revision 9b70a8c. This log was taken while using MuseScore version 4.0.1.230121751 revision 9b70a8c.
|
…n does not support lookarounds
…n does not support lookarounds
Done. |
…n does not support lookarounds
fixed #15897: Entering Roman numeral analysis crashes when using screen reader
…n does not support lookarounds
fixed #15897: Entering Roman numeral analysis crashes when using screen reader
…n does not support lookarounds
🟢 FIXED |
Describe the bug
Enter RNA text crashes MuseScore if a sxcreen reader isrunning
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The text is entered normally
Screenshots
If applicable, add screenshots to help explain your problem.
Platform information
Confirmed using NVDA, JAWS, and Narrator on Windows, also Orca on Linux. In some cases apparently the crash might happen sooner, like right after step 3, depending on how quickly you type I guess.
See https://musescore.org/en/node/342415 for more info
The text was updated successfully, but these errors were encountered: