-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
[iOS] TextField input emoji crashes #128031
Comments
Thanks for the report. This issue is reproducible on the latest Also, it doesn't seem to be related to Impeller since the crash also occurs if I disable Impeller. Labeling the issue for further investigation. LogsMake a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
The behavior of the UICollectionViewFlowLayout is not defined because:
the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
The relevant UICollectionViewFlowLayout instance is <_InvertibleFlowLayout: 0x119e6a290>, and it is attached to <UICollectionView: 0x11c89a400; frame = (0 0; 375 4); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x282881b60>; layer = <CALayer: 0x282695800>; contentOffset: {0, 0}; contentSize: {-524, 4}; adjustedContentInset: {0, 0, 0, 0}; layout: <_InvertibleFlowLayout: 0x119e6a290>; dataSource: <__UIDiffableDataSource 0x2819e2ee0: sectionCounts=[_UIDataSourceSnapshotter - 0x282677ea0:(0:30)]; sections=[0x282674260]; identifiers=[0x282676fe0]>>.
Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
The behavior of the UICollectionViewFlowLayout is not defined because:
the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
The relevant UICollectionViewFlowLayout instance is <_InvertibleFlowLayout: 0x119e6a290>, and it is attached to <UICollectionView: 0x11c89a400; frame = (0 0; 375 4); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x282881b60>; layer = <CALayer: 0x282695800>; contentOffset: {0, 0}; contentSize: {-524, 4}; adjustedContentInset: {0, 0, 0, 0}; layout: <_InvertibleFlowLayout: 0x119e6a290>; dataSource: <__UIDiffableDataSource 0x2819e2ee0: sectionCounts=[_UIDataSourceSnapshotter - 0x282677ea0:(0:30)]; sections=[0x282674260]; identifiers=[0x282676fe0]>>.
Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndexedSubscript:]: index 30 beyond bounds [0 .. 29]'
*** First throw call stack:
(0x1807bfc80 0x197fe3ee4 0x1808ba6b4 0x180762a38 0x1060c684c 0x1060c6ba8 0x18373aa00 0x182ddaf8c 0x182e02adc 0x182f61584 0x1830191a4 0x18371c1c4 0x18371e4a0 0x1836a636c 0x1836a55f4 0x1837495b4 0x1837496c4 0x182fd2f34 0x182e8d5d0 0x182bb3674 0x1837492fc 0x182bca17c 0x182bf9c9c 0x182d9aab4 0x182bcec7c 0x182bc3b40 0x182bc8f5c 0x1807e0468 0x1807f0598 0x180732774 0x180737e48 0x18074b194 0x1a127e988 0x182f4da88 0x182ce6fc8 0x10239fb90 0x1036b44d0)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001bb094bbc libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`:
-> 0x1bb094bbc <+8>: b.lo 0x1bb094bd8 ; <+36>
0x1bb094bc0 <+12>: stp x29, x30, [sp, #-0x10]!
0x1bb094bc4 <+16>: mov x29, sp
0x1bb094bc8 <+20>: bl 0x1bb09060c ; cerror_nocancel
Target 0: (Runner) stopped.
Lost connection to device. flutter doctor -v (master)[!] Flutter (Channel master, 3.11.0-16.0.pre.45, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
• Flutter version 3.11.0-16.0.pre.45 on channel master at /Users/huynq/Documents/GitHub/flutter_master
! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 3c61b9d834 (37 minutes ago), 2023-05-31 19:39:15 -0700
• Engine revision f9bc342c84
• Dart version 3.1.0 (build 3.1.0-155.0.dev)
• DevTools version 2.23.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 32.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
[✓] VS Code (version 1.78.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.64.0
[✓] Connected device (5 available)
• RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 11 (API 30)
• iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios • iOS 15.7.2 19H218
• iPhone 14 Pro (mobile) • 98082851-A0C4-4E39-A310-21C48B10A364 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 113.0.5672.126
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category. |
This started with flutter/engine@b1201809 |
The `isRTLAtPosition` method had a bug, it used `NSInteger max = [_selectionRects count]` instead of `NSInteger max = [_selectionRects count] - 1`. But I realized we don't even need the function any more, it was used in a few places in previous iterations of #36643, but in the only place remaining, we actually already have the selection rect and don't need to search for it by position. Btw as an explanation of the crash, I guess there is some mismatch between code point and character count somewhere. UIKit was asking for `caretRectForPosition:2` when we only had 1 character. This could have only crashed when floating cursor selection was used, but actually when switching to CJK keyboard, UIKit turns out to use `caretRectForPosition` to calculate something about the composing rect. Fixes flutter/flutter#128031
The `isRTLAtPosition` method had a bug, it used `NSInteger max = [_selectionRects count]` instead of `NSInteger max = [_selectionRects count] - 1`. But I realized we don't even need the function any more, it was used in a few places in previous iterations of #36643, but in the only place remaining, we actually already have the selection rect and don't need to search for it by position. Btw as an explanation of the crash, I guess there is some mismatch between code point and character count somewhere. UIKit was asking for `caretRectForPosition:2` when we only had 1 character. This could have only crashed when floating cursor selection was used, but actually when switching to CJK keyboard, UIKit turns out to use `caretRectForPosition` to calculate something about the composing rect. Fixes flutter/flutter#128031
…42539) The `isRTLAtPosition` method had a bug, it used `NSInteger max = [_selectionRects count]` instead of `NSInteger max = [_selectionRects count] - 1`. But I realized we don't even need the function any more, it was used in a few places in previous iterations of flutter#36643, but in the only place remaining, we actually already have the selection rect and don't need to search for it by position. Btw as an explanation of the crash, I guess there is some mismatch between code point and character count somewhere. UIKit was asking for `caretRectForPosition:2` when we only had 1 character. This could have only crashed when floating cursor selection was used, but actually when switching to CJK keyboard, UIKit turns out to use `caretRectForPosition` to calculate something about the composing rect. Fixes flutter/flutter#128031
…42540) The `isRTLAtPosition` method had a bug, it used `NSInteger max = [_selectionRects count]` instead of `NSInteger max = [_selectionRects count] - 1`. But I realized we don't even need the function any more, it was used in a few places in previous iterations of flutter#36643, but in the only place remaining, we actually already have the selection rect and don't need to search for it by position. Btw as an explanation of the crash, I guess there is some mismatch between code point and character count somewhere. UIKit was asking for `caretRectForPosition:2` when we only had 1 character. This could have only crashed when floating cursor selection was used, but actually when switching to CJK keyboard, UIKit turns out to use `caretRectForPosition` to calculate something about the composing rect. Fixes flutter/flutter#128031
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 |
Is there an existing issue for this?
Steps to reproduce
Expected results
APP does not flash back
Actual results
App crashes
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
186_1685609701.mp4
Logs
Logs
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: