Repository: flutter
Issue: FileSystemException: writeFrom failed, path = '' (OS Error: The pipe is being closed.  , errno = 232)
Labels: c: crash,tool,platform-windows,a: build,P2,team-tool,triaged-tool

## Steps to Reproduce

The following exception is happen either i am creating new project or working on my old projects. I am using window 10 pro version. when i press the hot-reload button, the exception occur and its not the only way it occur whatever i did in my code either write some line or make any changes to any file my device get disconnected and emulator or browser get closed automatically.


this is what i got as exception:

```
Launching lib\main.dart on Chrome in debug mode...
Debug service listening on ws://127.0.0.1:51506/LSfCg5WB6AU=/ws
Running with unsound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety
Connecting to VM Service at ws://127.0.0.1:51506/LSfCg5WB6AU=/ws
Unhandled exception:
FileSystemException: writeFrom failed, path = '' (OS Error: The pipe is being closed.

, errno = 232)
[38;5;244m#0      _RandomAccessFile.writeFromSync (dart:io/file_impl.dart:870:7)[39;49m
[38;5;244m#1      _StdConsumer.addStream.<anonymous closure> (dart:io/stdio.dart:286:15)[39;49m
[38;5;244m#2      _RootZone.runUnaryGuarded (dart:async/zone.dart:1546:10)[39;49m
[38;5;244m#3      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)[39;49m
[38;5;244m#4      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)[39;49m
[38;5;244m#5      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)[39;49m

[38;5;244m#6      _StreamController._add (dart:async/stream_controller.dart:607:7)[39;49m
[38;5;244m#7      _StreamController.add (dart:async/stream_controller.dart:554:5)[39;49m
[38;5;244m#8      _StreamSinkImpl.add (dart:io/io_sink.dart:136:17)[39;49m
[38;5;244m#9      _IOSinkImpl.write (dart:io/io_sink.dart:269:5)[39;49m
[38;5;244m#10     _IOSinkImpl.writeln (dart:io/io_sink.dart:289:5)[39;49m
[38;5;244m#11     _StdSink.writeln (dart:io/stdio.dart:319:11)[39;49m
[38;5;248m#12     FrontendCompiler.recompileDelta (package:frontend_server/frontend_server.dart:747:19)[39;49m
[38;5;248m#13     _FlutterFrontendCompiler.recompileDelta (package:flutter_frontend_server/server.dart:48:22)[39;49m

[38;5;248m#14     listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1167:20)[39;49m
[38;5;248m#15     listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1093:15)[39;49m
[38;5;244m#16     _RootZone.runUnaryGuarded (dart:async/zone.dart:1546:10)[39;49m
[38;5;244m#17     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)[39;49m
[38;5;244m#18     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)[39;49m
[38;5;244m#19     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)[39;49m
[38;5;244m#20     _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)[39;49m
[38;5;244m#21     _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)[39;49m
[38;5;244m#22     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:155:13)[39;49m
[38;5;244m#23     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:130:5)[39;49m
[38;5;244m#24     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)[39;49m

[38;5;244m#25     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)[39;49m
[38;5;244m#26     _RootZone.runUnaryGuarded (dart:async/zone.dart:1546:10)[39;49m
[38;5;244m#27     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)[39;49m
[38;5;244m#28     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)[39;49m
[38;5;244m#29     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)[39;49m
[38;5;244m#30     _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)[39;49m
[38;5;244m#31     _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)[39;49m
[38;5;244m#32     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)[39;49m
[38;5;244m#33     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)[39;49m
[38;5;244m#34     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)[39;49m
[38;5;244m#35     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)[39;49m
[38;5;244m#36     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)[39;49m
[38;5;244m#37     _RootZone.runUnaryGuarded (dart:async/zone.dart:1546:10)[39;49m
[38;5;244m#38     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)[39;49m
[38;5;244m#39     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)[39;49m
[38;5;244m#40     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)[39;49m
[38;5;244m#41     _StreamController._add (dart:async/stream_controller.dart:607:7)[39;49m
[38;5;244m#42     _StreamController.add (dart:async/stream_controller.dart:554:5)[39;49m
[38;5;244m#43     _Socket._onData (dart:io-patch/socket_patch.dart:2144:41)[39;49m
[38;5;244m#44     _RootZone.runUnaryGuarded (dart:async/zone.dart:1546:10)[39;49m
[38;5;244m#45     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)[39;49m
[38;5;244m#46     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)[39;49m
[38;5;244m#47     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)[39;49m
[38;5;244m#48     _StreamController._add (dart:async/stream_controller.dart:607:7)[39;49m
[38;5;244m#49     _StreamController.add (dart:async/stream_controller.dart:554:5)[39;49m
[38;5;244m#50     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1680:33)[39;49m

[38;5;244m#51     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1192:14)[39;49m
[38;5;244m#52     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)[39;49m
[38;5;244m#53     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)[39;49m
[38;5;244m#54     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:120:13)[39;49m
[38;5;244m#55     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)[39;49m

the Dart compiler exited unexpectedly.
Exited (sigterm)
```




<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
 flutter doctor -v
[√] Flutter (Channel stable, 2.0.5, on Microsoft Windows [Version 10.0.19042.928], locale en-US)
    • Flutter version 2.0.5 at C:\Users\Akash\fvm\default
    • Framework revision adc687823a (2 weeks ago), 2021-04-16 09:40:20 -0700
    • Engine revision b09f014e96
    • Dart version 2.12.3

[X] Android toolchain - develop for Android devices
    X 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/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] 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/windows#android-setup for detailed instructions).

[√] VS Code (version 1.55.2)
    • VS Code at C:\Users\Akash\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.21.0

[√] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.93
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 90.0.818.51

! Doctor found issues in 2 categories.

```