WindhoverLabs / airliner

7 stars 3 forks source link

CF app core dumped after executing DequeueNode Command(CF_DELETE_QUEUE_NODE_CC) #321

Open ynielson opened 1 year ago

ynielson commented 1 year ago

CF app core dumped after it executed the DequeueNode Command(CF_DELETE_QUEUE_NODE_CC), if the commanded queue node was in the Pb Active Queue(CF_PB_ACTIVEQ). The app removed the requested queue node from the Pb Active Queue, but it didn't remove from the Cfdp engine machine list. This caused the core dump after that when the function, "cfdp_cycle_each_transaction", is called, which is the cyclic Wakeup routine.

This cyclic routine transfers all the transactions in the machine list to the destination. But the machine which was still remain after dequeued from the Active Queue, couldn't get the channel information from the Queue. Cfdp engine ignored the transaction but the App Indication function,CF_Indication(), used the NULL pointer, when it received "IND_MACHINE_DEALLOCATED".

Chan = CF_GetChanNumFromTransId(CF_PB_ACTIVEQ, TransInfo.trans.number); if(Chan != CF_ERROR) { QueueEntryPtr = CF_FindPbNodeByTransNum(...); } if(QueueEntryPtr->Preserve == CF_DELETE_FILE)

In this case the "Chan" was "CF_ERROR", and the "QueueEntryPtr" was NULL.(Which caused the core dump).

ynielson commented 1 year ago

This test case was changed for other purposes. So this test case(Test_CF_AppPipe_DeleteQueueNodeCmdPbActive) doesn't have core dump. But this ticket will cause core dump if this condition happen.