Giter VIP home page Giter VIP logo

Comments (10)

darshankawar avatar darshankawar commented on June 24, 2024

In the new version of our application, we integrated Flutter.

@Ryan0520 Does this mean an add2app setup ?
Is there a way for you to look at the pattern of the crash and provide us more details ? like, app goes in background then comes back ?
The Flutter frames from the log looks similar to #148279

from flutter.

Ryan0520 avatar Ryan0520 commented on June 24, 2024

In the new version of our application, we integrated Flutter.

@Ryan0520 Does this mean an add2app setup ? Is there a way for you to look at the pattern of the crash and provide us more details ? like, app goes in background then comes back ? The Flutter frames from the log looks similar to #148279

Yes, our app is integrated using Add2App. This might not be a Flutter engine issue since users don't experience crashes during normal usage. However, some devices running iOS versions below 12.4 crash consistently due to bug #142396. Disabling Impeller by adding the following tags under the top-level tag in the app's Info.plist file resolved the issue.

<key>FLTEnableImpeller</key> <false />

I'd like to know if there are any other methods besides disabling Impeller to prevent crashes on iOS 12.4 devices.

from flutter.

darshankawar avatar darshankawar commented on June 24, 2024

Thanks for the update. So if I understand above correctly, the crash is only observed on iOS 12.4 devices ? If so, could it be due to low memory on older devices ? Minimum iOS support Flutter provides is 12.

from flutter.

Ryan0520 avatar Ryan0520 commented on June 24, 2024

Thanks for the update. So if I understand above correctly, the crash is only observed on iOS 12.4 devices ? If so, could it be due to low memory on older devices ? Minimum iOS support Flutter provides is 12.

Thanks for your reply, perhaps the crash is not due to memory issues. When I disabled the Impeller rendering engine, the crashes stopped. This issue occurs not only on iOS 12.4 but also on iOS 12.3.1. Since we need to support older system versions, we have no choice but to abandon using Flutter.

from flutter.

darshankawar avatar darshankawar commented on June 24, 2024

Thanks for the update. Keeping the issue and labeling for team's tracking.

from flutter.

MaxwellLeeee avatar MaxwellLeeee commented on June 24, 2024

Same issue occurs in my app. Devices form iOS 12.0.1 to 15.3.1 report this crash.
According to the main thread stack "[UIApplication terminateWithSuccess]", I guess it due to the user killing the app. Flutter engine will be destroyed when receive UIApplicationWillTerminateNotification.

from flutter.

ankitagarwal007 avatar ankitagarwal007 commented on June 24, 2024

@darshankawar

I am also experiencing the same crashes and it is our top crash. Below is the stack trace. The crash is happening only when app is in background.

