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

Crash after evaluating RegExp twice on iOS & Android #121270

Closed
vsaase opened this issue Feb 22, 2023 · 14 comments
Closed

Crash after evaluating RegExp twice on iOS & Android #121270

vsaase opened this issue Feb 22, 2023 · 14 comments
Assignees
Labels
c: crash Stack traces logged to the console c: fatal crash Crashes that terminate the process c: regression It was better in the past than it is now dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. found in release: 3.7 Found to occur in 3.7 found in release: 3.8 Found to occur in 3.8 has reproducible steps The issue has been confirmed reproducible and is ready to work on P0 Critical issues such as a build break or regression platform-android Android applications specifically platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@vsaase
Copy link

vsaase commented Feb 22, 2023

Steps to Reproduce

I encountered this crash after upgrading from 3.7.0 (no crash there)
Since 3.7.1 all stable and beta versions are affected.
Targets macOS and Chrome and iOS Simulator are not affected.

There is no crash when evaluating the RegExp only once.

  1. Execute flutter run on the code sample , running on an iOS device

Expected results: see the print outputs

Actual results: see the print outputs and then a crash

Code
void main() async {
  final RegExp _dateTimeFULLExp = RegExp(
      r'([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?');

  String a = "2023-01-07T16:51:24.868498+01:00";

  print(_dateTimeFULLExp.hasMatch(a));
  print(_dateTimeFULLExp.hasMatch(a));
  print("finish");
}
Logs

