You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TextField toggle a11y off/on crashes on iOS #43795
So I think I understand what is going on here. The AccessibilityBridge constructs a mirror SemanticObject tree that it hands to the system for VoiceOver to navigate. When a text field is focused in the semantic tree a TextInputSemanticsObject object is constructed with a weak pointer back to the bridge.
When VoiceOver is turned off the bridge is destroyed and the semantic objects are released. However, it appears that something in the system is still holding onto a reference to the TextInputSemanticsObject, as it isn't dealloc'd at this time. When VoiceOver is turned back on, the system sends a accessibilityElementDidLoseFocus message to the text input object. In response it tries to dereference the weak pointer to the now defunct bridge and it crashes.
Not sure why or what part of the system is holding on to the text input object, as we have shut down the bridge and reset all the accessibility elements on the main view. I can fix this with a guard against the weak reference being dead, but that feels more like a bandaid. I would like to understand why the system is still referencing this after VoiceOver is shutdown and preferably find a way to reset set it completely.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
HansMuller commentedon Oct 30, 2019
CC @darrenaustin
darrenaustin commentedon Oct 31, 2019
I am able to reproduce the problem with the given test and instructions. Needs more investigation, but it looks like a problem in the engine.
Here is the stack trace for future reference:
darrenaustin commentedon Nov 6, 2019
So I think I understand what is going on here. The
AccessibilityBridgeconstructs a mirrorSemanticObjecttree that it hands to the system for VoiceOver to navigate. When a text field is focused in the semantic tree aTextInputSemanticsObjectobject is constructed with a weak pointer back to the bridge.When VoiceOver is turned off the bridge is destroyed and the semantic objects are released. However, it appears that something in the system is still holding onto a reference to the
TextInputSemanticsObject, as it isn't dealloc'd at this time. When VoiceOver is turned back on, the system sends aaccessibilityElementDidLoseFocusmessage to the text input object. In response it tries to dereference the weak pointer to the now defunct bridge and it crashes.Not sure why or what part of the system is holding on to the text input object, as we have shut down the bridge and reset all the accessibility elements on the main view. I can fix this with a guard against the weak reference being dead, but that feels more like a bandaid. I would like to understand why the system is still referencing this after VoiceOver is shutdown and preferably find a way to reset set it completely.
github-actions commentedon Aug 25, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.