Repository navigation
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.0Found to occur in 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Steps to Reproduce
description: I was attempting to induce a hot reload from a build/test script written in rust,
this example illustrates the attempted use of q hotkey after flutter is running
- install rust toolchain (https://www.rust-lang.org/tools/install)
cargo new flutter_stdin- paste https://gist.github.com/smokytheangel0/c2f4b97ab0037a1e1357b9848dd17274 into flutter_stdin/src/main.rs
cargo buildin flutter_stdinflutter create stdin_testin ../cp flutter_stdin/target/debug/flutter_stdin stdin_test./flutter_stdinin stdin_test
Logs
Unhandled exception:
FileSystemException: writeFrom failed, path = '' (OS Error: Broken pipe, errno = 32)
#0 _RandomAccessFile.writeFromSync (dart:io/file_impl.dart:881:7)
#1 _StdConsumer.addStream.<anonymous closure> (dart:io/stdio.dart:312:15)
#2 _rootRunUnary (dart:async/zone.dart:1138:13)
#3 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#4 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
#5 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#6 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#7 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:773:19)
#8 _StreamController._add (dart:async/stream_controller.dart:649:7)
#9 _StreamController.add (dart:async/stream_controller.dart:595:5)
#10 _StreamSinkImpl.add (dart:io/io_sink.dart:158:17)
#11 _IOSinkImpl.write (dart:io/io_sink.dart:291:5)
#12 _StdSink.write (dart:io/stdio.dart:341:11)
#13 Stdio._stdioWrite.<anonymous closure> (package:flutter_tools/src/base/io.dart:276:12)
#14 asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:32)
#15 _rootRun (dart:async/zone.dart:1126:13)
#16 _CustomZone.run (dart:async/zone.dart:1023:19)
#17 _runZoned (dart:async/zone.dart:1518:10)
#18 runZoned (dart:async/zone.dart:1502:12)
#19 asyncGuard (package:flutter_tools/src/base/async_guard.dart:109:3)
#20 Stdio._stdioWrite (package:flutter_tools/src/base/io.dart:275:5)
#21 Stdio.stdoutWrite (package:flutter_tools/src/base/io.dart:269:9)
#22 StdoutLogger.writeToStdOut (package:flutter_tools/src/base/logger.dart:270:48)
#23 StdoutLogger.printStatus (package:flutter_tools/src/base/logger.dart:265:5)
#24 printStatus (package:flutter_tools/src/globals.dart:128:10)
#25 TerminalHandler._commonTerminalInputHandler (package:flutter_tools/src/resident_runner.dart:1161:5)
#26 TerminalHandler.processTerminalInput (package:flutter_tools/src/resident_runner.dart:1303:13)
#27 _rootRunUnary (dart:async/zone.dart:1134:38)
#28 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#29 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
#30 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#31 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#32 _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:377:20)
#33 _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:252:5)
#34 _AsBroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:476:11)
#35 _rootRunUnary (dart:async/zone.dart:1134:38)
#36 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#37 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
#38 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#39 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#40 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:70:11)
#41 _EventSinkWrapper.add (dart:async/stream_transformers.dart:17:11)
#42 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
#43 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)
#44 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:314:20)
#45 _ErrorHandlingAsciiDecoderSink.addSlice (dart:convert/ascii.dart:254:17)
#46 _ErrorHandlingAsciiDecoderSink.add (dart:convert/ascii.dart:240:5)
#47 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:74:18)
#48 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:122:24)
#49 _rootRunUnary (dart:async/zone.dart:1134:38)
#50 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#51 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
#52 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#53 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#54 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:773:19)
#55 _StreamController._add (dart:async/stream_controller.dart:649:7)
#56 _StreamController.add (dart:async/stream_controller.dart:595:5)
#57 _Socket._onData (dart:io-patch/socket_patch.dart:1878:41)
#58 _rootRunUnary (dart:async/zone.dart:1138:13)
#59 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#60 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
#61 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#62 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7)
#63 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:773:19)
#64 _StreamController._add (dart:async/stream_controller.dart:649:7)
#65 _StreamController.add (dart:async/stream_controller.dart:595:5)
#66 new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1423:33)
#67 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:927:14)
#68 _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#69 _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#70 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#71 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
[✓] Flutter (Channel master, v1.15.4-pre.201, on Linux, locale en_US.UTF-8)
• Flutter version 1.15.4-pre.201 at /home/j0/flutter
• Framework revision 52a5311924 (5 days ago), 2020-02-27 10:41:08 -0800
• Engine revision 060a7733a6
• Dart version 2.8.0 (build 2.8.0-dev.10.0 4189237330)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /home/j0/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /home/j0/Android/Sdk
• Java binary at: /home/j0/Downloads/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_212-release-1586-b4-5784211)
✗ Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit
https://flutter.dev/setup/#android-setup for detailed instructions.
[!] Android Studio (version 3.6)
• Android Studio at /home/j0/Downloads/android-studio
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build
1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.41.1)
• VS Code at /usr/share/code
• Flutter extension version 3.8.1
[✓] Connected device (1 available)
• Nexus 6P • 84B7N15A07006474 • android-arm64 • Android 8.1.0 (API 27)
! Doctor found issues in 2 categories.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.0Found to occur in 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
smokytheangel0 commentedon Mar 3, 2020
this code which never writes to stdin does not produce an error, but obviously it also does not perform as intended: https://gist.github.com/smokytheangel0/96edd82a5ced3ac25703609538ee1464
TahaTesser commentedon Mar 4, 2020
Hi @smokytheangel0
This platform is not meant for assistance on personal code. Please see https://flutter.dev/community for resources and asking questions like this, you may also get some help if you post it on Stack Overflow. Closing, as this isn't an issue with Flutter itself,
if you disagree please write in the comments and I will reopen it
Thank you
smokytheangel0 commentedon Mar 4, 2020
This was not a post for assistance, I am under the impression that there is a bug in how the flutter tool deals with stdin, the rust code is only there to provide the minimum code to demonstrate the bug. I suppose you could reproduce the bug in other languages, the task was to operate the hot loaded key commands like 'r' for hot reload, 'q' for quit, etc, from a program that is piped to the stdin of the flutter tool.
smokytheangel0 commentedon Mar 4, 2020
my build system would very much benefit from being able to operate the flutter run interface through stdin, or a c binding, but I am blocked by this bug.
TahaTesser commentedon Mar 5, 2020
Hi @smokytheangel0
If you believe there is an issue with Flutter itself
To better address the issue, would be helpful
if you could post a minimal code sample to reproduce the problem without the 3rd party code/sdk
Thank you
christopherfujino commentedon Jan 2, 2021
I'm also hitting this. I wrote a ruby wrapper around the Flutter tool, using
IO.popenand also hit this, without even trying to write to the tool's stdin. For example:will result in essentially the same stacktrace as OP.
[-]flutter run (when spawned from rust script) crashes when its stdin is written to[/-][+]flutter run (when spawned from external script) crashes when its stdin is written to[/+]9 remaining items
flutter-triage-bot commentedon Nov 3, 2025
This issue is assigned to @bkonyi but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
flutter-triage-bot commentedon Nov 18, 2025
This issue is assigned to @bkonyi but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
flutter-triage-bot commentedon Jan 27, 2026
This issue was assigned to @bkonyi but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.
[flutter_tools] Prevent crash when stdout is broken and print fails (f…
github-actions commentedon Sep 7, 2026
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 -vand a minimal reproduction of the issue.