Skip to content

[tool_crash] Unhandled ProcessPackageException in DefaultResidentCompiler._compile when dartaotruntime is missing #193518

Description

@bkonyi

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

Activity

  1. added
    c: crash
    found in release: 3.47
    P1
    t: top-crasher
    team-tool
    tool
    triaged-tool
    on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1c: crashfound in release: 3.47t: top-crasherteam-tooltooltriaged-tool

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions