8000 App freezes spawning a `Process` from Mac desktop app on M1 · Issue #95805 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

App freezes spawning a Process from Mac desktop app on M1 #95805

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.

Sign up for GitHub < 8000 /div>

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

Closed
blahblab opened this issue Dec 25, 2021 · 36 comments
Closed

App freezes spawning a Process from Mac desktop app on M1 #95805

blahblab opened this issue Dec 25, 2021 · 36 comments
Assignees
Labels
c: regression It was better in the past than it is now dependency: dart Dart team may need to help us found in release: 2.8 Found to occur in 2.8 found in release: 2.9 Found to occur in 2.9 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-host-arm Building on an ARM-based platform platform-mac Building on or for macOS specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@blahblab
Copy link
blahblab commented Dec 25, 2021

This used to work some three months ago. I have abstracted the issue out of my code (my actual code is making numerous Curl calls using this format, and I've tried both sync and async, with and without awaits. I abstracted this snippet out to replicate. It just hangs and has to be restarted. There is no output even using verbose.

Steps to Reproduce

Embed this in the _demo Flutter app _MyHomePageState and press the button a few times. _

   int _counter = 0;

  void _incrementCounter() {
    setState(() {
            _counter++;
    });

    for (int i = 0; i < _counter; i ++) {

      Timer(Duration(seconds: i), () {
        print(" This line is execute after $i  seconds");
        var result =  Process.start('ls', [
          '-l',
        ]);

        print(" $i  $result");
      });
      print("complete iteration");
    }
    print("complete Run");
  }
Logs
[✓] Flutter (Channel stable, 2.8.0, on macOS 12.0.1 21A559 darwin-arm, locale en-CA)
    • Flutter version 2.8.0 at /Users/nik/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cf44000065 (2 weeks ago), 2021-12-08 14:06:50 -0800
    • Engine revision 40a99c5951
    • Dart version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nik/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-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.1

[✓] 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-7281165)

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.0.1 21A559 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 96.0.4664.110
    ! Error: iPad Pro (12.9-inch) (5th generation) has recently restarted. Xcode will continue when iPad Pro (12.9-inch) (5th generation) is unlocked. (code -14)
@maheshj01 maheshj01 added the in triage Presently being triaged by the triage team label Dec 27, 2021
@maheshj01
Copy link
Member

Hi @blahblab, Thanks for filing the issue. I am able to reproduce the issue. When running the below code sample on stable 2.8.1 the app lags after incrementing the counter couple of times while it works fine on stable 2.5.3.

master 2.9/ stable 2.8.1 stable 2.5.3
Screen.Recording.2021-12-27.at.3.20.06.PM.mov
Screen.Recording.2021-12-27.at.3.21.35.PM.mov
code sample
import 'dart:async';
import 'dart:io';

