Repository navigation
Description
Summary
In Flutter 3.47.5 (7 days post-release), ProcessPackageException at LocalProcessManager.start (package:process/src/interface/local_process_manager.dart-a1bacf0f) is the #9 tool crasher, accounting for 61 crashes (4.0% of Top 10 crashes, 2.0% of all crashes).
Stack Trace & Error Message
ProcessPackageException: ProcessException: Failed to find "/Users/.../flutter/bin/cache/dart-sdk/bin/dartaotruntime" in the search path.
Command: /Users/.../flutter/bin/cache/dart-sdk/bin/dartaotruntime
#0 LocalProcessManager.start (package:process/src/interface/local_process_manager.dart:56)
#1 ErrorHandlingProcessManager.start.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:1284)
#2 _run (package:flutter_tools/src/base/error_handling_io.dart:1052)
#3 ErrorHandlingProcessManager.start (package:flutter_tools/src/base/error_handling_io.dart:1282)
#4 DefaultResidentCompiler._compile (package:flutter_tools/src/compile.dart:1000)
#5 DefaultResidentCompiler._recompile (package:flutter_tools/src/compile.dart:877)
#6 _RecompileRequest._run (package:flutter_tools/src/compile.dart:451)
#7 _CompilationRequest.run (package:flutter_tools/src/compile.dart:424)
#8 DefaultResidentCompiler._handleCompilationRequest (package:flutter_tools/src/compile.dart:928)
Root Cause Analysis
In DefaultResidentCompiler._compile (packages/flutter_tools/lib/src/compile.dart:997), _processManager.start(command) spawns dartaotruntime with frontend_server_aot.dart.snapshot. If the user's Flutter SDK bin/cache directory is corrupted, partially downloaded, or cleaned while a resident session or compilation request is running (or quarantined by antivirus), LocalProcessManager.start throws ProcessPackageException (ProcessException: Failed to find ".../dartaotruntime" in the search path), which is not caught or converted to a ToolExit by ErrorHandlingProcessManager or DefaultResidentCompiler._compile.
Expected Behavior
DefaultResidentCompiler._compile (or ErrorHandlingProcessManager) should catch ProcessException when spawning the Dart AOT runtime / frontend server and exit cleanly with a ToolExit instructing the user to check their Flutter SDK cache (e.g., run flutter doctor or rm -rf <flutter>/bin/cache).
Related Issues & PRs
- Related Windows Application Control
dartaotruntimeissue: [flutter_tools] Unhandled ProcessException when Windows Application Control blocks dartaotruntime.exe #191899 - Prior closed/locked user reports: [tool_crash] ProcessException: Failed to find "/opt/homebrew/share/flutter/bin/cache/dart-sdk/bin/dartaotruntime" in the search path. Command: /opt/homebrew/share/flutter/bin/cache/dart-sdk/bin/dartaotruntime, OS error code: 0 #193018, [tool_crash] ProcessException: Failed to find "/opt/homebrew/share/flutter/bin/cache/dart-sdk/bin/dartaotruntime" in the search path. Command: /opt/homebrew/share/flutter/bin/cache/dart-sdk/bin/dartaotruntime, OS error code: 0 #190553, [tool_crash] ProcessException: Failed to find "/Users/durjoyacharjya/develop/flutter/bin/cache/dart-sdk/bin/dartaotruntime" in the search path. Command: /Users/durjoyacharjya/develop/flutter/bin/cache/dart-sdk/bin/dartaotruntime, OS error code: 0 #189771, [tool_crash] ProcessException: Failed to find "C:\Users\sky\AppData\Local\flutter\bin\cache\dart-sdk\bin\dartaotruntime.exe" in the search path. Command: C:\Users\sky\AppData\Local\flutter\bin\cache\dart-sdk\bin\dartaotruntime.exe, OS error code: 0 #187976
Activity
Check that dartaotruntime can run before starting the resident fronte…
[flutter_tools] Check that dartaotruntime can run before starting the…