App loading improvements and more - #675
Conversation
+ enlarge default shared font size slightly + use shared icon font for help button in AppList
📝 WalkthroughWalkthroughThe changes add app-scoped resource cleanup and app-relative path resolution, with ESP32 and POSIX wrappers for resource tracking and filesystem operations. ELF checks use accepted-type masks and provide ELF-magic detection for shell dispatch. Shared icon fonts gain default and large variants. Toolbar styling and monochrome terminal rendering change. The changes also update simulator task hooks, GPS settings widget teardown, C symbols, and tests for cleanup, paths, and ELF behavior. Priority: ⬇️ Low Merge Risk: 🟠 High · up to App cleanup can cause crashes, invalid execution, or resource corruption on ESP32 and POSIX when app tasks outlive shutdown. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Automatic cleanup can release memory and files while app threads remain active. Resources released from another execution context can also remain registered for a second release. These failures can affect the surrounding runtime, although they require an executing native app that opts into cleanup; no new remote access or privilege grant was established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
46a7c6d8-e20a-4ee0-aa41-2b38d2fdf758
📒 Files selected for processing (53)
CMakeLists.txtDocumentation/ideas.mdModules/app-esp32-module/source/app_esp32_loader_service.cppModules/app-esp32-module/source/app_symbols.cppModules/app-esp32-module/source/path_wrap.cppModules/app-esp32-module/source/root_dir.cppModules/app-module/include/app/elf_check.hModules/app-module/include/app/libc.hModules/app-module/include/app/manifest.hModules/app-module/include/app/resources.hModules/app-module/private/app/private/resources.hModules/app-module/private/app/private/scheduler.hModules/app-module/source/elf_check.cppModules/app-module/source/libc.cppModules/app-module/source/package_manifest_parsing_v3.cppModules/app-module/source/resources.cppModules/app-module/source/scheduler.cppModules/app-module/tests/source/elf_check_test.cppModules/app-module/tests/source/package_manifest_test.cppModules/app-module/tests/source/resources_test.cppModules/app-posix-module/private/app_posix/malloc_wrap.hModules/app-posix-module/private/app_posix/stdio_wrap.hModules/app-posix-module/private/app_posix/task_wrap.hModules/app-posix-module/source/app_posix_loader_service.cppModules/app-posix-module/source/malloc_wrap.cppModules/app-posix-module/source/stdio_wrap.cppModules/app-posix-module/source/stdio_wrap_apple.cppModules/app-posix-module/source/stdio_wrap_elf.cppModules/app-posix-module/source/task_wrap.cppModules/app-posix-module/tests/CMakeLists.txtModules/app-posix-module/tests/fixtures/leak_fixture.cppModules/app-posix-module/tests/source/cleanup_test.cppModules/app-posix-module/tests/source/libc_test.cppModules/c-symbols-module/source/module.cppModules/lvgl-module/include/lvgl/fonts.hModules/lvgl-module/source/fonts.cModules/lvgl-module/source/symbols.cModules/lvgl-module/source/widgets/toolbar.cppPlatforms/platform-esp32/source/mkdir.cppPlatforms/platform-esp32/source/vfs_null_path.cppPlatforms/platform-posix/freertos/freertos_task_hooks.cPlatforms/platform-posix/freertos/freertos_task_hooks.hTactility/Private/Tactility/app/terminal/TerminalRenderer.hTactility/Source/app/AppGrid.cppTactility/Source/app/applist/AppList.cppTactility/Source/app/apppackagelist/AppPackageList.cppTactility/Source/app/shell/Shell.cppTactility/Source/app/shell/main.cppTactility/Source/app/terminal/TerminalRenderer.cppTactility/Source/app/timezone/TimeZone.cppTactility/Source/lvgl/FontSizes.cppTactility/Source/lvgl/Fonts.cppTactility/Tests/Source/FontsTest.cpp
💤 Files with no reviewable changes (2)
- Platforms/platform-esp32/source/mkdir.cpp
- Platforms/platform-esp32/source/vfs_null_path.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Gate the trampoline until its FreeRTOS handle is registered. · app_symbols.cpp:400-425
Modules/app-esp32-module/source/app_symbols.cpp:400-425
🩺 Stability & Availability | 🟠 Major | ⚡ Quick winGate the trampoline until its FreeRTOS handle is registered.
thread_trampoline()callsapp_resources_enter_task()before inserting its handle intothread_tasks. If it is preempted after admission, cleanup can miss the mapping indelete_thread(), clear the task record, and unload the app binary. When the trampoline resumes, it can callcopy.functionfrom the unloaded app. Add a start gate socreate_thread()publishes the mapping before the trampoline can enter the app.
🟠 Major · Keep a task tracked until cross-core deletion completes. · app_symbols.cpp:365-368
Modules/app-esp32-module/source/app_symbols.cpp:365-368
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftKeep a task tracked until cross-core deletion completes.
app_vTaskDeleteremoves the target fromTracker::tasksbefore callingvTaskDelete. An app can create a task and delete it from its main task through the exported APIs. On dual-core ESP-IDF, deleting a task running on the other core only triggers a yield there. The target can still execute app code while the caller continues.app_resources_release_tasksthen does not wait for that target, and cleanup can unload the app and release its resources while the target is still using them.Add a completion or join mechanism for cross-task deletion. Remove the tracker entry only after the target can no longer execute. Do not fix this only by moving
app_resources_untrack_taskafter the rawvTaskDeletecall, because that call does not provide the required cross-core completion guarantee.
🟠 Major · Do not unload the app while a tracked pthread may still be running. · task_wrap.cpp:162-181
Modules/app-posix-module/source/task_wrap.cpp:162-181
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftDo not unload the app while a tracked pthread may still be running.
When an app-created pthread runs code without deferred-cancellation points,
thread_delete()only requests cancellation.thread_join()can time out after 500 ms and discardsETIMEDOUT.app_resources_release_tasks()then returns, sofinish_app_task()can unload the app while the pthread still executes its code.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9947bf9e-785d-4f94-b474-729d4d581345
📒 Files selected for processing (1)
Tactility/Source/app/gpssettings/GpsSettings.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
.and..normalized.