[  +45 ms] (lldb)     run
[ +161 ms] success
[        ] Application launched on the device. Waiting for observatory url.
[+1026 ms] (lldb) 2023-02-22 21:53:57.452838+0100 Runner[55729:20443344] Warning: Unable to create restoration in progress marker file
[  +48 ms] flutter: true
[        ] flutter: true
[        ] flutter: finish
[  +25 ms] Observatory URL on device: http://127.0.0.1:59497/pBbCvAtV3Yk=/
[   +5 ms] Attempting to forward device port 59497 to host port 62527
[        ] executing: /Users/vsaase/flutter/bin/cache/artifacts/usbmuxd/iproxy 62527:59497 --udid 00008020-000C098E14F2002E --debug
[ +423 ms] Process 55729 stopped
[   +1 ms] * thread #26, name = 'DartWorker', stop reason = EXC_BAD_ACCESS (code=2, address=0x105293ff4)
[        ]     frame #0: 0x00000001052e3ae8 Flutter`dart::InlineSetIndexed(dart::FlowGraph*, dart::MethodRecognizer::Kind, dart::Function const&, dart::Instruction*, dart::Definition*, dart::InstructionSource const&, dart::Cids const*, dart::FlowGraphInliner::ExactnessInfo*, dart::GraphEntryInstr*, dart::FunctionEntryInstr**, dart::Instruction**, dart::Definition**) + 2824
[        ] Flutter`dart::InlineSetIndexed:
[        ] ->  0x1052e3ae8 <+2824>: str    x0, [x9, #0x58]
[        ]     0x1052e3aec <+2828>: stp    xzr, x8, [x0, #0x8]
[        ]     0x1052e3af0 <+2832>: cbz    x8, 0x1052e3ac0           ; <+2784>
[        ]     0x1052e3af4 <+2836>: str    x0, [x8, #0x8]
[        ] Target 0: (Runner) stopped.
[        ] thread backtrace all
[        ] process detach
[ +118 ms]   thread #1, queue = 'com.apple.main-thread'
[        ]     frame #0: 0x00000002154a1b48 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000002154b4008 libsystem_kernel.dylib`mach_msg2_internal + 80
[        ]     frame #2: 0x00000002154b4248 libsystem_kernel.dylib`mach_msg_overwrite + 388
[        ]     frame #3: 0x00000002154a208c libsystem_kernel.dylib`mach_msg + 24
[        ]     frame #4: 0x00000001d891aaf0 CoreFoundation`__CFRunLoopServiceMachPort + 160
[        ]     frame #5: 0x00000001d891bd34 CoreFoundation`__CFRunLoopRun + 1232
[        ]     frame #6: 0x00000001d8920ed4 CoreFoundation`CFRunLoopRunSpecific + 612
[        ]     frame #7: 0x0000000211c22368 GraphicsServices`GSEventRunModal + 164
[        ]     frame #8: 0x00000001dadff3d0 UIKitCore`-[UIApplication _run] + 888
[        ]     frame #9: 0x00000001dadff034 UIKitCore`UIApplicationMain + 340
[        ]     frame #10: 0x0000000102211d00 Runner`main at AppDelegate.swift:5:13
[        ]     frame #11: 0x00000001f6f8c960 dyld`start + 2528
[        ]   thread #2
[        ]     frame #0: 0x00000002154a2050 libsystem_kernel.dylib`__workq_kernreturn + 8
[        ]   thread #3
[        ]     frame #0: 0x00000002154a2050 libsystem_kernel.dylib`__workq_kernreturn + 8
[        ]   thread #4
[        ]     frame #0: 0x00000002154a2050 libsystem_kernel.dylib`__workq_kernreturn + 8
[        ]   thread #5, name = 'com.apple.uikit.eventfetch-thread'
[        ]     frame #0: 0x00000002154a1b48 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000002154b4008 libsystem_kernel.dylib`mach_msg2_internal + 80
[        ]     frame #2: 0x00000002154b4248 libsystem_kernel.dylib`mach_msg_overwrite + 388
[        ]     frame #3: 0x00000002154a208c libsystem_kernel.dylib`mach_msg + 24
[        ]     frame #4: 0x00000001d891aaf0 CoreFoundation`__CFRunLoopServiceMachPort + 160
[        ]     frame #5: 0x00000001d891bd34 CoreFoundation`__CFRunLoopRun + 1232
[        ]     frame #6: 0x00000001d8920ed4 CoreFoundation`CFRunLoopRunSpecific + 612
[        ]     frame #7: 0x00000001d2cce334 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
[        ]     frame #8: 0x00000001d2cce21c Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 64
[        ]     frame #9: 0x00000001daf3433c UIKitCore`-[UIEventFetcher threadMain] + 436
[        ]     frame #10: 0x00000001d2ce7808 Foundation`__NSThread__start__ + 716
[        ]     frame #11: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #6
[        ]     frame #0: 0x00000002154a2050 libsystem_kernel.dylib`__workq_kernreturn + 8
[        ]   thread #7
[        ]     frame #0: 0x00000002154a2050 libsystem_kernel.dylib`__workq_kernreturn + 8
[        ]   thread #8
[        ]     frame #0: 0x00000002154a2050 libsystem_kernel.dylib`__workq_kernreturn + 8
[        ]   thread #9
[        ]     frame #0: 0x0000000000000000
[        ]   thread #10, name = 'io.flutter.1.ui'
[        ]     frame #0: 0x00000002154a1b48 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000002154b4008 libsystem_kernel.dylib`mach_msg2_internal + 80
[        ]     frame #2: 0x00000002154b4248 libsystem_kernel.dylib`mach_msg_overwrite + 388
[        ]     frame #3: 0x00000002154a208c libsystem_kernel.dylib`mach_msg + 24
[        ]     frame #4: 0x00000001d891aaf0 CoreFoundation`__CFRunLoopServiceMachPort + 160
[        ]     frame #5: 0x00000001d891bd34 CoreFoundation`__CFRunLoopRun + 1232
[        ]     frame #6: 0x00000001d8920ed4 CoreFoundation`CFRunLoopRunSpecific + 612
[        ]     frame #7: 0x0000000104d50b5c Flutter`fml::MessageLoopDarwin::Run() + 88
[        ]     frame #8: 0x0000000104d4fc50 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::__thread_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: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #11, name = 'io.flutter.1.raster'
[        ]     frame #0: 0x00000002154a1b48 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000002154b4008 libsystem_kernel.dylib`mach_msg2_internal + 80
[        ]     frame #2: 0x00000002154b4248 libsystem_kernel.dylib`mach_msg_overwrite + 388
[        ]     frame #3: 0x00000002154a208c libsystem_kernel.dylib`mach_msg + 24
[        ]     frame #4: 0x00000001d891aaf0 CoreFoundation`__CFRunLoopServiceMachPort + 160
[        ]     frame #5: 0x00000001d891bd34 CoreFoundation`__CFRunLoopRun + 1232
[        ]     frame #6: 0x00000001d8920ed4 CoreFoundation`CFRunLoopRunSpecific + 612
[        ]     frame #7: 0x0000000104d50b5c Flutter`fml::MessageLoopDarwin::Run() + 88
[        ]     frame #8: 0x0000000104d4fc50 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::__thread_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: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[   +1 ms]   thread #12, name = 'io.flutter.1.io'
[        ]     frame #0: 0x00000002154a1b48 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000002154b4008 libsystem_kernel.dylib`mach_msg2_internal + 80
[        ]     frame #2: 0x00000002154b4248 libsystem_kernel.dylib`mach_msg_overwrite + 388
[        ]     frame #3: 0x00000002154a208c libsystem_kernel.dylib`mach_msg + 24
[        ]     frame #4: 0x00000001d891aaf0 CoreFoundation`__CFRunLoopServiceMachPort + 160
[        ]     frame #5: 0x00000001d891bd34 CoreFoundation`__CFRunLoopRun + 1232
[        ]     frame #6: 0x00000001d8920ed4 CoreFoundation`CFRunLoopRunSpecific + 612
[        ]     frame #7: 0x0000000104d50b5c Flutter`fml::MessageLoopDarwin::Run() + 88
[        ]     frame #8: 0x0000000104d4fc50 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::__thread_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: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #13, name = 'io.flutter.1.profiler'
[        ]     frame #0: 0x00000002154a1b48 libsystem_kernel.dylib`mach_msg2_trap + 8
[        ]     frame #1: 0x00000002154b4008 libsystem_kernel.dylib`mach_msg2_internal + 80
[        ]     frame #2: 0x00000002154b4248 libsystem_kernel.dylib`mach_msg_overwrite + 388
[        ]     frame #3: 0x00000002154a208c libsystem_kernel.dylib`mach_msg + 24
[        ]     frame #4: 0x00000001d891aaf0 CoreFoundation`__CFRunLoopServiceMachPort + 160
[        ]     frame #5: 0x00000001d891bd34 CoreFoundation`__CFRunLoopRun + 1232
[        ]     frame #6: 0x00000001d8920ed4 CoreFoundation`CFRunLoopRunSpecific + 612
[        ]     frame #7: 0x0000000104d50b5c Flutter`fml::MessageLoopDarwin::Run() + 88
[        ]     frame #8: 0x0000000104d4fc50 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::__thread_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: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #14, name = 'io.worker.1'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b06c libsystem_pthread.dylib`_pthread_cond_wait + 1232
[        ]     frame #2: 0x0000000104abe2a4 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x0000000104d4a358 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::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #15, name = 'io.worker.2'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b06c libsystem_pthread.dylib`_pthread_cond_wait + 1232
[        ]     frame #2: 0x0000000104abe2a4 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x0000000104d4a358 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::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #16, name = 'io.worker.3'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b06c libsystem_pthread.dylib`_pthread_cond_wait + 1232
[        ]     frame #2: 0x0000000104abe2a4 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x0000000104d4a358 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::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #17, name = 'io.worker.4'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b06c libsystem_pthread.dylib`_pthread_cond_wait + 1232
[        ]     frame #2: 0x0000000104abe2a4 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x0000000104d4a358 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::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #18, name = 'io.worker.5'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b06c libsystem_pthread.dylib`_pthread_cond_wait + 1232
[        ]     frame #2: 0x0000000104abe2a4 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x0000000104d4a358 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::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #19, name = 'io.worker.6'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b06c libsystem_pthread.dylib`_pthread_cond_wait + 1232
[        ]     frame #2: 0x0000000104abe2a4 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
[        ]     frame #3: 0x0000000104d4a358 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::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0> >(void*) + 352
[        ]     frame #4: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #20, name = 'dart:io EventHandler'
[        ]     frame #0: 0x00000002154a3480 libsystem_kernel.dylib`kevent + 8
[        ]     frame #1: 0x0000000104f3d070 Flutter`dart::bin::EventHandlerImplementation::EventHandlerEntry(unsigned long) + 428
[        ]     frame #2: 0x0000000104f6d8a8 Flutter`dart::bin::ThreadStart(void*) + 44
[        ]     frame #3: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #21, name = 'Dart Profiler ThreadInterrupter'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b098 libsystem_pthread.dylib`_pthread_cond_wait + 1276
[        ]     frame #2: 0x000000010515eb38 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x00000001051feafc Flutter`dart::ThreadInterrupter::ThreadMain(unsigned long) + 432
[        ]     frame #4: 0x000000010515e4f4 Flutter`dart::ThreadStart(void*) + 288
[        ]     frame #5: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #22, name = 'Dart Profiler SampleBlockProcessor'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b098 libsystem_pthread.dylib`_pthread_cond_wait + 1276
[        ]     frame #2: 0x0000000105161808 Flutter`dart::SampleBlockProcessor::ThreadMain(unsigned long) + 256
[        ]     frame #3: 0x000000010515e4f4 Flutter`dart::ThreadStart(void*) + 288
[        ]     frame #4: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #23, name = 'DartWorker'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b098 libsystem_pthread.dylib`_pthread_cond_wait + 1276
[        ]     frame #2: 0x000000010515eb38 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x00000001051ffc18 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
[        ]     frame #4: 0x000000010515e4f4 Flutter`dart::ThreadStart(void*) + 288
[        ]     frame #5: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #24, name = 'DartWorker'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b098 libsystem_pthread.dylib`_pthread_cond_wait + 1276
[        ]     frame #2: 0x000000010515eb38 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x00000001051ffc18 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
[        ]     frame #4: 0x000000010515e4f4 Flutter`dart::ThreadStart(void*) + 288
[        ]     frame #5: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #25, name = 'DartWorker'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b098 libsystem_pthread.dylib`_pthread_cond_wait + 1276
[        ]     frame #2: 0x000000010515eb38 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x00000001051ffc18 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
[        ]     frame #4: 0x000000010515e4f4 Flutter`dart::ThreadStart(void*) + 288
[        ]     frame #5: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ] * thread #26, name = 'DartWorker', stop reason = EXC_BAD_ACCESS (code=2, address=0x105293ff4)
[        ]   * frame #0: 0x00000001052e3ae8 Flutter`dart::InlineSetIndexed(dart::FlowGraph*, dart::MethodRecognizer::Kind, dart::Function const&, dart::Instruction*, dart::Definition*, dart::InstructionSource const&, dart::Cids const*, dart::FlowGraphInliner::ExactnessInfo*, dart::GraphEntryInstr*, dart::FunctionEntryInstr**, dart::Instruction**, dart::Definition**) + 2824
[        ]     frame #1: 0x00000001052e18f0 Flutter`dart::FlowGraphInliner::TryInlineRecognizedMethod(dart::FlowGraph*, long, dart::Function const&, dart::Definition*, dart::Definition*, dart::InstructionSource const&, dart::ICData const*, dart::GraphEntryInstr*, dart::FunctionEntryInstr**, dart::Instruction**, dart::Definition**, dart::SpeculativeInliningPolicy*, dart::FlowGraphInliner::ExactnessInfo*) + 2212
[        ]     frame #2: 0x00000001052ef55c Flutter`dart::FlowGraphInliner::TryReplaceInstanceCallWithInline(dart::FlowGraph*, dart::ForwardInstructionIterator*, dart::InstanceCallInstr*, dart::SpeculativeInliningPolicy*) + 300
[        ]     frame #3: 0x00000001053d5da8 Flutter`dart::JitCallSpecializer::VisitInstanceCall(dart::InstanceCallInstr*) + 19868
[        ]     frame #4: 0x0000000105278458 Flutter`dart::FlowGraphVisitor::VisitBlocks() + 136
[        ]     frame #5: 0x0000000105348cfc Flutter`dart::CompilerPass_ApplyICData::DoBody(dart::CompilerPassState*) const + 24
[        ]     frame #6: 0x00000001053492c4 Flutter`dart::CompilerPass::Run(dart::CompilerPassState*) const + 584
[        ]     frame #7: 0x0000000105212174 Flutter`dart::CompileParsedFunctionHelper::Compile(dart::CompilationPipeline*) + 3624
[        ]     frame #8: 0x000000010521416c Flutter`dart::CompileFunctionHelper(dart::CompilationPipeline*, dart::Function const&, bool, long) + 1360
[        ]     frame #9: 0x0000000105214c00 Flutter`dart::Compiler::CompileOptimizedFunction(dart::Thread*, dart::Function const&, long) + 720
[        ]     frame #10: 0x0000000105215d10 Flutter`dart::BackgroundCompilerTask::Run() + 340
[        ]     frame #11: 0x00000001051ffb08 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 396
[        ]     frame #12: 0x000000010515e4f4 Flutter`dart::ThreadStart(void*) + 288
[        ]     frame #13: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #27, name = 'DartWorker'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b098 libsystem_pthread.dylib`_pthread_cond_wait + 1276
[        ]     frame #2: 0x000000010515eb38 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x00000001051ffc18 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
[        ]     frame #4: 0x000000010515e4f4 Flutter`dart::ThreadStart(void*) + 288
[        ]     frame #5: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[        ]   thread #28, name = 'DartWorker'
[        ]     frame #0: 0x00000002154a241c libsystem_kernel.dylib`__psynch_cvwait + 8
[        ]     frame #1: 0x000000022590b098 libsystem_pthread.dylib`_pthread_cond_wait + 1276
[        ]     frame #2: 0x000000010515eb38 Flutter`dart::Monitor::WaitMicros(long long) + 128
[        ]     frame #3: 0x000000010507ebf8 Flutter`dart::MutatorThreadPool::OnEnterIdleLocked(dart::MonitorLocker*) + 380
[        ]     frame #4: 0x00000001051ffc4c Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 720
[        ]     frame #5: 0x000000010515e4f4 Flutter`dart::ThreadStart(void*) + 288
[        ]     frame #6: 0x00000002259046cc libsystem_pthread.dylib`_pthread_start + 148
[  +13 ms] (lldb) 
[   +1 ms] ios-deploy exited with code 0
[ +431 ms] Forwarded port ForwardedPort HOST:62527 to DEVICE:59497
[        ] Forwarded host port 62527 to device port 59497 for Observatory
[   +2 ms] Installing and launching... (completed in 16.3s)
[   +1 ms] Caching compiled dill
[   +8 ms] Connecting to service protocol: http://127.0.0.1:62527/pBbCvAtV3Yk=/
[  +13 ms] Fail to connect to service protocol: http://127.0.0.1:62527/pBbCvAtV3Yk=/: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:62527/pBbCvAtV3Yk=/ws
[   +3 ms] "flutter run" took 43,365ms.
[ +132 ms] ensureAnalyticsSent: 131ms
[        ] Running 1 shutdown hook
[   +2 ms] Shutdown hooks complete
[        ] exiting with code 2

