Skip to content
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

Closed
2 tasks done
qiuyueL opened this issue Jun 1, 2023 · 3 comments · Fixed by flutter/engine#42540
Closed
2 tasks done

[iOS] TextField input emoji crashes #128031

qiuyueL opened this issue Jun 1, 2023 · 3 comments · Fixed by flutter/engine#42540
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems c: fatal crash Crashes that terminate the process engine flutter/engine repository. See also e: labels. found in release: 3.11 Found to occur in 3.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version waiting for PR to land (fixed) A fix is in flight

Comments

@qiuyueL
Copy link

qiuyueL commented Jun 1, 2023

Is there an existing issue for this?

Steps to reproduce

  1. Switch the iOS keyboard to emoji, and then tap to enter into TextField
  2. Switch the keyboard to Simplified Chinese, and the APP crashes
  3. If use the Korean, tap to enter into TextField, app is normal, and then switch the keyboard to emoji, the APP crashes.
  4. If use the Japanese, same as Chinese.

Expected results

APP does not flash back

Actual results

App crashes

Code sample

Code sample
class commentInputTextField extends StatelessWidget {
  final TextEditingController controller;
  final String? hintText;

  const commentInputTextField(
      {Key? key, required this.controller, this.hintText})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return TextField(
      controller: controller,
      autofocus: true,
      maxLength: 600,
      maxLines: null,
      minLines: 1,
      keyboardType: TextInputType.multiline,
      strutStyle: const StrutStyle(),
      style: Theme.of(context).textTheme.bodyMedium,
      inputFormatters: [
        RegexFormatter(regex: sRegexFirstNotNull),
      ],
      decoration: InputDecoration(
          fillColor: Theme.of(context).colorScheme.background,
          isDense: true,
          hintText: hintText ?? randomHintText,
          hintStyle: Theme.of(context)
              .textTheme
              .bodyMedium
              ?.copyWith(color: Theme.of(context).hintColor),
          isCollapsed: true,
          contentPadding:
              const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
          counter: SizedBox.shrink(),
          border: OutlineInputBorder(
              borderRadius: BorderRadius.circular(5),
              borderSide: BorderSide.none)),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
186_1685609701.mp4

Logs

Logs
[        ] * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
[        ]     frame #0: 0x00000001c69de158 libsystem_kernel.dylib`__pthread_kill + 8
[        ] libsystem_kernel.dylib`:
[        ] ->  0x1c69de158 <+8>:  b.lo   0x1c69de174               ; <+36>
[        ]     0x1c69de15c <+12>: stp    x29, x30, [sp, #-0x10]!
[        ]     0x1c69de160 <+16>: mov    x29, sp
[        ]     0x1c69de164 <+20>: bl     0x1c69d9b30               ; cerror_nocancel
[        ] Target 0: (Runner) stopped.
[        ] thread backtrace all
[        ] Debugger state set to detached.
[        ] process detach
[  +69 ms] * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
[        ]   * frame #0: 0x00000001c69de158 libsystem_kernel.dylib`__pthread_kill + 8
[        ]     frame #1: 0x00000001d5e245f8 libsystem_pthread.dylib`pthread_kill + 208
[        ]     frame #2: 0x0000000192fd84b8 libsystem_c.dylib`abort + 124
[        ]     frame #3: 0x00000001d5d5df54 libc++abi.dylib`abort_message + 128
[        ]     frame #4: 0x00000001d5d4ea4c libc++abi.dylib`demangling_terminate_handler() + 300
[        ]     frame #5: 0x000000018547e014 libobjc.A.dylib`_objc_terminate() + 124
[        ]     frame #6: 0x00000001d5d5d424 libc++abi.dylib`std::__terminate(void (*)()) + 12
[        ]     frame #7: 0x00000001d5d5ff90 libc++abi.dylib`__cxa_rethrow + 144
[        ]     frame #8: 0x000000018547a674 libobjc.A.dylib`objc_exception_rethrow + 40
[        ]     frame #9: 0x000000018c1e9f54 CoreFoundation`CFRunLoopRunSpecific + 780
[        ]     frame #10: 0x00000001c3301998 GraphicsServices`GSEventRunModal + 160
[        ]     frame #11: 0x000000018e47abb8 UIKitCore`-[UIApplication _run] + 868
[        ]     frame #12: 0x000000018e47a830 UIKitCore`UIApplicationMain + 312
[        ]     frame #13: 0x000000010292ea08 Runner`main at AppDelegate.swift:5:13
[        ]     frame #14: 0x00000001a98ef344 dyld`start + 1860
[        ]   thread #7, name = 'com.apple.uikit.eventfetch-thread'
[        ]     frame #0: 0x00000001c69d7ff0 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000001c69e9ad8 libsystem_kernel.dylib`mach_msg2_internal + 76
[        ]     frame #2: 0x00000001c69e9d78 libsystem_kernel.dylib`mach_msg_overwrite + 484
[        ]     frame #3: 0x00000001c69d84e4 libsystem_kernel.dylib`mach_msg + 20
[        ]     frame #4: 0x000000018c1e42b8 CoreFoundation`__CFRunLoopServiceMachPort + 156
[        ]     frame #5: 0x000000018c1e5450 CoreFoundation`__CFRunLoopRun + 1208
[        ]     frame #6: 0x000000018c1e9e90 CoreFoundation`CFRunLoopRunSpecific + 584
[        ]     frame #7: 0x000000018655a218 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208
[        ]     frame #8: 0x000000018655a114 Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 60
[        ]     frame #9: 0x000000018e59cd44 UIKitCore`-[UIEventFetcher threadMain] + 404
[        ]     frame #10: 0x0000000186571d7c Foundation`__NSThread__start__ + 704
[        ]     frame #11: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #11
[        ]     frame #0: 0x00000001d5e18718 libsystem_pthread.dylib`start_wqthread
[        ]   thread #12, name = 'io.flutter.1.ui'
[        ]     frame #0: 0x00000001c69d7ff0 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000001c69e9ad8 libsystem_kernel.dylib`mach_msg2_internal + 76
[        ]     frame #2: 0x00000001c69e9d78 libsystem_kernel.dylib`mach_msg_overwrite + 484
[        ]     frame #3: 0x00000001c69d84e4 libsystem_kernel.dylib`mach_msg + 20
[        ]     frame #4: 0x000000018c1e42b8 CoreFoundation`__CFRunLoopServiceMachPort + 156
[        ]     frame #5: 0x000000018c1e5450 CoreFoundation`__CFRunLoopRun + 1208
[        ]     frame #6: 0x000000018c1e9e90 CoreFoundation`CFRunLoopRunSpecific + 584
[        ]     frame #7: 0x00000001064bf09c Flutter`fml::MessageLoopDarwin::Run() + 88
[        ]     frame #8: 0x00000001064be0bc Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void
(fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0> >(void*) + 208
[        ]     frame #9: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #13, name = 'io.flutter.1.raster'
[        ]     frame #0: 0x00000001c69d7ff0 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000001c69e9ad8 libsystem_kernel.dylib`mach_msg2_internal + 76
[        ]     frame #2: 0x00000001c69e9d78 libsystem_kernel.dylib`mach_msg_overwrite + 484
[        ]     frame #3: 0x00000001c69d84e4 libsystem_kernel.dylib`mach_msg + 20
[        ]     frame #4: 0x000000018d63a530 QuartzCore`CA::Context::commit_transaction(CA::Transaction*, double, double*) + 8972
[        ]     frame #5: 0x000000018d66574c QuartzCore`CA::Transaction::commit() + 644
[        ]     frame #6: 0x000000018d650788 QuartzCore`CA::Transaction::flush_as_runloop_observer(bool) + 84
[        ]     frame #7: 0x000000018c1f9a58 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
[        ]     frame #8: 0x000000018c18968c CoreFoundation`__CFRunLoopDoObservers + 552
[        ]     frame #9: 0x000000018c1e5384 CoreFoundation`__CFRunLoopRun + 1004
[        ]     frame #10: 0x000000018c1e9e90 CoreFoundation`CFRunLoopRunSpecific + 584
[        ]     frame #11: 0x00000001064bf09c Flutter`fml::MessageLoopDarwin::Run() + 88
[        ]     frame #12: 0x00000001064be0bc Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void
(fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0> >(void*) + 208
[        ]     frame #13: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #14, name = 'io.flutter.1.io'
[        ]     frame #0: 0x00000001c69d7ff0 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000001c69e9ad8 libsystem_kernel.dylib`mach_msg2_internal + 76
[        ]     frame #2: 0x00000001c69e9d78 libsystem_kernel.dylib`mach_msg_overwrite + 484
[        ]     frame #3: 0x00000001c69d84e4 libsystem_kernel.dylib`mach_msg + 20
[        ]     frame #4: 0x000000018c1e42b8 CoreFoundation`__CFRunLoopServiceMachPort + 156
[        ]     frame #5: 0x000000018c1e5450 CoreFoundation`__CFRunLoopRun + 1208
[        ]     frame #6: 0x000000018c1e9e90 CoreFoundation`CFRunLoopRunSpecific + 584
[        ]     frame #7: 0x00000001064bf09c Flutter`fml::MessageLoopDarwin::Run() + 88
[        ]     frame #8: 0x00000001064be0bc Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void
(fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0> >(void*) + 208
[        ]     frame #9: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #15, name = 'io.flutter.1.profiler'
[        ]     frame #0: 0x00000001c69d7ff0 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000001c69e9ad8 libsystem_kernel.dylib`mach_msg2_internal + 76
[        ]     frame #2: 0x00000001c69e9d78 libsystem_kernel.dylib`mach_msg_overwrite + 484
[        ]     frame #3: 0x00000001c69d84e4 libsystem_kernel.dylib`mach_msg + 20
[        ]     frame #4: 0x000000018c1e42b8 CoreFoundation`__CFRunLoopServiceMachPort + 156
[        ]     frame #5: 0x000000018c1e5450 CoreFoundation`__CFRunLoopRun + 1208
[        ]     frame #6: 0x000000018c1e9e90 CoreFoundation`CFRunLoopRunSpecific + 584
[        ]     frame #7: 0x00000001064bf09c Flutter`fml::MessageLoopDarwin::Run() + 88
[        ]     frame #8: 0x00000001064be0bc Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void
(fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0> >(void*) + 208
[        ]     frame #9: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #16, name = 'io.worker.1'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e1960c libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1220
[        ]     frame #2: 0x0000000106236ad8
Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x00000001064b816c Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned
long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #17, name = 'io.worker.2'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e1960c libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1220
[        ]     frame #2: 0x0000000106236ad8
Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x00000001064b816c Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned
long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #18, name = 'io.worker.3'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e1960c libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1220
[        ]     frame #2: 0x0000000106236ad8
Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x00000001064b816c Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned
long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #19, name = 'io.worker.4'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e1960c libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1220
[        ]     frame #2: 0x0000000106236ad8
Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x00000001064b816c Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned
long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #20, name = 'io.worker.5'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e1960c libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1220
[        ]     frame #2: 0x0000000106236ad8
Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x00000001064b816c Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned
long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #21, name = 'io.worker.6'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e1960c libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1220
[        ]     frame #2: 0x0000000106236ad8
Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x00000001064b816c Flutter`void*
std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__threa
d_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned
long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #22, name = 'dart:io EventHandler'
[        ]     frame #0: 0x00000001c69d97c0 libsystem_kernel.dylib`kevent + 8
[        ]     frame #1: 0x00000001066ae14c Flutter`dart::bin::EventHandlerImplementation::EventHandlerEntry(unsigned long) + 416
[        ]     frame #2: 0x00000001066dc988 Flutter`dart::bin::ThreadStart(void*) + 88
[        ]     frame #3: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #23, name = 'Dart Profiler ThreadInterrupter'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e19638 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1264
[        ]     frame #2: 0x000000010690d9f4 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x000000010699c73c Flutter`dart::ThreadInterrupter::ThreadMain(unsigned long) + 440
[        ]     frame #4: 0x000000010690d3b4 Flutter`dart::ThreadStart(void*) + 312
[        ]     frame #5: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #24, name = 'Dart Profiler SampleBlockProcessor'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e19638 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1264
[        ]     frame #2: 0x0000000106910ec0 Flutter`dart::SampleBlockProcessor::ThreadMain(unsigned long) + 256
[        ]     frame #3: 0x000000010690d3b4 Flutter`dart::ThreadStart(void*) + 312
[        ]     frame #4: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #25, name = 'DartWorker'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e19638 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1264
[        ]     frame #2: 0x000000010690d9f4 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x000000010699d704 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
[        ]     frame #4: 0x000000010690d3b4 Flutter`dart::ThreadStart(void*) + 312
[        ]     frame #5: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #26, name = 'DartWorker'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e19638 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1264
[        ]     frame #2: 0x000000010690d9f4 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x000000010699d704 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
[        ]     frame #4: 0x000000010690d3b4 Flutter`dart::ThreadStart(void*) + 312
[        ]     frame #5: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #27, name = 'DartWorker'
[        ]     frame #0: 0x0000000106ab8528 Flutter`dart::LoadOptimizer::OptimizeGraph(dart::FlowGraph*) + 1756
[        ]     frame #1: 0x0000000106ae14a0 Flutter`dart::CompilerPass_CSE::DoBody(dart::CompilerPassState*) const + 56
[        ]     frame #2: 0x0000000106ae7854 Flutter`dart::CompilerPass::Run(dart::CompilerPassState*) const + 308
[        ]     frame #3: 0x00000001069b52d4 Flutter`dart::CompileParsedFunctionHelper::Compile(dart::CompilationPipeline*) + 3396
[        ]     frame #4: 0x00000001069b7460 Flutter`dart::CompileFunctionHelper(dart::CompilationPipeline*, dart::Function const&, bool, long) + 1760
[        ]     frame #5: 0x00000001069b7dd0 Flutter`dart::Compiler::CompileOptimizedFunction(dart::Thread*, dart::Function const&, long) + 564
[        ]     frame #6: 0x00000001069b8e70 Flutter`dart::BackgroundCompilerTask::Run() + 416
[        ]     frame #7: 0x000000010699d5f4 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 396
[        ]     frame #8: 0x000000010690d3b4 Flutter`dart::ThreadStart(void*) + 312
[        ]     frame #9: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #28, name = 'DartWorker'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e19638 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1264
[        ]     frame #2: 0x000000010690d9f4 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x0000000106838420 Flutter`dart::MutatorThreadPool::OnEnterIdleLocked(dart::MonitorLocker*) + 480
[        ]     frame #4: 0x000000010699d738 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 720
[        ]     frame #5: 0x000000010690d3b4 Flutter`dart::ThreadStart(void*) + 312
[        ]     frame #6: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #31
[        ]     frame #0: 0x00000001d5e18718 libsystem_pthread.dylib`start_wqthread
[        ]   thread #33
[        ]     frame #0: 0x00000001c69d84b0 libsystem_kernel.dylib`__workq_kernreturn + 8
[        ]   thread #34, name = 'com.apple.NSURLConnectionLoader'
[        ]     frame #0: 0x00000001c69d7ff0 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000001c69e9ad8 libsystem_kernel.dylib`mach_msg2_internal + 76
[        ]     frame #2: 0x00000001c69e9d78 libsystem_kernel.dylib`mach_msg_overwrite + 484
[        ]     frame #3: 0x00000001c69d84e4 libsystem_kernel.dylib`mach_msg + 20
[        ]     frame #4: 0x000000018c1e42b8 CoreFoundation`__CFRunLoopServiceMachPort + 156
[        ]     frame #5: 0x000000018c1e5450 CoreFoundation`__CFRunLoopRun + 1208
[        ]     frame #6: 0x000000018c1e9e90 CoreFoundation`CFRunLoopRunSpecific + 584
[        ]     frame #7: 0x000000018d36860c CFNetwork`___lldb_unnamed_symbol14140 + 344
[        ]     frame #8: 0x0000000186571d7c Foundation`__NSThread__start__ + 704
[        ]     frame #9: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #35, name = 'DartWorker'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e19638 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1264
[        ]     frame #2: 0x000000010690d9f4 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x000000010699d704 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
[        ]     frame #4: 0x000000010690d3b4 Flutter`dart::ThreadStart(void*) + 312
[        ]     frame #5: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #36, name = 'DartWorker'
[        ]     frame #0: 0x00000001c69d883c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x00000001d5e19638 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1264
[        ]     frame #2: 0x000000010690d9f4 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x000000010699d704 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
[        ]     frame #4: 0x000000010690d3b4 Flutter`dart::ThreadStart(void*) + 312
[        ]     frame #5: 0x00000001d5e1a0ec libsystem_pthread.dylib`_pthread_start + 116
[        ]   thread #37
[        ]     frame #0: 0x00000001c69d84b0 libsystem_kernel.dylib`__workq_kernreturn + 8
[        ]   thread #38
[        ]     frame #0: 0x00000001c69d84b0 libsystem_kernel.dylib`__workq_kernreturn + 8
[   +2 ms] (lldb) Process 5311 detached
[   +1 ms] (lldb) 
[        ] ios-deploy exited with code 0
[  +48 ms] Service protocol connection closed.
[        ] Lost connection to device.
[   +1 ms] DevFS: Deleting filesystem on the device
(file:///private/var/mobile/Containers/Data/Application/6E7279EF-7FB0-4920-AE3B-73A165701F02/tmp/sentence_flutter78Kt0J/sentence_flutter/)
[ +252 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed

[   +2 ms] "flutter run" took 139,524ms.
[ +240 ms] ensureAnalyticsSent: 234ms
[        ] Running 1 shutdown hook
[   +9 ms] Shutdown hooks complete
[        ] exiting with code 0

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.11.0-16.0.pre.50, on macOS 13.1 22C65 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.11.0-16.0.pre.50 on channel master at /Users/yueyue/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 1889aa2246 (14 minutes ago), 2023-06-01 03:01:57 -0400
    • Engine revision a9ed2dec45
    • Dart version 3.1.0 (build 3.1.0-159.0.dev)
    • DevTools version 2.24.0
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/yueyue/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/yueyue/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • 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 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.78.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (3 available)
    • moon的iPhone (mobile) • 40d7ea8d3051a0b89f4b8f047d9eee77696ef987 • ios            • iOS 16.4.1 20E252
    • macOS (desktop)      • macos                                    • darwin-x64     • macOS 13.1 22C65 darwin-x64
    • Chrome (web)         • chrome                                   • web-javascript • Google Chrome 113.0.5672.126
@huycozy huycozy added the in triage Presently being triaged by the triage team label Jun 1, 2023
@huycozy
Copy link
Member

huycozy commented Jun 1, 2023

Thanks for the report. This issue is reproducible on the latest master channels with simpler TextField() widget
and it doesn't appear on stable channel (3.10.2).

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.

Logs
Make 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.

@huycozy huycozy added a: text input Entering text in a text field or keyboard related problems platform-ios iOS applications specifically engine flutter/engine repository. See also e: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on c: fatal crash Crashes that terminate the process found in release: 3.11 Found to occur in 3.11 a: internationalization Supporting other languages or locales. (aka i18n) and removed in triage Presently being triaged by the triage team labels Jun 1, 2023
@jonahwilliams jonahwilliams changed the title [Impeller]TextField input emoji crashes [iOS] TextField input emoji crashes Jun 1, 2023
@jason-simmons
Copy link
Member

This started with flutter/engine@b1201809

@moffatman

@zanderso zanderso added waiting for PR to land (fixed) A fix is in flight P1 High-priority issues at the top of the work list labels Jun 5, 2023
auto-submit bot pushed a commit to flutter/engine that referenced this issue Jun 12, 2023
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
@huycozy huycozy added the r: fixed Issue is closed as already fixed in a newer version label Jun 15, 2023
Jasguerrero pushed a commit to flutter/engine that referenced this issue Jun 16, 2023
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
Jasguerrero pushed a commit to Jasguerrero/engine that referenced this issue Jun 16, 2023
…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
Jasguerrero pushed a commit to Jasguerrero/engine that referenced this issue Jun 17, 2023
…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
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems c: fatal crash Crashes that terminate the process engine flutter/engine repository. See also e: labels. found in release: 3.11 Found to occur in 3.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version waiting for PR to land (fixed) A fix is in flight
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants