nasa / cFE

The Core Flight System (cFS) Core Flight Executive (cFE)
Apache License 2.0
402 stars 198 forks source link

cfe_es_start: fix CFE_ES_MainTaskSyncDelay() parameter #2562

Open Nodraak opened 1 month ago

Nodraak commented 1 month ago

CFE_ES_MainTaskSyncDelay() expects a TimeOutMilliseconds parameter.

Checklist (Please check before submitting)

Describe the contribution A clear and concise description of what the contribution is.

Testing performed Steps taken to test the contribution:

  1. Build steps '...'
  2. Execution steps '...'

Expected behavior changes A clear and concise description of how this contribution will change behavior and level of impact.

System(s) tested on

Additional context Add any other context about the contribution here.

Third party code If included, identify any third party code and provide text file of license

Contributor Info - All information REQUIRED for consideration of pull request Full name and company/organization/center of all contributors ("Personal" if individual work)

Nodraak commented 1 month ago

Hi,

This change is pretty self explanatory, so I will not explain it too much, but here is how I found it:

I was debugging some issue in my FSW unrelated to cFS (which turned out to be a pointer issue when calling memset()) and suspected a stack overflow. After increasing the cFS app stack from 8 KB to 15 KB, I tried to add -fsanitize=address -fno-omit-frame-pointer to my compilation options and noticed the SW being stuck. GDB quickly pointed me to this line and I noticed the very high timeout (30 000 000 msec = 8 hours). I assume that the cause is that the Address sanitizer breaks the initialization of a cFS app (?), which makes this call block until the timeout expires. At this point, I had noticed and fixed my memset() mistake, so I did not investigated further.

All of the above was compiled and run on Ubuntu 22.04.4 LTS using gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0. The latest upstream commit before we forked cFS is the following one:

commit 192f2ea3061bfe722b8ed1d72b7adecbf36d4f6e
Merge: c23e8dd d3cfb84
Author: dzbaker <dylan.z.baker@nasa.gov>
Date:   Thu Mar 30 17:05:11 2023 -0400

    Merge pull request #664 from nasa/integration-candidate

    IC: Caelum-rc4+dev44

Note: I quickly grep'ed for all CFE_ES_MainTaskSyncDelay() and did not find the same issue elsewhere.

dzbaker commented 1 month ago

CCB 16 May 2024: Approved pending creation of issue.

dzbaker commented 1 month ago

Hi @Nodraak. Thanks for the contribution! Would you be able to fill out a CLA (Contributor License Agreement) and email it to GSFC-SoftwareRelease@mail.nasa.gov and copy cfs-program@lists.nasa.gov?

dzbaker commented 1 week ago

Hi @Nodraak. Thank you again for your contribution! I haven't seen a CLA yet; would you be able to fill one out? Let me know if you have any questions.