nasa / MD

The Core Flight System (cFS) Memory Dwell (MD) application.
Apache License 2.0
25 stars 18 forks source link

Dwell Table instantiated on stack, but not used #59

Closed jphickey closed 11 months ago

jphickey commented 11 months ago

Checklist (Please check before submitting)

Describe the bug During init, the MD app instantiates a dwell table on the stack, and memset's it to 0:

https://github.com/nasa/MD/blob/b0ae64d9043b8a3ffdc0c332595ca94548bd1cfd/fsw/src/md_app.c#L331

However this is not anywhere for any purpose. It may be a remnant that was never cleaned up.

As a result, its using several kB of stack space unnecessarily.

Expected behavior Should not allocate objects that are not necessary.

System observed on: Debian

Additional context This was discovered by analyzing the stack usage and finding that MD sometimes overran its allocated stack. Although there were other issues as well (see nasa/osal#1429) ... it was noted that this unneeded object was a significant contributor for why the problem showed up in MD and not other apps.

Reporter Info Joseph Hickey, Vantage Systems, Inc.