Skip to content

ES application control functional test generates memory segmentation fault #2641

@dmolock-NASA

Description

@dmolock-NASA

Describe the bug

The ES application control functional test that verifies the CFE_ES_ReloadApp API using a null pointer for the filename generates a memory segmentation fault depending on the C99 implementation of the GLIBC library. When passing a null pointer for the filename in the CFE_ES_ReloadApp API eventually invokes vsnprintf with a null pointer, this behavior is undefined in C99 and depending on the GLIBC implementation will generate memory segmentation fault.

To Reproduce
Steps to reproduce the behavior:

  1. make ENABLE_UNIT_TESTS=true prep
  2. make
  3. make install
  4. Execute functional test on target.

Expected behavior

The ES application control functional test that verifies the CFE_ES_ReloadApp API should generate the CFE_ES_FILE_IO_ERR error code as expected when passed an invalid filename.

Code snips

The section of the functional test that's generating the fault:

UtAssert_UINT32_EQ(CFE_ES_ReloadApp(TestAppId, NULL), CFE_ES_FILE_IO_ERR);

The functional test should be modified to use an empty string instead of a null pointer such as:

UtAssert_UINT32_EQ(CFE_ES_ReloadApp(TestAppId, ""), CFE_ES_FILE_IO_ERR);

System observed on:

  • Hardware: Raspberry Pi 4
  • OS: [e.g. QNX 7.1]
  • Versions [e.g. cFE 6.6, OSAL 4.2, PSP 1.3 for generic-qnx, any related apps]

Additional context
N/A

Reporter Info
Dwaine Molock - NASA/GSFC

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions