-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
I noticed that in internal bug b/155482533, the flutter tool crashed but did not print the expected instructions for reporting the crash. This occurs with the upstream tool too (and the behavior predates my recent change to move _informUserOfCrash).
Steps to reproduce:
- Apply a patch:
diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart
index 0f328b2bf..1bea679fa 100644
--- a/packages/flutter_tools/lib/src/resident_runner.dart
+++ b/packages/flutter_tools/lib/src/resident_runner.dart
@@ -1481,6 +1481,8 @@ class TerminalHandler {
case 'Z':
await residentRunner.debugToggleDebugCheckElevationsEnabled();
return true;
+ case '_':
+ throw Exception('Test exception');
}
return false;
}- Go to some Flutter project (I'm using a Linux environment with an Android project and emulator), run
flutter run, press_to force throwing an uncaught exception. (This is a simplification; you'll want to run thefluttertool from source.)
Result:
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
An Observatory debugger and profiler on Android SDK built for x86 is available
at: http://127.0.0.1:40521/J48yQjaVv0M=/
Exception: Test exception
#0 TerminalHandler._commonTerminalInputHandler
(package:flutter_tools/src/resident_runner.dart:1485:9)
#1 TerminalHandler.processTerminalInput
(package:flutter_tools/src/resident_runner.dart:1500:13)
#2 _rootRunUnary (dart:async/zone.dart:1192:38)
#3 _CustomZone.runUnary (dart:async/zone.dart:1085:19)
...
#46 _RawReceivePortImpl._handleMessage
(dart:isolate-patch/isolate_patch.dart:169:5)
Application finished.
Oops; flutter has exited unexpectedly: "Exception: Test exception".
The expected messages about generating a crash report and reporting an issue on GitHub are missing. The tool's exit code also is 0 instead of an expected non-zero.
I looked into this a bit, and it seems like the tool is going down the expected _handleToolError failure path. However, it seems like the process abruptly exits prematurely before _handleToolError finishes.
Metadata
Metadata
Assignees
Labels
toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.