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

[camera][iOS] using startImageStream() can lead to memory crash on iOS #97941

Closed
renanyoy opened this issue Feb 7, 2022 · 20 comments
Closed
Labels
c: fatal crash Crashes that terminate the process found in release: 2.10 Found to occur in 2.10 found in release: 2.11 Found to occur in 2.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: camera The camera plugin package flutter/packages repository. See also p: labels. perf: memory Performance issues related to memory platform-ios iOS applications specifically

Comments

@renanyoy
Copy link

renanyoy commented Feb 7, 2022

Steps to Reproduce

  1. Execute flutter run on the code sample
  2. memory problems..
Code sample
    final controller = CameraController(camera, ResolutionPreset.max,
        enableAudio: false, imageFormatGroup: ImageFormatGroup.bgra8888);
    await controller.initialize();
    controller.lockCaptureOrientation(DeviceOrientation.portraitUp);
      controller.startImageStream((image) async {
        if (paused) return;
        //this.image = image;
      });
Logs
[  322 ms] flutter: |L2K|camera initialized
[ 1156 ms] [ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke
[  434 ms] *** Terminating app due to uncaught exception 'NSMallocException', reason: 'Failed to grow buffer'
[        ] *** First throw call stack:
[        ] (0x18091d0fc 0x199169d64 0x180a2ab24 0x180a22e10 0x1808b733c 0x1820e1ad8 0x1820dd764 0x182125870 0x182127fa8 0x18210d69c 0x10f30d234 0x10f30d044 0x10f30d234 0x10f30d788 0x10f30af84 0x10c445528 0x18058d924 0x18058f670 0x18059db70 0x1808d5d84 0x18088ff5c 0x1808a3468 0x19c44338c
0x1832465d0 0x182fc4f74 0x10404085c 0x10b795aa4)
[        ] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** NSAllocateMemoryPages(33177600) failed'
[        ] *** First throw call stack:
[        ] (0x18091d0fc 0x199169d64 0x182127f30 0x1820d3260 0x1820e69e0 0x10c444ab0 0x19f304124 0x19f2ee27c 0x19f534098 0x19f6ea6b8 0x18058f670 0x180592b44 0x1805a5c48 0x180596ccc 0x180597968 0x1805a21b8 0x1f13ab0f4 0x1f13aae94)
[        ] libc  abi: terminating with uncaught exception of type NSException
[        ] libc  abi: terminating with uncaught exception of type NSException
[  305 ms] Process 4459 stopped
[        ] * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
[        ]     frame #0: 0x00000001b7e79964 libsystem_kernel.dylib`__pthread_kill   8
[        ] libsystem_kernel.dylib`__pthread_kill:
[        ] ->  0x1b7e79964 < 8>:  b.lo   0x1b7e79984               ; < 40>
[        ]     0x1b7e79968 < 12>: pacibsp 
[        ]     0x1b7e7996c < 16>: stp    x29, x30, [sp, #-0x10]!
[        ]     0x1b7e79970 < 20>: mov    x29, sp
[        ] Target 0: (Runner) stopped.
[        ] ios-deploy exited with code 0
[  157 ms] Service protocol connection closed.
[        ] Lost connection to device.
[✓] Flutter (Channel stable, 2.10.0, on macOS 12.1 21C52 darwin-x64, locale en-FR)
    • Flutter version 2.10.0 at /Users/renanyoy/code/sdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5f105a6ca7 (5 days ago), 2022-02-01 14:15:42 -0800
    • Engine revision 776efd2034
    • Dart version 2.16.0
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/renanyoy/Library/Android/sdk
    • Platform android-31, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10 0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.0.rc.1

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2020.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.10 0-b96-7281165)

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

[✓] Connected device (2 available)
    • Renaniphone (mobile) • 00008020-000640992209002E • ios        • iOS 15.3 19D50
    • macOS (desktop)      • macos                     • darwin-x64 • macOS 12.1 21C52 darwin-x64

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

@renanyoy renanyoy changed the title [camera] startImageStream() - memory crash [camera] startImageStream() - memory crash on iOS (works on android) Feb 7, 2022
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Feb 7, 2022
@danagbemava-nc
Copy link
Member

Hi @renanyoy, thanks for filing the issue.

Please provide a complete minimal reproducible code sample and the full flutter run -v logs.

Also, what version of camera are you using?

Thank you

@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 Feb 7, 2022
@renanyoy
Copy link
Author

renanyoy commented Feb 7, 2022

the log and the sample are in the first post

we are using the latest camera addon 0.9.4 10.

@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 Feb 7, 2022
@danagbemava-nc
Copy link
Member

Neither of the info you provided in the initial post is complete, which is why I asked for a complete minimal reproducible code sample as well as full logs.

Also, the steps to reproduce aren't quite clear to me.

Does the app crash on startup or does it crash after a certain period of time? Also, what device did you experience the crash with?

also, when seeking after solutions, I found that the problem should be fixed with this pull request
flutter/plugins#4520

If this PR should fix the issue, then this issue should probably be dedup'd with #44436

@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 Feb 7, 2022
@renanyoy
Copy link
Author

renanyoy commented Feb 8, 2022

it crash at startImageStream(..)

made a mistake I don't think this PR will fix it finally..

I'll try to make a sample project

@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 Feb 8, 2022
@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 Feb 8, 2022
@renanyoy
Copy link
Author

renanyoy commented Feb 9, 2022

the full code

import 'dart:developer' as dev;
import 'dart:math';

import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const Home(),
    );
  }
}

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);
  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {
  late CameraController controller;
  bool initialized = false;

  @override
  void initState() {
    super.initState();
    init();
  }

  Future<CameraController> initCamera(CameraDescription camera) async {
    final controller = CameraController(camera, ResolutionPreset.max,
        enableAudio: false, imageFormatGroup: ImageFormatGroup.yuv420);
    await controller.initialize();
    controller.lockCaptureOrientation(DeviceOrientation.portraitUp);
    return controller;
  }

  Future<void> init() async {
    final cameras = await availableCameras();
    controller = await initCamera(cameras.first);
    initialized = true;
    setState(() {});
    controller.startImageStream((image) {
      dev.log('frame');
    });
    (() async {
      // OCR cpu usage simulation
      while (true) {
        await Future.delayed(const Duration(seconds: 2));
        double z = 0;
        for (int i = 0; i < 100000000; i  ) {
          z = cos(z);
        }
      }
    })();
  }

  @override
  Widget build(BuildContext context) {
    return initialized ? CameraPreview(controller) : Container();
  }
}

@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 Feb 9, 2022
@danagbemava-nc
Copy link
Member

Hi @renanyoy, can you also provide the full flutter run -v log? Also, did you experience this issue in debug mode or profile/release mode?

@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 Feb 9, 2022
@renanyoy
Copy link
Author

it crash in debug and release
but I seen it working one time without crashing

https://pub.waves.pw/ms/crash.log.txt
log is too big to post here

@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 Feb 11, 2022
@danagbemava-nc danagbemava-nc changed the title [camera] startImageStream() - memory crash on iOS (works on android) [camera][iOS] using startImageStream() can lead to memory crash on iOS Feb 11, 2022
@danagbemava-nc
Copy link
Member

Hi @renanyoy, what device were you testing with?

@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 Feb 11, 2022
@renanyoy
Copy link
Author

iPhone XR

@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 Feb 11, 2022
@danagbemava-nc
Copy link
Member

I can reproduce the memory crash in debug mode, but I haven't been able to reproduce the crash in profile mode yet.

Tested on iPhone XS.

Steps to reproduce

  1. Run the code sample below
  2. Use the camera to scan around
  3. Depending on which mode you're in debug/profile, it'll take a while until the memory error comes. I haven't been able to get it crash in profile mode yet
code sample
import 'dart:developer' as dev;
import 'dart:math';

import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const Home(),
    );
  }
}

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);
  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {
  late CameraController controller;
  bool initialized = false;

  @override
  void initState() {
    super.initState();
    init();
  }

  Future<CameraController> initCamera(CameraDescription camera) async {
    final controller = CameraController(camera, ResolutionPreset.max,
        enableAudio: false, imageFormatGroup: ImageFormatGroup.yuv420);
    await controller.initialize();
    controller.lockCaptureOrientation(DeviceOrientation.portraitUp);
    return controller;
  }

  Future<void> init() async {
    final cameras = await availableCameras();
    controller = await initCamera(cameras.first);
    initialized = true;
    setState(() {});
    controller.startImageStream((image) {
      dev.log('frame');
    });
    (() async {
      // OCR cpu usage simulation
      while (true) {
        await Future.delayed(const Duration(seconds: 2));
        double z = 0;
        for (int i = 0; i < 100000000; i  ) {
          z = cos(z);
        }
      }
    })();
  }

  @override
  Widget build(BuildContext context) {
    return initialized ? CameraPreview(controller) : Container();
  }
}
crash log

debug.log

flutter doctor -v
[✓] Flutter (Channel stable, 2.10.1, on macOS 12.2 21D49 darwin-arm, locale en-GB)
    • Flutter version 2.10.1 at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db747aa133 (2 days ago), 2022-02-09 13:57:35 -0600
    • Engine revision ab46186b24
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10 0-b96-7249189)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2020.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.10 0-b96-7249189)

[☠] IntelliJ IDEA Community Edition (the doctor check crashed)
    ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.
    ✗ FormatException: Unexpected extension byte (at offset 5)
    • #0      _Utf8Decoder.convertSingle (dart:convert-patch/convert_patch.dart:1789:7)
      #1      Utf8Decoder.convert (dart:convert/utf.dart:351:42)
      #2      InputStream.readString (package:archive/src/util/input_stream.dart:207:30)
      #3      new ZipDirectory.read (package:archive/src/zip/zip_directory.dart:40:30)
      #4      ZipDecoder.decodeBuffer (package:archive/src/zip_decoder.dart:19:30)
      #5      ZipDecoder.decodeBytes (package:archive/src/zip_decoder.dart:14:12)
      #6      IntelliJPlugins._findPluginXml (package:flutter_tools/src/intellij/intellij.dart:130:44)
      #7      IntelliJPlugins._readPackageVersion (package:flutter_tools/src/intellij/intellij.dart:141:40)
      #8      IntelliJPlugins.validatePackage (package:flutter_tools/src/intellij/intellij.dart:63:35)
      #9      IntelliJValidator.validate (package:flutter_tools/src/intellij/intellij_validator.dart:103:15)
      #10     asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:32)
      #11     asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:109:18)
      #12     _rootRun (dart:async/zone.dart:1426:13)
      #13     _CustomZone.run (dart:async/zone.dart:1328:19)
      #14     _runZoned (dart:async/zone.dart:1861:10)
      #15     runZonedGuarded (dart:async/zone.dart:1849:12)
      #16     runZoned (dart:async/zone.dart:1780:12)
      #17     asyncGuard (package:flutter_tools/src/base/async_guard.dart:109:3)
      #18     Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:205:9)
      #19     Doctor.diagnose (package:flutter_tools/src/doctor.dart:309:47)
      #20     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:50:48)
      #21     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1320:12)
      <asynchronous suspension>
      #22     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
      <asynchronous suspension>
      #23     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
      <asynchronous suspension>
      #24     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
      <asynchronous suspension>
      #25     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
      <asynchronous suspension>
      #26     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
      <asynchronous suspension>
      #27     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
      <asynchronous suspension>
      #28     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
      <asynchronous suspension>
      #29     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
      <asynchronous suspension>
      #30     main (package:flutter_tools/executable.dart:94:3)
      <asynchronous suspension>


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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.2 21D49 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 98.0.4758.80

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

! Doctor found issues in 1 category.
[✓] Flutter (Channel master, 2.11.0-0.0.pre.509, on macOS 12.2 21D49 darwin-arm, locale en-GB)
    • Flutter version 2.11.0-0.0.pre.509 at /Users/nexus/dev/sdks/flutters
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6656356bbf (10 hours ago), 2022-02-10 20:30:17 -0800
    • Engine revision a57061eda8
    • Dart version 2.17.0 (build 2.17.0-87.0.dev)
    • DevTools version 2.10.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10 0-b96-7249189)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2020.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.10 0-b96-7249189)

[✓] IntelliJ IDEA Community Edition (version 2021.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin version 213.5744.122

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.2 21D49 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 98.0.4758.80

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

• No issues found!

@danagbemava-nc danagbemava-nc added found in release: 2.10 Found to occur in 2.10 found in release: 2.11 Found to occur in 2.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: camera The camera plugin platform-ios iOS applications specifically p: first party and removed in triage Presently being triaged by the triage team labels Feb 11, 2022
@danagbemava-nc danagbemava-nc added perf: memory Performance issues related to memory plugin c: fatal crash Crashes that terminate the process labels Feb 11, 2022
@hellohuanlin
Copy link
Contributor

@danagbemava-nc how long did it take for you to crash on your device? I couldn't get it crash on my iPhone 13 mini but can try my old phone.

@hellohuanlin
Copy link
Contributor

hellohuanlin commented Feb 11, 2022

I wasn't able to get it crashed on my phone, but i do notice the lagging, which is expected because of the expensive operation in the example:

      // OCR cpu usage simulation
      while (true) {
        await Future.delayed(const Duration(seconds: 2));
        double z = 0;
        for (int i = 0; i < 100000000; i  ) {
          z = cos(z);
        }
      }

@renanyoy does it crash for you if you remove this block?

@renanyoy
Copy link
Author

renanyoy commented Feb 12, 2022

in the real app, there is a block doing the OCR using google ML kit, in that case it always crashes. you can try

// OCR cpu usage simulation
      while (true) {
        await Future.delayed(const Duration(milliseconds: 200));
        double z = 0;
        for (int i = 0; i < 1000000000; i  ) {
          z = cos(z);
        }
      }

to stress even more your iPhone 13. I tried to do a minimal reproducible sample, it's why this loop.

we can't activate the OCR part in our app for our iOS users cause of that crash.

without the loop it doesn't crash. I think the problem is that somewhere/sometime, when the flutter thread hang, the camera part is not skipping frames and retains them.. and in real app, consuming already lots of ram.. it crash quickly..

@renanyoy
Copy link
Author

maybe it's possible to add a ram usage stress too, to get the crash more often.

@danagbemava-nc
Copy link
Member

@danagbemava-nc how long did it take for you to crash on your device? I couldn't get it crash on my iPhone 13 mini but can try my old phone.

@hellohuanlin It took about 2 minutes. This time around, instead of moving the camera around, I just left the phone by itself.

@Anfet
Copy link

Anfet commented Feb 15, 2022

Not only IOS, but android experience issues with memory on several samsung and xiaomi phones.

I'm intererested why "stopImageStream" actually somehow stops and resets camera.

There is also a frequent error:
Fatal Exception: java.lang.IllegalArgumentException: Surface was abandoned at android.hardware.camera2.utils.SurfaceUtils.getSurfaceSize(SurfaceUtils.java:134) at android.hardware.camera2.params.OutputConfiguration.<init>(OutputConfiguration.java:426) at android.hardware.camera2.params.OutputConfiguration.<init>(OutputConfiguration.java:171) at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:100) at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:1) at io.flutter.plugins.camera.Camera.startPreview(Camera.java:23) at io.flutter.plugins.camera.Camera$1.onOpened(Camera.java:7) at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:165) at android.os.Handler.handleCallback(Handler.java:938)

@hellohuanlin
Copy link
Contributor

hellohuanlin commented Feb 15, 2022

@renanyoy the skipping frame part sounds somewhat related to #69874 but I am not sure yet.

Is it possible to bring that heavy computation off the ui thread? Or is it required to be on UI thread?

@renanyoy
Copy link
Author

renanyoy commented Feb 16, 2022

the computation is here to reproduce the crash more often, like in a real app, with lots of async things running everywhere in the app, and in our case, also doing OCR same time. If you manage to reproduce the crash without it, just remove it.

I think google ML kit runs in another thread/isolate, but copying images between isolates create some UI thread hang too.

@stuartmorgan
Copy link
Contributor

Duplicate of #44436

@stuartmorgan stuartmorgan marked this as a duplicate of #44436 Feb 17, 2022
@github-actions
Copy link

github-actions bot commented Mar 3, 2022

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 3, 2022
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: fatal crash Crashes that terminate the process found in release: 2.10 Found to occur in 2.10 found in release: 2.11 Found to occur in 2.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: camera The camera plugin package flutter/packages repository. See also p: labels. perf: memory Performance issues related to memory platform-ios iOS applications specifically
Projects
None yet
Development

No branches or pull requests

5 participants