Skip to content

Flutter crashes when opening a compute / isolate on iOS #72195

@jeffswt

Description

@jeffswt

Steps to Reproduce

Using iOS 12.4.9 and latest stable Flutter (this can be reproduced on earlier versions)

I'm having an iPhone 5S and it was confirmed on other iOS devices that this can be reproduced.

int myFunction(String x) {
    return 42;
}

// some function while drawing the frame:
var build(var blahblah) async {
    int x = await compute(myFunction, '');
    print('awaited $x');
    return Container(...);
}

This can be run smoothly on Android (on another Windows Flutter), but it crashes on iOS.

Expected results: prints 'awaited 42'

Actual results: Crash

Reloaded 7 of 1266 libraries in 1,418ms.
version=2.10.4 (stable) (Wed Nov 11 13:35:58 2020 +0100) on "ios_arm64"
pid=821, thread=172179, isolate_group=_spawn(0x145666200), isolate=_spawn(0x1450a2c00)
isolate_instructions=102914800, vm_instructions=102914800
  pc 0x00000001031b9874 fp 0x0000000170bed420 Dart_DumpNativeStackTrace+0x18
  pc 0x0000000102d87bcc fp 0x0000000170bed440 dart::Assert::Fail(char const*, ...)+0x30
  pc 0x0000000102d89fcc fp 0x0000000170bed490 dart::Context::Handle(dart::ContextPtr)+0x0
  pc 0x0000000102f33440 fp 0x0000000170bed660 dart::DRT_TypeCheck(dart::NativeArguments)+0xf0
  pc 0x0000000107381a3c fp 0x0000000170bed6a8 Unknown symbol
  pc 0x00000001073847f8 fp 0x0000000170bed708 Unknown symbol
  pc 0x000000011de8a8bc fp 0x0000000170bed758 Unknown symbol
  pc 0x000000011de89744 fp 0x0000000170bed7d0 Unknown symbol
  pc 0x000000011de89ac8 fp 0x0000000170bed810 Unknown symbol
  pc 0x000000011de89744 fp 0x0000000170bed888 Unknown symbol
  pc 0x000000011de893b0 fp 0x0000000170bed8c0 Unknown symbol
  pc 0x0000000107382094 fp 0x0000000170bed998 Unknown symbol
  pc 0x0000000102de9ac8 fp 0x0000000170beda50 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long)+0x2e8
  pc 0x0000000102e1661c fp 0x0000000170bedc80 dart::IsolateMessageHandler::HandleMessage(std::__1::unique_ptr<dart::Message, std::__1::default_delete<dart::Message> >)+0xad4
  pc 0x0000000102e53104 fp 0x0000000170bee130 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)+0x164
  pc 0x0000000102e52c80 fp 0x0000000170bee5c0 dart::MessageHandlerTask::Run()+0x25c
  pc 0x0000000102f82878 fp 0x0000000170beeac0 dart::ThreadPool::Worker::Main(unsigned long)+0x198
  pc 0x0000000102ed96e4 fp 0x0000000170beef30 dart::ThreadStart(void*)+0x104
  pc 0x00000001d6ef52c0 fp 0x0000000170beef50 <redacted>+0x80
  pc 0x00000001d6ef5220 fp 0x0000000170beef70 _pthread_start+0x2c
-- End of DumpStackTrace
[exit     : sp(0) fp(0x170bed6a8) pc(0)]
[stub     : sp(0x170bed6b8) fp(0x170bed708) pc(0x1073847f8)]
[dart     : sp(0x170bed718) fp(0x170bed758) pc(0x11de8a8bc) package:flutter/src/foundation/_isolates_io.dart_::__spawn@483206865__spawn@483206865 ]
[dart     : sp(0x170bed768) fp(0x170bed7d0) pc(0x11de89744) dart:core__Closure@0150898_dyn_call ]
[dart     : sp(0x170bed7e0) fp(0x170bed810) pc(0x11de89ac8) dart:isolate_::__startIsolate@1026248_<anonymous closure> ]
[dart     : sp(0x170bed820) fp(0x170bed888) pc(0x11de89744) dart:core__Closure@0150898_dyn_call ]
[dart     : sp(0x170bed898) fp(0x170bed8c0) pc(0x11de893b0) dart:isolate__RawReceivePortImpl@1026248__handleMessage@1026248 ]
[entry    : sp(0x170bed8d0) fp(0x170bed998) pc(0x107382094)]
Logs
[✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-CN)
    • Flutter version 1.22.4 at /Users/jeffswt/Programs/flutter
    • Framework revision 1aafb3a8b9 (4 weeks ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
      You may also want to add it to your PATH environment variable.



[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

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


[✓] Connected device (1 available)
    • jeffswt's iPhone (mobile) • 5c0..........113e1c • ios • iOS 12.4.9
    ! Error: jeffswt's iPhone is busy: Copying cache files from device. Xcode will continue when jeffswt's iPhone is finished. (code -10)

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consoledependency: dartDart team may need to help use: OS-version specificAffects only some versions of the relevant operating systemplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versiont: hot reloadReloading code during "flutter run"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions