Repository navigation
Dart Tooling Daemon connection terminates after 60s idle with Norton antivirus installed #5794
Description
Describe the bug
When you build any app using Flutter, in my case I created a new app using the empty app template that comes with Flutter/VS Code. So to clarify if you create a new app using VS Code (View/Command Pallete/Empty Application) then select Run the app will build successfully and run on my real Android phone. It could be a few minutes latter that the app exits and displays this error. This happens on two different Android phones and two different USB cables. I'm also getting the error 'Unhandled exception:
FileSystemException: writeFrom failed, path = '' (OS Error: The pipe is being closed. , errno = 232)' which may be caused by the daemon exiting?
To Reproduce
Steps to reproduce the behavior:
- create a new app using VS Code (View/Command Pallete/Empty Application)
- Select Run the app (start debuging) and theapp will build successfully and run on my real Android phone.
- Some time latter (could be a couple ofminutes) I get a popup message saying "The Dart Tooling Daemon connection has terminated."
.
Expected behavior
The app should continue to run in debug mode without any errors and stay connected to device
Please complete the following information:
You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.
Dart Code extension: 3.122.0
Flutter extension: 3.122.0 (activated)
App: Visual Studio Code
App Host: desktop
Version: win 1.105.1
Workspace type: Flutter (LSP)
Workspace name: flutter_application_1
Dart (3.9.2): C:\Users\pcira\dev\flutter\bin\cache\dart-sdk
Flutter (3.35.7): C:\Users\pcira\dev\flutter (Pixel 7 Pro (android-arm64/android))
Output from 'dart info'
C:\Users\pcira\dev\flutter\bin\cache\dart-sdk\bin\dart.exe info
If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.
General info
- Dart 3.9.2 (stable) (Wed Aug 27 03:49:40 2025 -0700) on "windows_x64"
- on windows / "Windows 11 Pro" 10.0 (Build 26200)
- locale is en-US
Project info
- sdk constraint: '^3.9.2'
- dependencies: flutter
- dev_dependencies: flutter_lints, flutter_test
Process info
| Memory | CPU | Elapsed time | Command line |
|---|---|---|---|
| 28 MB | -- | dart.exe | |
| 111 MB | -- | dart.exe | |
| 121 MB | -- | dart.exe | |
| 95 MB | -- | dart.exe |
Output from 'flutter doctor'
C:\Users\pcira\dev\flutter\bin\flutter.bat doctor -v
[√] Flutter (Channel stable, 3.35.7, on Microsoft Windows [Version 10.0.26200.7171], locale en-US) [358ms]
• Flutter version 3.35.7 on channel stable at C:\Users\pcira\dev\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision adc9010625 (3 weeks ago), 2025-10-21 14:16:03 -0400
• Engine revision 035316565a
• Dart version 3.9.2
• DevTools version 2.48.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging
[√] Windows Version (11 Pro 64-bit, 25H2, 2009) [1,411ms]
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [3.4s]
• Android SDK at C:\Users\pcira\AppData\Local\Android\sdk
• Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
• Platform android-36, build-tools 36.0.0
• Java binary at: C:\Program Files\java\jdk-17.0.12\bin\java
This JDK is specified in your Flutter configuration.
To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
• Java version Java(TM) SE Runtime Environment (build 17.0.12+8-LTS-286)
• All Android licenses accepted.
[√] Chrome - develop for the web [109ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.20) [106ms]
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.14.36705.20
• Windows 10 SDK version 10.0.26100.0
[√] Android Studio (version 2025.2.1) [9ms]
• Android Studio at C:\Program Files\Android\Android Studio
• 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 21.0.8+-14196175-b1038.72)
[√] VS Code (version 1.105.1) [6ms]
• VS Code at C:\Users\pcira\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.122.0
[√] Connected device (4 available) [637ms]
• Pixel 7 Pro (mobile) • 2B021FDH300DXJ • android-arm64 • Android 16 (API 36)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26200.7171]
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.136
• Edge (web) • edge • web-javascript • Microsoft Edge 142.0.3595.53
[√] Network resources [1,346ms]
• All expected network resources are available.
• No issues found!
Activity
DanTup commentedon Nov 12, 2025
@SenexTech when you get the message "The Dart Tooling Daemon connection has terminated" is there an "Open Log" button on the notification? If so, are you able to open it and see if there are any errors printed towards the end of the log?
(cc @bkonyi - from the description above it sounds like the app is also terminating - I don't know if DTD crashing is the cause of the app terminating, or if it might be the other way around?)
bkonyi commentedon Nov 12, 2025
It's hard to say without more information. I'm not sure how DTD could crash as the result of a application crashing or vice versa.
SenexTech commentedon Nov 12, 2025
Thanks for the quick response guys. There is a log button. I have copied the lower third below. I been through the whole log and see no errors. Also, when when the daemon exits or when I get the OS Error: The pipe is being closed error the app on the phone keeps on running with no issues. However, it loses connection to VS so I can't debug any more.
DanTup commentedon Nov 13, 2025
Thanks for the log - it doesn't seem like there's anything obvious in there, it seems like DTD just shut down.
I will try adding some more logging here so that we get things like the exit code when it terminates (I think we are already logging
stderrwhich makes me think there wasn't any stderr output in this case).Could you also confirm exactly where the "FileSystemException: writeFrom failed" error is showing up (perhaps a screenshot)? Is this in the Debug Console when the app/debug session terminates?
SenexTech commentedon Nov 13, 2025
Here are two screenshots. The first shows the daemon message and then a minute or two latter the second screenshot of the FileSystemException error. This was from a brand new project using VS Code (View/Command Pallete/Empty Application). Some more info that may help. Previously, I have tried resintalling Flutter (twice), reinstalled VS Code, Updated Android to Android Studio Otter | 2025.2.1. Here is the debug console output:
`I/ex.fishoncanada(16784): Background concurrent mark compact GC freed 10MB AllocSpace bytes, 122(8268KB) LOS objects, 75% free, 21MB/85MB, paused 610us,3.232ms total 104.550ms
D/FirebaseSessions(16784): App backgrounded on com.senex.fishoncanada
D/Camera2PresenceSrc(16784): System onCameraAccessPrioritiesChanged.
D/Camera2PresenceSrc(16784): System onCameraAccessPrioritiesChanged.
D/Camera2PresenceSrc(16784): [FetchData] Refreshed camera list: CameraIdentifier{cameraIds=0}, CameraIdentifier{cameraIds=1}
D/Camera2PresenceSrc(16784): [FetchData] Refreshed camera list: CameraIdentifier{cameraIds=0}, CameraIdentifier{cameraIds=1}
D/ImeBackDispatcher(16784): Clear (mImeCallbacks.size=0)
D/ImeBackDispatcher(16784): switch root view (mImeCallbacks.size=0)
I/FA (16784): Application backgrounded at: timestamp_millis: 1763041352054
I/ex.fishoncanada(16784): NativeAlloc concurrent mark compact GC freed 20MB AllocSpace bytes, 8(288KB) LOS objects, 75% free, 25MB/101MB, paused 511us,3.931ms total 118.453ms
Unhandled exception:
FileSystemException: writeFrom failed, path = '' (OS Error: The pipe is being closed.
, errno = 232)
#0 _RandomAccessFile.writeFromSync (dart:io/file_impl.dart:1027:7)
#1 _StdConsumer.addStream. (dart:io/stdio.dart:328:17)
#2 _rootRunUnary (dart:async/zone.dart:1546:13)
#3 _CustomZone.runUnary (dart:async/zone.dart:1429:19)
#4 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1329:7)
#5 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381:11)
#6 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312:7)
#7 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798:19)
#8 _StreamController._add (dart:async/stream_controller.dart:663:7)
#9 _StreamController.add (dart:async/stream_controller.dart:618:5)
#10 _StreamSinkImpl.add (dart:io/io_sink.dart:155:17)
#11 _IOSinkImpl.write (dart:io/io_sink.dart:293:5)
#12 _StdSink._write (dart:io/stdio.dart:429:13)
#13 _StdSink.write (dart:io/stdio.dart:438:33)
#14 Stdio._stdioWrite. (package:flutter_tools/src/base/io.dart:378:14)
#15 asyncGuard. (package:flutter_tools/src/base/async_guard.dart:108:32)
#16 _rootRun (dart:async/zone.dart:1525:13)
#17 _CustomZone.run (dart:async/zone.dart:1422:19)
#18 _runZoned (dart:async/zone.dart:2034:6)
#19 runZonedGuarded (dart:async/zone.dart:2020:12)
#20 asyncGuard (package:flutter_tools/src/base/async_guard.dart:106:3)
#21 Stdio._stdioWrite (package:flutter_tools/src/base/io.dart:376:5)
#22 Stdio.stdoutWrite (package:flutter_tools/src/base/io.dart:362:7)
#23 WindowsStdoutLogger.writeToStdOut (package:flutter_tools/src/base/logger.dart:741:12)
#24 StdoutLogger.printStatus (package:flutter_tools/src/base/logger.dart:537:5)
#25 DelegatingLogger.printStatus (package:flutter_tools/src/base/logger.dart:343:15)
#26 printStatus (package:flutter_tools/src/globals.dart:202:10)
#27 FlutterDevice.startEchoingDeviceLog. (package:flutter_tools/src/resident_runner.dart:391:17)
#28 _rootRunUnary (dart:async/zone.dart:1538:47)
#29 _CustomZone.runUnary (dart:async/zone.dart:1429:19)
#30 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1329:7)
#31 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381:11)
#32 _DelayedData.perform (dart:async/stream_impl.dart:573:14)
#33 _PendingEvents.handleNext (dart:async/stream_impl.dart:678:11)
#34 _PendingEvents.schedule. (dart:async/stream_impl.dart:649:7)
#35 _rootRun (dart:async/zone.dart:1517:47)
#36 _CustomZone.run (dart:async/zone.dart:1422:19)
#37 _CustomZone.runGuarded (dart:async/zone.dart:1321:7)
#38 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1362:23)
#39 _rootRun (dart:async/zone.dart:1525:13)
#40 _CustomZone.run (dart:async/zone.dart:1422:19)
#41 _CustomZone.runGuarded (dart:async/zone.dart:1321:7)
#42 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1362:23)
#43 _microtaskLoop (dart:async/schedule_microtask.dart:40:35)
#44 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#45 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:127:13)
#46 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:194:5)
Exited (255).
`
DanTup commentedon Nov 17, 2025
@bkonyi any thoughts on the exception above? It seems like the exception is occurring in the
fluttertool, but it also goes through someguardmethods that I assumed were to stop this kind of exception going unhandled.Seems like it might be happening while trying to echo the device logs to stdout:
Should we move this to flutter/flutter?
Seems a bit odd/suspicious that DTD is terminating at the same time.
bkonyi commentedon Nov 17, 2025
It looks like the tool is in the process of exiting when that exception is thrown, since the
stdoutpipe has been closed. I'd be interested in seeing what the--verboseoutput would be first to verify what's happening before this exception is being thrown.DanTup commentedon Nov 17, 2025
@SenexTech is it possible you could collect a verbose log and see what's recorded at the end?
Please reproduce this in a sample app and ensure there's nothing sensitive in the log before sharing.
Thanks!
SenexTech commentedon Nov 17, 2025
Here is the log as requested
logs.txt
DanTup commentedon Nov 17, 2025
@bkonyi doesn't seem like there's much in the verbose output. Filtering the log above to just the
flutter runprocess stdout/stderr ends with:There were a few
Flutter.Frameevents in between when viewing all of the log:Nothing else that seems interesting (to my eyes) though.
bkonyi commentedon Nov 17, 2025
The stack trace in these logs appears to be slightly different than the one reported before:
The VM service connection appears to be disappearing. This, combined with the fact that the
stdiopipes are closed tells me that something is killing the tool as the process'sstdiopipes are closed by the consumer, not the tool itself. I'm not sure what could be causing that.DanTup commentedon Nov 18, 2025
@SenexTech is it possible you could open the project and once everything has settled down run this in a terminal:
It will provide some details about the workspace and the child processes.
Then, reproduce the issue (allow both the debug session to terminate, and DTD to terminate - but do not press the button to reload anything), and then run
code --statusagain.I'd be interested in seeing the processes before/after. In your original DTD log, although the DTD connection closes, it doesn't seem like the process actually terminated (we usually record the exit code and/or signal when it does).
Thanks!
SenexTech commentedon Nov 18, 2025
I created 3 text files with the the ouput. The first is running Code --status a soon as the project is opened and before any crashes or exits. I then waited for the Daemon to crash and ran code --status again - 2nd file. Then I started project in debug and waited for phone to disconnect- 3rd file. Hopefully this is what you are looking for but if not please let me know and I will try ag
1-Initial project Start - no crash yet.txt
2-After Daemon crashes.txt
3-After Error and disconnect.txt
29 remaining items
DanTup commentedon Dec 1, 2025
Also FYI @jwren since this might also affect IntelliJ.
elliette commentedon Dec 1, 2025
SG! Thanks for investigating. As a side note, we were experiencing something similar with flutter/devtools#9028 but the root cause was different. Chrome was putting the DevTools frame to sleep which would then close the DTD websocket connection. We ended up adding an
isClosedmethod to the DTD API, but that was only because we couldn't keep pinging the websocket.DanTup commentedon Dec 1, 2025
@elliette ah, interesting - I hadn't considered that. I do also have another open issue about the sidebar inside VS Code losing its DTD connection which I wonder if might be the same issue as this one (and therefore having the ping enabled in DevTools and/or the DTD server might solve that) -> #5808. I've asked the OP to see if they use Norton.
Ping over the DTD WebSocket every 15s to avoid some proxies (like Nor…
Ping over the DTD WebSocket every 15s to avoid some proxies (like Nor…
DanTup commentedon Dec 2, 2025
@SenexTech @Wsemm @woopaddy I've have published new versions of the Dart extension today:
I've confirmed this resolves the issue with the DTD connection being dropped as first reported here. I'm also unable to reproduce the error with the debug session terminating with this fix (although I don't completely understand what was failing there, or how these would be related).
I can't be certain there aren't other issues with Norton installed, but we'll have to investigate them as they come up. I will apply this fix to some other places in the Dart tooling (such as the analysis servers connection to DTD) to ensure a similar problem does not occur elsewhere.
Thanks again for helping track this down!
[dtd] Enable web socket ping to avoid dropped idle connections
[dds/dap] Enable web socket ping for DAP connections to the VM Service
Abdelrahman-Hany commentedon Feb 24, 2026
I think the problem is related with spacific editor, as I was having Norton Antivirus and all was working well until I used Antigravity IDE.
The problem happened to me before and was solved by resetting my pc then it appeared again when I used Antigravity, even though I was having Norton before, and it didn't appear