WindhoverLabs / airliner

7 stars 3 forks source link

CF app has two long SrcPath/DstPath in polling directories(core dump) #302

Open ynielson opened 1 year ago

ynielson commented 1 year ago

CF App has two long SrcPath("/ram/downlink/ppd_to_gnd/class1/priority2/") in polling directories of out_channel in the config table, which can easily cause the unpredictable behavior. The max length for the filenames are 64(OS_MAX_PATH_LEN) bytes. In this test case, the error message should be "Filename in SendTransDataCmd must be terminated and have no spaces". But the result error message was "Unterminated string found in SendTransData Cmd, Trans parameter". The test filename was "($SrcPath)/This string has spaces", of which the length was 64 bytes.

ynielson commented 1 year ago

I updated this ticket from "Warning" to "Core dump". The config table has two long SrcPath and DstPath in the Output channel Polling directories, which are srcpath : "/ram/downlink/cpd_to_gnd/class1/priority2/" and dstpath: "/cf/downlink/cpd_to_gnd/class1/priority2/". This caused the core dump when sending Event Message after successful command execution. The Event Message was : CFE_EVS_SendEvent(CF_PLAYBACK_DIR_EID,CFE_EVS_DEBUG, "Playback Dir Cmd Rcvd,Ch %d,Cl %d,Pri %d,Pre %d,Peer %s, Src %s,Dst %s", PlaybackDirCmdPtr->Chan, PlaybackDirCmdPtr->Class, PlaybackDirCmdPtr->Priority, PlaybackDirCmdPtr->Preserve, PlaybackDirCmdPtr->PeerEntityId, PlaybackDirCmdPtr->SrcPath, PlaybackDirCmdPtr->DstPath);

, which was larger than the "CFE_EVS_MAX_MESSAGE_LENGTH". This caused the core dump.

I updated the srcpath and dstpath in the config_table for Unit test("CF_ConfigTableUnitTest"). Also all the path should start with '/'(absolute path), so that it should not start from the current directory, which can be very deep.