Thread 3 name:
Thread 3 Crashed:
0 libsystem_kernel.dylib 0x00000001b85ae964 __pthread_kill + 8 (:-1)
1 libsystem_pthread.dylib 0x00000001f2198378 pthread_kill + 268 (pthread.c:1610)
2 libsystem_c.dylib 0x000000018c49e420 __abort + 128 (abort.c:155)
3 libsystem_c.dylib 0x000000018c446f5c abort + 176 (abort.c:126)
4 Flutter 0x0000000107a039f8 fml::KillProcess() + 12 (logging.cc:175)
5 Flutter 0x0000000107a03bc8 fml::LogMessage::~LogMessage() + 4 (logging.cc:162)
6 Flutter 0x0000000107a03bc8 fml::LogMessage::~LogMessage() + 464 (logging.cc:100)
7 Flutter 0x0000000107a0816c fml::internal::ThreadLocalPointer::swap(void*) + 184 (thread_local.cc:32)
8 Flutter 0x0000000107a05378 fml::ThreadLocalUniquePtr<fml::(anonymous namespace)::TaskSourceGradeHolder>::reset(fml::(anonymous namespace)::TaskSourceGradeHolder*) + 12 (thread_local.h:50)
9 Flutter 0x0000000107a05378 fml::MessageLoopTaskQueues::GetNextTaskToRun(fml::TaskQueueId, fml::TimePoint) + 440 (message_loop_task_queues.cc:139)
10 Flutter 0x0000000107a05378 fml::MessageLoopImpl::FlushTasks(fml::FlushType) + 1704 (message_loop_impl.cc:122)
11 Flutter 0x0000000107a086bc fml::MessageLoopImpl::RunExpiredTasksNow() + 8 (message_loop_impl.cc:139)
12 Flutter 0x0000000107a086bc fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*) + 32 (message_loop_darwin.mm:85)
13 CoreFoundation 0x000000018161e268 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 32 (CFRunLoop.c:1812)
14 CoreFoundation 0x00000001815a2c40 __CFRunLoopDoTimer + 1076 (CFRunLoop.c:2420)
15 CoreFoundation 0x000000018159d43c __CFRunLoopDoTimers + 328 (CFRunLoop.c:2580)
16 CoreFoundation 0x000000018157bc58 __CFRunLoopRun + 1944 (CFRunLoop.c:3116)
17 CoreFoundation 0x000000018158f3b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
18 Flutter 0x0000000107a087a8 fml::MessageLoopDarwin::Run() + 88 (message_loop_darwin.mm:51)
19 Flutter 0x0000000107a07e20 fml::MessageLoopImpl::DoRun() + 28 (message_loop_impl.cc:94)
20 Flutter 0x0000000107a07e20 fml::MessageLoop::Run() + 32 (message_loop.cc:49)
21 Flutter 0x0000000107a07e20 fml::Thread::Thread(std::_fl::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0::operator()() const + 160 (thread.cc:85)
22 Flutter 0x0000000107a07e20 decltype(std::declval<fml::Thread::Thread(std::_fl::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>()()) std::_fl::__invoke[abi:v15000]<fml::Thread... + 160 (invoke.h:403)
23 Flutter 0x0000000107a07e20 _ZNSt3_fl16__thread_executeB6v15000INS_10unique_ptrINS_15__thread_structENS_14default_deleteIS2_EEEEZN3fml6ThreadC1ERKNS_8functionIFvRKNS7_12ThreadConfigEEEESB_E3$_0JETpTnmJEEEvRNS_5tupleIJT_T0_DpT... + 160 (thread:284)
24 Flutter 0x0000000107a07e20 void* std::_fl::__thread_proxy[abi:v15000]<std::_fl::tuple<std::_fl::unique_ptr<std::_fl::__thread_struct, std::_fl::default_deletestd::_fl::__thread_struct>, fml::Thread::Thread(std::_fl::functi... + 208 (thread:295)
25 libsystem_pthread.dylib 0x00000001f21929a4 _pthread_start + 148 (pthread.c:891)
26 libsystem_pthread.dylib 0x00000001f2191ea0 thread_start + 8 (:-1)

from flutter.

shin-ichiro-matsui avatar shin-ichiro-matsui commented on June 24, 2024

We have also seen similar crash reports in our application.
However, it does not seem to be happening in the background of our app.
Our application's Flutter version is 3.19.2, and the crash also occurred on OS version 17.5.1.
We will wait for further updates on whether this crash is fatal to users.

from flutter.

SShayashi avatar SShayashi commented on June 24, 2024

We don't use add-to-app, but we use FlutterEngineGroup and have the same problem.
Based on the above background, we assume that the problem is in the area of creating/destroying Flutter Engine in the middle of the process.

flutter doctor -v
➜  ~ flutter doctor -v
[✓] Flutter (Channel stable, 3.19.2, on macOS 14.4.1 23E224 darwin-arm64, locale
    ja-JP)
    • Flutter version 3.19.2 on channel stable at
      /Users/01036096/fvm/versions/3.19.2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7482962148 (3 months ago), 2024-02-27 16:51:22 -0500
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/01036096/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/01036096/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 15.0.1)
    • Xcode at /Applications/Xcode-15.0.1.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.15.2

[✓] 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.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.88.0

[✓] Connected device (3 available)
    • iPhone 14 (mobile) • 903A1C49-B8E2-4821-A0EC-6A7CB5160D0C • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64
      • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)       • chrome                               • web-javascript
      • Google Chrome 125.0.6422.142

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

• No issues found!
error log
          Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0xc42c __pthread_kill + 8
1  libsystem_pthread.dylib        0x7c0c pthread_kill + 268
2  libsystem_c.dylib              0x75ba0 abort + 180
3  Flutter                        0x2e79f8 fml::LogMessage::~LogMessage() + 100 (logging.cc:100)
4  Flutter                        0x2e7bc8 fml::FileMapping::CreateReadOnly(std::_fl::basic_string<char, std::_fl::char_traits<char>, std::_fl::allocator<char>> const&) + 21 (mapping.cc:21)
5  Flutter                        0x3f4d78 std::_fl::__function::__func<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0, std::_fl::allocator<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0>, void (std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>)>::operator()(std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>&&) + 1031 (atomic:1031)
6  Flutter                        0x3f3f38 flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&) + 259 (unique_ptr.h:259)
7  Flutter                        0x40c3ec std::_fl::__function::__func<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>>)::$_0>, std::_fl::allocator<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>>)::$_0>>, void ()>::operator()() + 1260 (shell.cc:1260)
8  Flutter                        0x2e8f08 fml::MessageLoopImpl::FlushTasks(fml::FlushType) + 128 (message_loop_impl.cc:128)
9  Flutter                        0x2ec6bc fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*) + 86 (message_loop_darwin.mm:86)
10 CoreFoundation                 0xb7a2c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
11 CoreFoundation                 0xb76d0 __CFRunLoopDoTimer + 1004
12 CoreFoundation                 0xb722c __CFRunLoopDoTimers + 288
13 CoreFoundation                 0x53888 __CFRunLoopRun + 1856
14 CoreFoundation                 0x52cd8 CFRunLoopRunSpecific + 608
15 GraphicsServices               0x11a8 GSEventRunModal + 164
16 UIKitCore                      0x40a90c -[UIApplication _run] + 888
17 UIKitCore                      0x4be9d0 UIApplicationMain + 340

from flutter.

jonahwilliams avatar jonahwilliams commented on June 24, 2024

The class in question that is crashing, fml::ThreadLocalPointer, has been deleted and replaced with the standard library thread local in 3.22. That doesn't necessarily mean that the issue that lead to this crash is fixed, but I would recommend updating and seeing if it still reproduces.

That said, we also found https://developer.apple.com/forums/thread/133795 which seems to indicate that in specific circumstances (exiting from a running app in multitasking UI) apple itself will call exit. The exit call is what is screwing us up here.

We may need to hook into https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623111-applicationwillterminate?language=objc . I'm not sure that we're listening to any sort of signal here.

from flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.