Skip to content
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

Adds check to guard against rcv frame panic issue #1862

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

nand-nor
Copy link
Contributor

@nand-nor nand-nor commented Jul 26, 2024

Thank you for your contribution!

We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo xtask fmt-packages command to ensure that all changed code is formatted correctly.
  • My changes were added to the CHANGELOG.md in the proper section.
  • My changes are in accordance to the esp-rs API guidelines

Extra:

Pull Request Details 📖

Adds a length check to avoid out-of-bounds access panic in the RX_BUFFER slice during Event::RxDone event processing.

Description

I have seen a rare bug pop up a two times now after leaving multiple esp32c6 devices running openthread (via the esp-openthread crate) for long periods of time :

WARN - timer interrupt triggered at 73875446
INFO - trigger_tx_done


====================== PANIC ======================
panicked at /home/nerdlet/.cargo/git/checkouts/esp-hal-42ec44e8c6943228/1424f2a/esp-ieee802154/src/raw.rs:394:42:
range end index 138 out of range for slice of length 128

I view this PR addition as a temporary hold over. A more comprehensive fix is likely needed here or elsewhere (this crate, the esp-openthread crate, etc). Unfortunately I had no backtrace when the bug popped up the two times I saw it nor had anything else set up to assist in debugging. So need to work on reliable repro before digging in further. This bug only popped up twice over many days/hours of constant operation so will continue to monitor.

Testing

Applied the fix and confirmed it builds and runs as expected using the esp-openthread crate. Have also verified the ieee802154 example bins still run as well.

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - at least as a temporary band-aid until more details are known this is definitely better than a panic

Copy link
Contributor

@JurajSadel JurajSadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JurajSadel JurajSadel added this pull request to the merge queue Jul 29, 2024
Merged via the queue into esp-rs:main with commit 36ed7bd Jul 29, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants