Potential thread stack overflow in SystemTask::Process
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- cmake, cpp
- Lĩnh vực
- embedded-iot, operating-systems
Hướng nghiên cứu
Bắt đầu với src/systemtask/SystemTask.cpp tại vị trí SystemTask::Process được liên kết và các tùy chọn sử dụng stack trong CMakeLists.txt. Build bằng make pinetime-app, kiểm tra các tệp .su được tạo ra và lần theo đường dẫn gọi Process đến littlefs được báo cáo. Hoàn tất có nghĩa là xác định liệu đường dẫn 1432 byte có vượt quá stack của thread hay không, đồng thời xử lý hoặc ghi lại kết quả.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Issue details
While some detailed build configuration, There are potential stack overflow in thread function named SystemTask::Process
In this line, SystemTask::Process Allows 1400(350*4) stack size.
However, after checking the stack using our internally developed tool, it might have 1432 Bytes in with some detailed configurations.
Steps to produce
1. In CMakeLists.txt , Add this line:
add_compile_options(
$<$<COMPILE_LANGUAGE:C>:-fstack-usage>
$<$<COMPILE_LANGUAGE:CXX>:-fstack-usage>
)
This will help you automatically calculating stack size of each function.
2. Build InfiniTime normally, using this configurations:
make pinetime-app
Now we can get stack usage file (*.su) for each source file, So we can manually check stack size of each function.
In case of SystemTask::Process :
There are large call stack with this flow:
Pinetime::System::SystemTask::Process (_ZN8Pinetime6System10SystemTask7ProcessEPv) => 8 bytes
Pinetime::System::SystemTask::Work (_ZN8Pinetime6System10SystemTask4WorkEv) => 64 bytes
Pinetime::Controllers::NimbleController::Init(_ZN8Pinetime11Controllers16NimbleController4InitEv) => 24 bytes
Pinetime::Controllers::NimbleController::RestoreBond(_ZN8Pinetime11Controllers16NimbleController11RestoreBondEv) => 272 bytes
Pinetime::Controllers::FS::FileDelete(_ZN8Pinetime11Controllers2FS10FileDeleteEPKc) => 0 bytes
lfs_remove(lfs_remove) => 120 bytes
lfs_fs_forceconsistency(lfs_fs_forceconsistency) => 144 bytes
lfs_dir_drop(lfs_dir_drop) => 24 bytes
lfs_dir_commit(lfs_dir_commit) => 168 bytes
lfs_dir_compact(lfs_dir_compact) => 160 bytes
lfs_dir_split(lfs_dir_split) => 88 bytes
lfs_dir_alloc(lfs_dir_alloc) => 32 bytes
lfs_alloc(lfs_alloc) => 24 bytes
lfs_fs_rawtraverse(lfs_fs_rawtraverse) => 104 bytes
lfs_dir_fetch(lfs_dir_fetch) => 24 bytes
lfs_dir_fetchmatch(lfs_dir_fetchmatch) => 112 bytes
lfs_bd_read(lfs_bd_read) => 64 bytes
SUM => 1432 bytes
So, there are potentially occur stack overflow in SystemTask::Process Thread function.
Environment
Version
Commit https://github.com/InfiniTimeOrg/InfiniTime/commit/7128fc045db083c7014166872b50b536942c06e0
- Ngôn ngữ chính
- C
- Star
- 3.4k
- Fork
- 1.1k
- Merge trung bình
- 23 giờ 18 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không 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 InfiniTimeOrg/InfiniTime
-
BLE handlers use length fields from the packet without checking how much data arrivedCó thể đã có người làm @DustinHab đã nhận 41 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
InfiniTimeOrg/InfiniTime#2485 ·
-
Unexpected jump back to watch face when button pressedCó thể đã có người làm @SteveAmor đã nhận 84 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
InfiniTimeOrg/InfiniTime#2461 · 2 bình luận ·
-
Screen doesn't go to sleep after reset countdown appCó thể đã có người làm @SteveAmor đã nhận 82 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
InfiniTimeOrg/InfiniTime#2419 · 4 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
InfiniTimeOrg/InfiniTime#2410 ·
-
enhancement UI/UX
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
InfiniTimeOrg/InfiniTime#2405 · 2 bình luận · 1 reaction ·
Tất cả issue của InfiniTimeOrg/InfiniTime
Issue tương tự
-
[mimalloc] update to 3.6.0Đang mởcategory:port-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 2 ngày
-
emerge failure MARK mark-unstable media-kit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
macaroni-os/mark-issues#834 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 93/100
webarkit/WebARKitLib#107 ·
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 72/100
Maintainer thường phản hồi trong vòng 1 ngày