import 'package:flutter/material.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 MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });

    for (int i = 0; i < _counter; i++) {
      Timer(Duration(seconds: i), () {
        print(" This line is execute after $i  seconds");
        var result = Process.start('ls', [
          '-l',
        ]);

        print(" $i  $result");
      });
      print("complete iteration");
    }
    print("complete Run");
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
flutter doctor -v (stable/master)
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-arm, locale en-GB)
    • Flutter version 2.8.1 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (11 days ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 4.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 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

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

[✓] Connected device (3 available)
    • iPhone 13 (mobile) • 45FE8AD8-94DA-4F94-B52B-81102B1B42E7 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-0
      (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64   • macOS 12.1 21C52 darwin-arm
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 96.0.4664.110

• No issues found!
[✓] Flutter (Channel master, 2.9.0-1.0.pre.93, on macOS 12.1 21C52 darwin-arm, locale en-GB)
    • Flutter version 2.9.0-1.0.pre.93 at /Users/mahesh/Documents/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 1be7f1ea56 (12 days ago), 2021-12-14 22:14:07 -0500
    • Engine revision e444009bf4
    • Dart version 2.16.0 (build 2.16.0-109.0.dev)
    • DevTools version 2.9.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 4.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 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.1 21C52 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 96.0.4664.110

• No issues found!
flutter doctor -v (stable 2.5.3)
[✓] Flutter (Channel stable, 2.5.3, on macOS 12.1 21C52 darwin-arm, locale en-GB)
    • Flutter version 2.5.3 at /Users/mahesh/Documents/flutter_beta
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (2 months ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    • CocoaPods version 1.10.2

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

[✓] Android Studio (version 4.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 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.1 21C52 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 96.0.4664.110

• No issues found!
stable 2.5.3 logs
mahesh@Maheshs-MacBook-Air-M1 counter % flutterb run -d macos
╔════════════════════════════════════════════════════════════════════════════╗
║ A new version of Flutter is available!                                     ║
║                                                                            ║
║ To update to the latest version, run "flutter upgrade".                    ║
╚════════════════════════════════════════════════════════════════════════════╝


Running "flutter pub get" in counter...                             6.4s
Launching lib/main.dart on macOS in debug mode...
Running pod install...                                           1,120ms
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:x86_64, id:6A745C96-D83E-5C8D-8EE9-5958E598001B }
{ platform:macOS, name:Any Mac }
Building macOS application...                                           
Syncing files to device macOS...                                   172ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:50116/Uhv_8SxaXFw=/
The Flutter DevTools debugger and profiler on macOS is available at:
http://127.0.0.1:9101?uri=http://127.0.0.1:50116/Uhv_8SxaXFw=/
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 1  seconds
flutter:  1  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 2  seconds
flutter:  2  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 7  second
8000
s
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 3  seconds
flutter:  3  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 7  seconds
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 7  seconds
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 4  seconds
flutter:  4  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 7  seconds
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 8  seconds
flutter:  8  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 7  seconds
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 8  seconds
flutter:  8  Instance of 'Future<Process>'
flutter:  This line is execute after 5  seconds
flutter:  5  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 7  seconds
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 8  seconds
flutter:  8  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 7  seconds
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 8  seconds
flutter:  8  Instance of 'Future<Process>'
flutter:  This line is execute after 9  seconds
flutter:  9  Instance of 'Future<Process>'
flutter:  This line is execute after 6  seconds
flutter:  6  Instance of 'Future<Process>'
flutter:  This line is execute after 7  seconds
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 8  seconds
flutter:  8  Instance of 'Future<Process>'
flutter:  This line is execute after 9  seconds
flutter:  9  Instance of 'Future<Process>'
flutter:  This line is execute after 7  seconds
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 8  seconds
flutter:  8  Instance of 'Future<Process>'
flutter:  This line is execute after 9  seconds
flutter:  9  Instance of 'Future<Process>'
flutter:  This line is execute after 7  seconds
flutter:  7  Instance of 'Future<Process>'
flutter:  This line is execute after 8  seconds
flutter:  8  Instance of 'Future<Process>'
flutter:  This line is execute after 9  seconds
flutter:  9  Instance of 'Future<Process>'
flutter:  This line is execute after 10  seconds
flutter:  10  Instance of 'Future<Process>'
flutter:  This line is execute after 8  seconds
flutter:  8  Instance of 'Future<Process>'
flutter:  This line is execute after 9  seconds
flutter:  9  Instance of 'Future<Process>'
flutter:  This line is execute after 10  seconds
flutter:  10  Instance of 'Future<Process>'
flutter:  This line is execute after 8  seconds
flutter:  8  Instance of 'Future<Process>'
flutter:  This line is execute after 9  seconds
flutter:  9  Instance of 'Future<Process>'
flutter:  This line is execute after 10  seconds
flutter:  10  Instance of 'Future<Process>'
flutter:  This line is execute after 9  seconds
flutter:  9  Instance of 'Future<Process>'
flutter:  This line is execute after 10  seconds
flutter:  10  Instance of 'Future<Process>'
flutter:  This line is execute after 11  seconds
flutter:  11  Instance of 'Future<Process>'
flutter:  This line is execute after 9  seconds
flutter:  9  Instance of 'Future<Process>'
flutter:  This line is execute after 10  seconds
flutter:  10  Instance of 'Future<Process>'
flutter:  This line is execute after 11  seconds
flutter:  11  Instance of 'Future<Process>'
flutter:  This line is execute after 10  seconds
flutter:  10  Instance of 'Future<Process>'
flutter:  This line is execute after 11  seconds
flutter:  11  Instance of 'Future<Process>'
flutter:  This line is execute after 10  seconds
flutter:  10  Instance of 'Future<Process>'
flutter:  This line is execute after 11  seconds
flutter:  11  Instance of 'Future<Process>'
flutter:  This line is execute after 12  seconds
flutter:  12  Instance of 'Future<Process>'
flutter:  This line is execute after 11  seconds
flutter:  11  Instance of 'Future<Process>'
flutter:  This line is execute after 12  seconds
flutter:  12  Instance of 'Future<Process>'
flutter:  This line is execute after 11  seconds
flutter:  11  Instance of 'Future<Process>'
flutter:  This line is execute after 12  seconds
flutter:  12  Instance of 'Future<Process>'
flutter:  This line is execute after 12  seconds
flutter:  12  Instance of 'Future<Process>'
flutter:  This line is execute after 13  seconds
flutter:  13  Instance of 'Future<Process>'
flutter:  This line is execute after 12  seconds
flutter:  12  Instance of 'Future<Process>'
flutter:  This line is execute after 13  seconds
flutter:  13  Instance of 'Future<Process>'
flutter:  This line is execute after 13  seconds
flutter:  13  Instance of 'Future<Process>'
flutter:  This line is execute after 13  seconds
flutter:  13  Instance of 'Future<Process>'
flutter:  This line is execute after 14  seconds
flutter:  14  Instance of 'Future<Process>'
flutter:  This line is execute after 14  seconds
flutter:  14  Instance of 'Future<Process>'
flutter:  This line is execute after 14  seconds
flutter:  14  Instance of 'Future<Process>'
flutter:  This line is execute after 15  seconds
flutter:  15  Instance of 'Future<Process>'
flutter:  This line is execute after 15  seconds
flutter:  15  Instance of 'Future<Process>'
flutter:  This line is execute after 16  seconds
flutter:  16  Instance of 'Future<Process>'
master logs
mahesh@Maheshs-MacBook-Air-M1 counter % flutter run -d macos
Running "flutter pub get" in counter...                             3.4s
Launching lib/main.dart on macOS in debug mode...
Running pod install...                                           2,672ms
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:x86_64, id:6A745C96-D83E-5C8D-8EE9-5958E598001B }
{ platform:macOS, name:Any Mac }
Building macOS application...                                           
Syncing files to device macOS...                                   510ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:49903/U2NVsxe_NG8=/
The Flutter DevTools debugger and profiler on macOS is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:49903/U2NVsxe_NG8=/
flutter: complete iteration
flutter: complete Run
flutter:  This line is execute after 0  seconds
flutter:  0  Instance of 'Future<Process>'
Application finished.

@maheshj01 maheshj01 changed the title Process Class hanging after multiple call on MacOS [MacOS Desktop] Process Class Freezes app after multiple calls Dec 27, 2021
@maheshj01 maheshj01 added a: desktop Running on desktop found in release: 2.8 Found to occur in 2.8 found in release: 2.9 Found to occur in 2.9 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-mac Building on or for macOS specifically c: regression It was better in the past than it is now and removed in triage Presently being triaged by the triage team labels Dec 27, 2021
@blahblab
Copy link
Author

I'm also pretty sure this happens on Windows 11 PC also.

@maheshj01
Copy link
Member

I'm also pretty sure this happens on Windows 11 PC also.

I did verify on ubuntu 20.04.3 LTS it works fine there. I will update my response If I am able to reproduce this on Windows.

@blahblab
Copy link
Author
blahblab commented Jan 4, 2022

Oh this is interesting, I ran a Release version of the build today (still through Android Studio on same MacOS system) and that seems to work fine?

@maheshj01
Copy link
Member

Oh this is interesting, I ran a Release version of the build today (still through Android Studio on same MacOS system) and that seems to work fine?

Yes, I can confirm this, This issue seems to be only in debug mode and works fine in release mode.

@gspencergoog
Copy link
Contributor
gspencergoog commented Jan 6, 2022

Does the outcome change if you wait on the Future and get the process result?

Make sure you check out the docs for Process.start: it's a little tricky when it comes to how 8000 it is used. Waiting on stderr and stdout to complete is basically required to avoid leaking resources.

@gspencergoog gspencergoog added P2 Important issues not at the top of the work list and removed a: desktop Running on desktop labels Jan 6, 2022
@blahblab
Copy link
Author
blahblab commented Jan 6, 2022

It does not make a difference if I await.

@gspencergoog
Copy link
Contributor

Just another data point, I tried running the following plain Dart script on my Mac, and it runs just fine without hanging, so it does have an interaction with Flutter somehow:

import 'dart:async';
import 'dart:io';

void main(List<String> args) {
  for (int i = 0; i < 10; i++) {
    Timer(Duration(seconds: i), () {
      print(" This line is executed after $i seconds");
      var result = Process.start('ls', ['-l']);

      print(" $i  $result");
    });
    print("complete iteration");
  }
}

@gspencergoog
Copy link
Contributor
gspencergoog commented Jan 10, 2022

I cannot reproduce this on Linux or macOS on the master branch. I pressed the button 20 times in rapid succession, and it didn't lock up, and printed all the expected output.

flutter doctor -v
[✓] Flutter (Channel unknown, 2.9.0-1.0.pre.299, on macOS 12.1 21C52 darwin-x64,
    locale en)
    • Flutter version 2.9.0-1.0.pre.299 at /Users/gspencer/code/flutter
    • Upstream repository unknown
    • Framework revision 098721e341 (7 hours ago), 2022-01-10 05:40:18 -0500
    • Engine revision 6a9c04dc47
    • Dart version 2.16.0 (build 2.16.0-144.0.dev)
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/gspencer/Library/Android/sdk
• Platform android-31, build-tools 30.0.3
• ANDROID_HOME = /Users/gspencer/Library/Android/sdk
• 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.1

[✓] 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 with Blaze.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)

[✓] Android Studio (version 2020.3)
• Android Studio at /Application 8000 s/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)

