eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.92k stars 797 forks source link

the posix_arrange_msg function crashes. #173

Closed boria8 closed 2 years ago

boria8 commented 2 years ago

it crashes when more than 1 message of the same priority present in the messageQ.

solution: To verify temp_q pointer is not null before Swap the messages: if(temp_q) { / Swap the messages. / for ( msg = 0; msg < 4; msg++) {

    swap = *temp_q;
    *temp_q = *Qread;
    *Qread = swap;
    temp_q++;
    Qread++;
}

}

goldscott commented 2 years ago

Do you have a test case for this? I am putting two and three messages of the same priority in the queue and not seeing any crash. EDIT: ah, I see now. When priority is 0. We will work on a fix.

goldscott commented 2 years ago

@boria8 - as of release 6.2.0, this issue has been fixed: https://github.com/azure-rtos/threadx/blob/master/utility/rtos_compatibility_layers/posix/px_mq_arrange_msg.c