Skip to content

Conversation

@aggarg
Copy link
Member

@aggarg aggarg commented Jan 23, 2025

Description

Stack overflow check is not straight forward to implement for MPU ports because of the following reasons:

  1. The context is stored in TCB and as a result, pxTopOfStack member points to the context location in TCB.
  2. System calls are executed on a separate privileged only stack.

It is still okay because an MPU region is used to protect task stack which means task stack overflow will trigger an MPU fault.

Test Steps

Verified on Cortex-M33 hardware.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • [NA] I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

#1195

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Stack overflow check is not straight forward to implement for MPU ports
because of the following reasons:
1. The context is stroed in TCB and as a result, pxTopOfStack member
   points to the context location in TCB.
2. System calls are executed on a separate privileged only stack.

It is still okay because an MPU region is used to protect task stack
which means task stack overflow will trigger an MPU fault.

Signed-off-by: Gaurav Aggarwal <[email protected]>
@aggarg aggarg requested a review from a team as a code owner January 23, 2025 15:53
kar-rahul-aws
kar-rahul-aws previously approved these changes Jan 31, 2025
tony-josi-aws
tony-josi-aws previously approved these changes Jan 31, 2025
@codecov
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.65%. Comparing base (31dd1e3) to head (19661e5).
Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1231      +/-   ##
==========================================
+ Coverage   91.64%   91.65%   +0.01%     
==========================================
  Files           6        6              
  Lines        3254     3259       +5     
  Branches      903      901       -2     
==========================================
+ Hits         2982     2987       +5     
  Misses        132      132              
  Partials      140      140              
Flag Coverage Δ
unittests 91.65% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Gaurav Aggarwal <[email protected]>
@aggarg aggarg dismissed stale reviews from tony-josi-aws and kar-rahul-aws via 2feb8bd February 24, 2025 15:57
@sonarqubecloud
Copy link

@aggarg aggarg merged commit df0aa5a into FreeRTOS:main Feb 24, 2025
17 checks passed
@aggarg aggarg deleted the stack_overflow_check branch February 24, 2025 16:24
moninom1 pushed a commit to moninom1/FreeRTOS-Kernel that referenced this pull request Sep 30, 2025
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.

4 participants