Repository navigation
Commit adb7760
authored
[flutter_tools] Gracefully handle Windows Application Control and security policy execution blocks (flutter#191912)
When Windows Smart App Control (SAC), Windows Defender Application
Control (WDAC), or Group Policy blocks execution of Flutter binaries
(such as `dartaotruntime.exe` during frontend_server compilation),
Dart's Win32 process runner raises a `ProcessException` with Win32 error
code 4551 (`ERROR_APPLICATION_CONTROL_POLICY_BLOCK`), 1260
(`ERROR_ACCESS_DISABLED_BY_POLICY`), or 454
(`ERROR_SYSTEM_INTEGRITY_POLICY_VIOLATION`).
Previously, `_handleWindowsException` did not recognize these error
codes and returned `null`, which resulted in an unhandled
`ProcessException` crash report (accounting for 354 crashes in Flutter
3.47.1).
This PR catches these security and application control policy error
codes in `_handleWindowsException` and surfaces a clean, actionable
`ToolExit` instructing users to check their Windows Security Smart App
Control, WDAC, or Group Policy settings and configure an exclusion for
the Flutter SDK directory.
Fixes flutter#1918991 parent 6ad2029 commit adb7760
2 files changed
Lines changed: 56 additions & 0 deletions
File tree
- packages/flutter_tools
- lib/src/base
- test/general.shard/base
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1450 | 1450 | | |
1451 | 1451 | | |
1452 | 1452 | | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1453 | 1456 | | |
1454 | 1457 | | |
1455 | 1458 | | |
| |||
1478 | 1481 | | |
1479 | 1482 | | |
1480 | 1483 | | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
1481 | 1491 | | |
1482 | 1492 | | |
1483 | 1493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
986 | 986 | | |
987 | 987 | | |
988 | 988 | | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
989 | 992 | | |
990 | 993 | | |
991 | 994 | | |
| |||
1180 | 1183 | | |
1181 | 1184 | | |
1182 | 1185 | | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1183 | 1229 | | |
1184 | 1230 | | |
1185 | 1231 | | |
| |||
0 commit comments