Analyzing bug...                                                

   info • The local variable '_dateTimeFULLExp' starts with an underscore • lib/main.dart:2:16 • no_leading_underscores_for_local_identifiers
   info • Don't invoke 'print' in production code • lib/main.dart:7:3 • avoid_print
   info • Don't invoke 'print' in production code • lib/main.dart:8:3 • avoid_print
   info • Don't invoke 'print' in production code • lib/main.dart:9:3 • avoid_print


[✓] Flutter (Channel stable, 3.7.4, on macOS 13.2.1 22D68 darwin-x64, locale en-DE)
    • Flutter version 3.7.4 on channel stable at /Users/vsaase/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b4bce91dd0 (2 days ago), 2023-02-21 09:50:50 +0800
    • Engine revision 248290d6d5
    • Dart version 2.19.2
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/vsaase/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • 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.75.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (3 available)
    • iPhone vs (mobile) • 00008020-000C098E14F2002E • ios            • iOS 16.1.2 20B110
    • macOS (desktop)    • macos                     • darwin-x64     • macOS 13.2.1 22D68 darwin-x64
    • Chrome (web)       • chrome                    • web-javascript • Google Chrome 110.0.5481.100

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Feb 23, 2023
@danagbemava-nc danagbemava-nc changed the title Crash after evaluating RegExp twice on iOS Crash after evaluating RegExp twice on iOS & Android Feb 23, 2023
@danagbemava-nc
Copy link
Member

