-
Notifications
You must be signed in to change notification settings - Fork 7.7k
fix(ppp): Fix PPP.end() causing exception #11987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Hello me-no-dev, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 16m 44s ⏱️ Results for commit 87a8345. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a resource cleanup ordering issue in the PPP library's end() method and adds a new function to clear peripheral destructor callbacks. The key change is moving the esp_modem_destroy(_dce) call to occur earlier in the teardown sequence and introducing perimanClearBusDeinit() to temporarily disable bus deinit callbacks during cleanup.
- Modem destruction moved before pin cleanup to ensure proper resource release order
- New
perimanClearBusDeinit()function added to prevent recursiveend()calls during cleanup - Pin bus clearing now happens with disabled deinit callbacks, then callbacks are re-registered
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| libraries/PPP/src/PPP.cpp | Reordered modem destruction to occur earlier; added calls to clear/restore bus deinit callbacks around pin cleanup |
| cores/esp32/esp32-hal-periman.h | Added declaration for new perimanClearBusDeinit() function |
| cores/esp32/esp32-hal-periman.c | Implemented perimanClearBusDeinit() using an empty callback function to prevent callback execution |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request introduces improvements to the peripheral bus deinitialization process and enhances the cleanup logic in the PPP (Point-to-Point Protocol) library. The main focus is on providing a way to clear and reset bus deinit callbacks, ensuring proper resource management and preventing potential issues when the PPP connection is terminated.
Enhancements to peripheral bus deinit management:
perimanClearBusDeinitfunction and its declaration to allow clearing the deinit callback for a specific bus type, replacing it with a no-op function. This helps prevent unintended cleanup actions after the bus is no longer in use. [1] [2]PPP library cleanup improvements:
PPPClass::end()to callperimanClearBusDeinitfor all PPP-related bus types (PPP_TX,PPP_RX,PPP_RTS,PPP_CTS), ensuring that their deinit callbacks are reset during PPP shutdown._dcemodem object earlier in thePPPClass::end()cleanup process for better resource management.perimanSetBusDeinitwithPPPClass::pppDetachBus. This prepares the system for the next PPP session.Fixes: #11914