Crash: ACCESS_VIOLATION c0000005 in `FlutterPlatformNodeDelegate::ChildAtIndex` during rapid UIA tree traversal
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 73/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- dart
- Lĩnh vực
- accessibility, desktop
Hướng nghiên cứu
Bắt đầu với flutter_platform_node_delegate.cc:90, nơi có báo cáo rằng FlutterPlatformNodeDelegate::ChildAtIndex giải tham chiếu kết quả của GetUnignoredChildAtIndex. Kiểm tra mã trợ năng Windows ở gần đó và các bài kiểm thử về hành vi tra cứu nút con cũng như ID nút không hợp lệ được mong đợi. Tái hiện lỗi bằng cách cập nhật ngữ nghĩa nhanh trong khi duyệt UI Automation; hoàn thành khi việc tra cứu nút con xử lý an toàn một nút con đã bị vô hiệu hóa và sự cố không còn xảy ra.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Steps to reproduce
- Run a Flutter Windows desktop application (release build on Windows 11 x64, 10.0.22621).
- Have active UI Automation (UIA) tree traversal or an accessibility tool / screen reader inspecting or walking the UIA tree.
- Rapidly trigger UI / semantics tree mutations (e.g., continuous slider adjustments or rapid layout rebuilds that mutate semantics nodes).
- As the accessibility client queries child nodes via UI Automation during continuous updates, the engine crashes with an access violation in FlutterPlatformNodeDelegate::ChildAtIndex.
Expected results
The engine should safely handle child queries during semantics tree mutations without crashing. If a child node is null or invalidated concurrently, it should return a safe fallback/error (e.g., ui::kInvalidAXNodeID) rather than dereferencing a nullptr.
Actual results
The application crashes with an ACCESS_VIOLATION c0000005:
- Crash Exception: ACCESS_VIOLATION c0000005 at flutter_windows!ui::AXNode::id inlined in flutter_windows!flutter::FlutterPlatformNodeDelegate::ChildAtIndex+0x3f
- Engine Location: flutter_platform_node_delegate.cc:90
- Environment: Flutter 3.44.4 (channel stable), Engine revision 700aebeca4c0e610f109a3979ee3e71b69d666bc, Windows 11 x64 (10.0.22621), release build
Root Cause
In flutter_platform_node_delegate.cc:90 (FlutterPlatformNodeDelegate::ChildAtIndex):
ui::AXNode* child = GetUnignoredChildAtIndex(index);
return child->id();
GetUnignoredChildAtIndex(index) returns nullptr during a UIA tree walk while semantics are actively mutating, resulting in an immediate null pointer dereference on ->id().
Suggested Engine Fix
Add a nullptr check before dereferencing id():
ui::AXNode* child = GetUnignoredChildAtIndex(index);
if (!child) {
return ui::kInvalidAXNodeID;
}
return child->id();
Application-Level Workarounds / Mitigations
- Wrapping rapidly updating widgets (e.g., continuous sliders) in ExcludeSemantics.
- Debouncing continuous slider adjustments / rapid state changes to mitigate frequent semantics mutations.
Code sample
Code sample
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(child: SliderCrashRepro()),
),
);
}
}
class SliderCrashRepro extends StatefulWidget {
const SliderCrashRepro({super.key});
@override
State<SliderCrashRepro> createState() => _SliderCrashReproState();
}
class _SliderCrashReproState extends State<SliderCrashRepro> {
double _value = 0.0;
@override
Widget build(BuildContext context) {
// When UIA tree is actively traversed by Windows accessibility services,
// rapid continuous updates to this slider without ExcludeSemantics triggers the crash.
return Slider(
value: _value,
min: 0.0,
max: 100.0,
onChanged: (val) {
setState(() {
_value = val;
});
},
);
}
}
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
Exception: ACCESS_VIOLATION (0xc0000005) reading address 0x0000000000000000
Fault Module: flutter_windows.dll
Location: flutter_platform_node_delegate.cc:90
Stack trace:
00 flutter_windows!ui::AXNode::id (inlined in flutter_windows!flutter::FlutterPlatformNodeDelegate::ChildAtIndex+0x3f) [flutter\shell\platform\windows\flutter_platform_node_delegate.cc:90]
01 flutter_windows!flutter::FlutterPlatformNodeDelegate::ChildAtIndex+0x3f
02 flutter_windows!ui::AXPlatformNodeWin::GetChildAtIndex+0x...
03 UIAutomationCore!UiaNodeFromProvider+0x...
... Windows UI Automation provider tree walk ...
Flutter Doctor output
Doctor output
[√] Flutter (Channel stable, 3.44.4, on Microsoft Windows [Version 10.0.22621.4317], locale en-US)
• Flutter version 3.44.4 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ...
• Engine revision 700aebeca4c0e610f109a3979ee3e71b69d666bc
• Dart version 3.4.4
• DevTools version 2.34.3
[√] Windows Version (Installed version of Windows is Windows 11 [10.0.22621])
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Windows 10/11 SDK version 10.0.22621.0
[√] Connected device (1 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621]
• No issues found!
- Ngôn ngữ chính
- Dart
- Star
- 181k
- Fork
- 33.3k
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 267
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của flutter/flutter
-
a: accessibility has reproducible steps p: cupertino_ui package team-design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
a: accessibility p: cupertino_ui package team-design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
flutter/flutter#195514 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SweepGradient.lerp clamps valid negative angles during interpolationCó thể đã có người làm @Shubham-Padkonde đã nhận 1 ngày trước. Đang mởa: animation c: rendering framework team-framework
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
flutter/flutter#195470 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fyi-ecosystem has reproducible steps p: webview package platform-ios team-ios
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
flutter/flutter#195465 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
c: proposal team-tool tool
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
flutter/flutter#195412 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của flutter/flutter
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Tencent/tdesign-flutter#1229 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
berkmancenter/frankly#732 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
rodydavis/signals.dart#510 ·
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
pentakoron1/brazier#33 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
LonelyGriffin/noetec#51 ·