[✓] Android Studio (version 4.0)
• Android Studio at /Users/gspencer/Library/Application
Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6514223/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
1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Community Edition (version 2021.2.2)
• IntelliJ at /Users/gspencer/Applications/IntelliJ IDEA CE.app
• Flutter plugin version 63.3.3
• Dart plugin version 212.5632

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

[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 12.1 21C52 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.71

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

• No issues found!

@gspencergoog
Copy link
Contributor
gspencergoog commented Jan 10, 2022

(sorry, accidentally hit "close")

I was also unable to reproduce this on the stable branch on macOS as well:

Flutter 2.8.1 • channel stable • git@github.com:flutter/flutter.git
Framework • revision 77d935af4d (4 weeks ago) • 2021-12-16 08:37:33 -0800
Engine • revision 890a5fca2e
Tools • Dart 2.15.1

@blahblab and @maheshmnj Can you think of anything that might be different about your setup, or more detail about how to reproduce it? Did you hit the "+" button in rapid succession, or slowly? It looks like it hangs right away when you press it: is that the case? My method was to click the "+" 20 times in rapid succession.

@rafalglowacz
Copy link
rafalglowacz commented Jan 10, 2022

@gspencergoog It seems that the issue mostly, or even exclusively, affects darwin-arm (M1 Macs). Judging from your logs you're on an Intel Mac. @blahblab and @maheshmnj both have darwin-arm in their logs and so do I, and I can reproduce it consistently, also on 2.9.0-0.1.pre. Going back to stable 2.5.3 helps just like @maheshmnj mentioned in a couple places.

@gspencergoog
Copy link
Contributor

OK, thanks, that's a good data point. Thanks for giving me a good reason to order an M1. :-)

@gspencergoog gspencergoog added P1 High-priority issues at the top of the work list and removed P2 Important issues not at the top of the work list labels Jan 10, 2022
@jmagman jmagman changed the title App freezes calling Process from Mac desktop app on M1, Sandbox: ls(4387) deny(1) mach-lookup com.apple.oahd App freezes spawning a Process from Mac desktop app on M1, Sandbox: ls(4387) deny(1) mach-lookup com.apple.oahd Jan 12, 2022
@maheshj01 maheshj01 added the platform-host-arm Building on an ARM-based platform label Jan 12, 2022
@jmagman
Copy link
Member
jmagman commented Jan 12, 2022

Never mind, ls(56165) deny(1) mach-lookup com.apple.oahd logs even when it doesn't freeze so that was a red herring. And the com.apple.security.temporary-exception.mach-lookup.global-name change didn't work, I wasn't reproducing correctly when I suggested it.

Bisected to #92313 / flutter/engine#29292

@jmagman jmagman added the dependency: dart Dart team may need to help us label Jan 12, 2022
@jmagman jmagman changed the title App freezes spawning a Process from Mac desktop app on M1, Sandbox: ls(4387) deny(1) mach-lookup com.apple.oahd App freezes spawning a Process from Mac desktop app on M1 Jan 12, 2022
@zanderso
Copy link
Member

In that Dart roll, I'm seeing the change to switch the way the sampling CPU profiler works (https://dart.googlesource.com/sdk.git/+/db45ae178a71c4df41ceec3c28c6d562dedc132f). Does this happen in a --release build?

@zanderso
Copy link
Member

/cc @bkonyi

@bkonyi
Copy link
Contributor
bkonyi commented Jan 24, 2022

None of us on the VM team have consistent access to an M1 device, but @rmacnak-google will take a look once his arrives (could be a month or so).

@jmagman
Copy link
Member
jmagman commented Jan 24, 2022

Does this happen in a --release build?

@zanderso it doesn't happen in a release build:

Oh this is interesting, I ran a Release version of the build today (still through Android Studio on same MacOS system) and that seems to work fine?

Yes, I can confirm this, This issue seems to be only in debug mode and works fine in release mode.

@blahblab
Copy link
Author

yeah as the op I can confirm that my workaround is to use release build

@blahblab
Copy link
Author

Hi folks, was there ever a resolution to this bug? Thanks!

@cbracken
Copy link
Member
cbracken commented Jun 1, 2022

I'm unable to reproduce this on stable (3.0.0) branch with the above piece of code. @blahblab are you still running into this?

@cbracken cbracken added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 1, 2022
@hongfeiyang
Copy link
hongfeiyang commented Jun 2, 2022

I am finally able to get outputs from stdout correctly now in debug mode, thank you flutter team

@xvrh
Copy link
Contributor
xvrh commented Jun 17, 2022

@cbracken I can still reproduce this issue in version 3.0.2.

process_test.dart

import 'dart:io';
import 'package:test/test.dart';

void main() {
  test('Process.run', () async {
    for (var i = 0; i < 100; i++) {
     // Idem with Process.runSync
      await Process.run('ls', []);
      print('Run $i');
    }
  });
}

Run dart test process_test.dart => OK

Run flutter test process_test.dart => NOT OK: it will hang randomely after ~10 iterations.

Flutter 3.0.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision cd41fdd495 (9 days ago) • 2022-06-08 09:52:13 -0700
Engine • revision f15f824b57
Tools • Dart 2.17.3 • DevTools 2.12.2

@cbracken
Copy link
Member

@xvrh thanks, I can repro in flutter_tester.

@github-actions
Copy link
github-actions bot commented Jul 4, 2022

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

@github-actions github-actions bot closed this as completed Jul 4, 2022
@xvrh
Copy link
Contributor
xvrh commented Jul 5, 2022

@cbracken can we re-open this ticket?
As per #95805 (comment) this is reproducible and it still happens on master.

@maheshj01
Copy link
Member

Reopening since this was reproducible on the secondary triage #95805 (comment)

@maheshj01 maheshj01 reopened this Jul 5, 2022
@maheshj01 maheshj01 removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 5, 2022
@gspencergoog gspencergoog assigned a-wallen and unassigned gspencergoog Sep 9, 2022
@a-wallen
Copy link
Contributor
a-wallen commented Sep 26, 2022

@xvrh the issue is still reproducible on stable, but not currently on master. If I bisected correctly, c6ec84e from this PR solves the issue.

@xvrh
Copy link
Contributor
xvrh commented Sep 27, 2022

@a-wallen Thanks! I confirm it works correctly on master.

@maheshj01 maheshj01 added the r: fixed Issue is closed as already fixed in a newer version label Sep 28, 2022
@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 Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now dependency: dart Dart team may need to help us found in release: 2.8 Found to occur in 2.8 found in release: 2.9 Found to occur in 2.9 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-host-arm Building on an ARM-based platform platform-mac Building on or for macOS specifically r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

No branches or pull requests

0