I can reproduce the issue using the code sample provided above. In my testing, this reproduced on android & iOS but not on macOS or chrome. I can also confirm that this breaks when you upgrade to flutter 3.7.1 and that the issue does not reproduce on 3.7.0. See the logs below.

Labeling for further investigation.

logs

iOS Logs

Flutter 3.7.0 & below

Launching lib/main.dart on Nexus in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: X8NNQ9CYL2
Xcode build done.                                           14.5s
(lldb) 2023-02-23 08:16:46.855237+0000 Runner[4807:983540] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
[SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
Connecting to VM Service at ws://127.0.0.1:53341/a8ViaHIYIck=/ws
flutter: true
flutter: true
flutter: finish
Application finished.
Exited

Flutter 3.7.1 & above

Launching lib/main.dart on Nexus in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: X8NNQ9CYL2
Xcode build done.                                           11.8s
(lldb) 2023-02-23 07:56:41.783255+0000 Runner[4774:975060] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
[SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
Connecting to VM Service at ws://127.0.0.1:60864/nKdVlJVT5lQ=/ws
flutter: true
flutter: true
flutter: finish
* thread #23, name = 'DartWorker', stop reason = EXC_BAD_ACCESS (code=2, address=0x10618b5bc)
    frame #0: 0x00000001061dd32c Flutter`dart::InlineSetIndexed(dart::FlowGraph*, dart::MethodRecognizer::Kind, dart::Function const&, dart::Instruction*, dart::Definition*, dart::InstructionSource const&, dart::Cids const*, dart::FlowGraphInliner::ExactnessInfo*, dart::GraphEntryInstr*, dart::FunctionEntryInstr**, dart::Instruction**, dart::Definition**) + 2772
Flutter`dart::InlineSetIndexed:
->  0x1061dd32c <+2772>: str    x0, [x9, #0x58]
    0x1061dd330 <+2776>: stp    xzr, x8, [x0, #0x8]
    0x1061dd334 <+2780>: cbz    x8, 0x1061dd304           ; <+2732>
    0x1061dd338 <+2784>: str    x0, [x8, #0x8]
Target 0: (Runner) stopped.
Lost connection to device.
Exited

Android logs

Flutter 3.7.0 & below

Launching lib/main.dart on M2007J20CG in debug mode...
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:55129/LIGdioXd8tk=/ws
I/flutter (24810): true
I/flutter (24810): true
I/flutter (24810): finish
Application finished.
Exited

Flutter 3.7.1 & above

Launching lib/main.dart on M2007J20CG in debug mode...
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:61390/dUrtDWdisEQ=/ws
I/flutter (22872): true
I/flutter (22872): true
I/flutter (22872): finish
F/libc    (22872): Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x76902d7e94 in tid 22986 (DartWorker), pid 22872 (com.example.sam)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'POCO/surya_eea/surya:12/SKQ1.211019.001/V13.0.4.0.SJGEUXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2023-02-23 07:57:54.154132100+0000
Process uptime: 0s
Cmdline: com.example.sam
pid: 22872, tid: 22986, name: DartWorker  >>> com.example.sam <<<
uid: 10284
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x76902d7e94
    x0  000000766f38a840  x1  0000000000000000  x2  0000000000000020  x3  00000076704e65a8
    x4  0000000000000001  x5  000000767ce7a400  x6  0000000000000000  x7  000000767ce7a428
    x8  540000617100153f  x9  00000076902d7e3c  x10 000000766f38ab38  x11 0000007670389d10
    x12 0000000000000013  x13 0000000000000013  x14 000000768fa68399  x15 000000767ce7a410
    x16 00000076905090a0  x17 00000077b75a4934  x18 000000767bffa000  x19 000000766f38a790
    x20 0000000000000002  x21 00000076704e65a8  x22 0000007670394848  x23 0000000000000086
    x24 0000000000000003  x25 000000766f38a790  x26 000000766f38a840  x27 000000766f38a8d0
    x28 000000766f38a870  x29 000000766f38a8a0
    lr  00000076902c4494  sp  000000767ce7a1d0  pc  00000076902c449c  pst 0000000020000000
backtrace:
      #00 pc 0000000001c5e49c  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #01 pc 0000000001c463f4  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #02 pc 0000000001caab38  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #03 pc 0000000001ca6450  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #04 pc 0000000001ca9c5c  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #05 pc 0000000001d3b010  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #06 pc 0000000001c5e5f0  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #07 pc 0000000001cea100  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #08 pc 0000000001ce9ac0  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #09 pc 0000000001ce9e88  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #10 pc 0000000001c05c90  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #11 pc 0000000001c0658c  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #12 pc 0000000001c06c40  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #13 pc 0000000001c07190  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #14 pc 0000000001bf6970  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #15 pc 0000000001bf6bd4  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #16 pc 0000000001b891b0  /data/app/~~uI1hka7b2c4My4tIrhM6Vw==/com.example.sam-65TLIPm3YKroxF7LuqLFbA==/lib/arm64/libflutter.so (BuildId: 124b9d8aafc28da828cf4c494bf8ae82b13f3e6e)
      #17 pc 00000000000f0df4  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 2f84be24a19d511a358a9050af5b3974)
      #18 pc 000000000008d63c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: 2f84be24a19d511a358a9050af5b3974)
Lost connection to device.
Exited
flutter doctor -v
[!] Flutter (Channel unknown, 3.7.0, on macOS 13.1 22C65 darwin-arm64, locale en-GB)
    ! Flutter version 3.7.0 on channel unknown at /Users/nexus/dev/sdks/flutter_rc/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter_rc/flutter.
      Consider adding /Users/nexus/dev/sdks/flutter_rc/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter_rc/flutter.
      Consider adding /Users/nexus/dev/sdks/flutter_rc/flutter/bin to the front of your path.
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    • Framework revision b06b8b2710 (4 weeks ago), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.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 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • 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.3

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

[!] Android Studio (version 2022.1)
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[!] Android Studio (version 2022.1)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (4 available)
    • M2007J20CG (mobile) • adb-5dd3be00-17AYzd._adb-tls-connect._tcp. • android-arm64  • Android 12 (API 31)
    • Nexus (mobile)      • 00008020-001875E83A38002E                  • ios            • iOS 16.3.1 20D67
    • macOS (desktop)     • macos                                      • darwin-arm64   • macOS 13.1 22C65 darwin-arm64
    • Chrome (web)        • chrome                                     • web-javascript • Google Chrome 110.0.5481.100

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.
[!] Flutter (Channel unknown, 3.7.1, on macOS 13.1 22C65 darwin-arm64, locale en-GB)
    ! Flutter version 3.7.1 on channel unknown at /Users/nexus/dev/sdks/flutter_rc/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter_rc/flutter. Consider adding /Users/nexus/dev/sdks/flutter_rc/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter_rc/flutter. Consider adding /Users/nexus/dev/sdks/flutter_rc/flutter/bin to the front of your path.
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    • Framework revision 7048ed95a5 (3 weeks ago), 2023-02-01 09:07:31 -0800
    • Engine revision 800594f1f4
    • Dart version 2.19.1
    • DevTools version 2.20.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 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • 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.3

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

[!] Android Studio (version 2022.1)
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[!] Android Studio (version 2022.1)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (4 available)
    • M2007J20CG (mobile) • adb-5dd3be00-17AYzd._adb-tls-connect._tcp. • android-arm64  • Android 12 (API 31)
    • Nexus (mobile)      • 00008020-001875E83A38002E                  • ios            • iOS 16.3.1 20D67
    • macOS (desktop)     • macos                                      • darwin-arm64   • macOS 13.1 22C65 darwin-arm64
    • Chrome (web)        • chrome                                     • web-javascript • Google Chrome 110.0.5481.100

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.
[✓] Flutter (Channel stable, 3.7.5, on macOS 13.1 22C65 darwin-arm64, locale en-GB)
    • Flutter version 3.7.5 on channel stable at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c07f788888 (9 hours ago), 2023-02-22 17:52:33 -0600
    • Engine revision 0f359063c4
    • Dart version 2.19.2
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • 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.3

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

[!] Android Studio (version 2022.1)
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[!] Android Studio (version 2022.1)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (4 available)
    • M2007J20CG (mobile) • adb-5dd3be00-17AYzd._adb-tls-connect._tcp. • android-arm64  • Android 12 (API 31)
    • Nexus (mobile)      • 00008020-001875E83A38002E                  • ios            • iOS 16.3.1 20D67
    • macOS (desktop)     • macos                                      • darwin-arm64   • macOS 13.1 22C65 darwin-arm64
    • Chrome (web)        • chrome                                     • web-javascript • Google Chrome 110.0.5481.100

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
[!] Flutter (Channel master, 3.8.0-15.0.pre.19, on macOS 13.1 22C65 darwin-arm64, locale en-GB)
    • Flutter version 3.8.0-15.0.pre.19 on channel master at /Users/nexus/dev/sdks/flutters
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3115993117 (3 hours ago), 2023-02-23 00:25:39 -0500
    • Engine revision 26971ae36c
    • Dart version 3.0.0 (build 3.0.0-266.0.dev)
    • DevTools version 2.22.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 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • 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.3

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

[✓] Android Studio (version 2022.1)
    • 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.15+0-b2043.56-8887301)

[✓] Android Studio (version 2022.1)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/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.15+0-b2043.56-8887301)

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (4 available)
    • M2007J20CG (mobile) • adb-5dd3be00-17AYzd._adb-tls-connect._tcp. • android-arm64  • Android 12 (API 31)
    • Nexus (mobile)      • 00008020-001875E83A38002E                  • ios            • iOS 16.3.1 20D67
    • macOS (desktop)     • macos                                      • darwin-arm64   • macOS 13.1 22C65 darwin-arm64
    • Chrome (web)        • chrome                                     • web-javascript • Google Chrome 110.0.5481.100

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@danagbemava-nc danagbemava-nc added c: crash Stack traces logged to the console engine flutter/engine repository. See also e: labels. dependency: dart Dart team may need to help us 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.7 Found to occur in 3.7 found in release: 3.8 Found to occur in 3.8 platform-android Android applications specifically platform-ios iOS applications specifically and removed in triage Presently being triaged by the triage team labels Feb 23, 2023
@danagbemava-nc danagbemava-nc added the c: regression It was better in the past than it is now label Feb 23, 2023
@mraleph
Copy link
Member

mraleph commented Feb 23, 2023

@aam would you be able to take a look at this?

@aam aam self-assigned this Feb 23, 2023
@chinmaygarde chinmaygarde added the P2 Important issues not at the top of the work list label Feb 27, 2023
@zanderso
Copy link
Member

Increasing the priority to investigate how this regressed on a hotfix release. @itsjustkevin Were there any Dart CPs in 3.7.1?

@zanderso zanderso added P2 and removed P2 Important issues not at the top of the work list labels Feb 27, 2023
@mraleph
Copy link
Member

mraleph commented Feb 27, 2023

Most likely caused by dart-lang/sdk#51130

@aam
Copy link
Member

aam commented Feb 28, 2023

dart-lang/sdk#51130 exposed a problem in RegExp evaluation where repeated optimizing compilation of generated RegExp__matcher function produces different instructions, different deoptids compared to unoptimized compilation.
Repeated(second) optimizing compilation happens for arm mobile devices because arm-targeting generation for this given sample can't use near branches chosen for the first run, has to use fallback to second compilation using far branches.

Actual issue with divergence of the paths is tied to canonicalization of CharacterRanges, which happens during first run, but after dependent instructions were generated for the first run. The canonicalization causes "quick check" to get enabled for the second run, while it was disabled for the first run(https://github.com/dart-lang/sdk/blob/main/runtime/vm/regexp.cc#L1831). Hopefully will get more clarity on this soon.

@alexmarkov
Copy link
Contributor

We should make sure the flow graph building is stable even if we can do some optimizations and cut some fragments out of a flow graph. In order to achieve that we usually build fragments of flow graph anyway, even if they are not needed, and then skip linking those fragments into the graph (so they are hanging independently and unused). This way we allocate the same deopt ids regardless of the decision to include or exclude these fragments. This is more easily doable if flow graph building uses Fragment from base_flow_graph_builder.h to append IL instructions.

@aam
Copy link
Member

aam commented Feb 28, 2023

https://dart-review.googlesource.com/c/sdk/+/286021 with proposed fix.

@alexmarkov the issue here is not really difference between unoptimized vs optimized pipelines, rather that the repeated RegEx compilation sees different RegExp AST. Canonicalization of CharacterRanges happens in the middle of the first compilation run, but after some instructions that depended on not-yet-canonicalized ranges were generated(QuickCheck). Second run starts with the ranges all canonicalized, so decision to generate QuickCheck is taken differently.

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Feb 28, 2023
… decision is made.

First, canonicalized CharacterRanges allow for QuickCheck code to be generated, rather than skipped. Second, CharacterRanges could become canonicalized later leading to incompatible instructions generated on a second compilation run, leading to a crash.

Fixes flutter/flutter#121270
TEST=flutter_regress_121270_test

Change-Id: I075986b86b810ede96471bbe5fbe0b337714d215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286021
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
@itsjustkevin
Copy link
Contributor

@aam (the correct one for once) I see https://dart-review.googlesource.com/c/sdk/+/286021 is merged. If this works, could you open a cherry-pick to Dart stable?

@aam
Copy link
Member

aam commented Feb 28, 2023

@itsjustkevin sure, will do

@aam
Copy link
Member

aam commented Mar 2, 2023

@vsaase thanks again for reporting the problem, @danagbemava-nc - thanks for reproducing it. The fix landed on flutter main branch(e340d86), if you can verify it works for you, that would help.
We are planning on releasing hotfix for stable version this as well.

@danagbemava-nc
Copy link
Member

Hi @aam, the crash no longer reproduces on my android and iOS devices on the main branch(master).

Hi @vsaase, can you confirm if this is the case for you as well?

master flutter doctor -v
[!] Flutter (Channel master, 3.9.0-1.0.pre.30, on macOS 13.2.1 22D68 darwin-arm64, locale en-GB)
    • Flutter version 3.9.0-1.0.pre.30 on channel master at /Users/nexus/dev/sdks/flutters
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 902dac4763 (4 hours ago), 2023-03-02 18:40:14 -0800
    • Engine revision 2be41c6d01
    • Dart version 3.0.0 (build 3.0.0-288.0.dev)
    • DevTools version 2.22.2
    • 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 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • 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.3

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

[✓] Android Studio (version 2022.1)
    • 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.15+0-b2043.56-8887301)

[✓] Android Studio (version 2022.1)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/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.15+0-b2043.56-8887301)

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (4 available)
    • M2007J20CG (mobile) • adb-5dd3be00-17AYzd._adb-tls-connect._tcp. • android-arm64  • Android 12 (API 31)
    • Nexus (mobile)      • 00008020-001875E83A38002E                  • ios            • iOS 16.3.1 20D67
    • macOS (desktop)     • macos                                      • darwin-arm64   • macOS 13.2.1 22D68 darwin-arm64
    • Chrome (web)        • chrome                                     • web-javascript • Google Chrome 110.0.5481.177

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 3, 2023
@vsaase
Copy link
Author

vsaase commented Mar 5, 2023

@aam thank you for the fix!
@danagbemava-nc I can confirm that the bug does not reproduce anymore for my code base

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 5, 2023
@danagbemava-nc
Copy link
Member

Thanks for the confirmation.

Closing this as fixed per our triage policy

@danagbemava-nc danagbemava-nc added the r: fixed Issue is closed as already fixed in a newer version label Mar 6, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Mar 6, 2023
…uickCheck decision is made.

First, canonicalized CharacterRanges allow for QuickCheck code to be generated, rather than skipped. Second, CharacterRanges could become canonicalized later leading to incompatible instructions generated on a second compilation run, leading to a crash.

Bug=flutter/flutter#121270
TEST=flutter_regress_121270_test

Fixes #51606

Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/286021
Change-Id: Ibf8e94da3703b8935d9bb55140f77170f3a8f411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286520
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
@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 Mar 20, 2023
@flutter-triage-bot flutter-triage-bot bot added P0 Critical issues such as a build break or regression and removed P2 labels Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console c: fatal crash Crashes that terminate the process c: regression It was better in the past than it is now dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels. found in release: 3.7 Found to occur in 3.7 found in release: 3.8 Found to occur in 3.8 has reproducible steps The issue has been confirmed reproducible and is ready to work on P0 Critical issues such as a build break or regression platform-android Android applications specifically platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

No branches or pull requests

8 participants