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

Fix defaul stack configuration #273

Merged
merged 2 commits into from
Mar 4, 2025
Merged

Conversation

al1img
Copy link
Collaborator

@al1img al1img commented Feb 24, 2025

No description provided.

We should reset mLaunchInProgress in case of error, otherwise threads depending
on this flag will block forever.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.

Project coverage is 83.58%. Comparing base (ae4bf57) to head (920ff69).
Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
src/sm/launcher/launcher.cpp 0.00% 6 Missing ⚠️
include/aos/common/tools/thread.hpp 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #273      +/-   ##
===========================================
- Coverage    83.65%   83.58%   -0.08%     
===========================================
  Files          157      157              
  Lines        13990    13971      -19     
  Branches      1738     1735       -3     
===========================================
- Hits         11704    11677      -27     
- Misses        2286     2294       +8     

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

@@ -61,7 +61,7 @@ class Thread : private NonCopyable {
*/
~Thread()
{
#if AOS_CONFIG_THREAD_STACK_GUARD_SIZE != 0
#if AOS_CONFIG_THREAD_STACK_GUARD_SIZE != 0 && AOS_CONFIG_THREAD_STACK_USAGE
Copy link
Member

Choose a reason for hiding this comment

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

please disable include of #include <sys/mman.h> as well

Currently, we define and configure stack by default. It is not convenient as
each platform has own minimal stack size that may differ from our stack size.
Change stack configuration default behaviour as following:

* use auto stack configuration by default:
  (AOS_CONFIG_THREAD_DEFAULT_STACK_SIZE=0). Do not define or manually configure
  thread stack;
* disable stack usage API by default: (AOS_CONFIG_THREAD_STACK_USAGE=0).
  Enabling this option requires manual stack size alignment and configuration.
  AOS_CONFIG_THREAD_DEFAULT_STACK_SIZE and AOS_CONFIG_THREAD_STACK_ALIGN should
  be define. This option defines stack as static buffer with specified size
  and alignment and used pthread_attr_setstack API to set thread stack. In all
  other cases, dedicated pthread API used to configure stack
  (pthread_attr_setstacksize, pthread_attr_setguardsize).

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
@al1img al1img force-pushed the fix_defaul_stack branch from 1a3e131 to 920ff69 Compare March 4, 2025 11:36
Copy link

sonarqubecloud bot commented Mar 4, 2025

@al1img al1img merged commit 9190d05 into aosedge:develop Mar 4, 2025
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants