threadx icon indicating copy to clipboard operation
threadx copied to clipboard

txm_module_manager_absolute_load create wrong data start pointer

Open amgross opened this issue 7 months ago • 4 comments

Describe the bug In _txm_module_manager_absolute_load There is: https://github.com/eclipse-threadx/threadx/blob/7ad78c40e9702917264a9b722890110fdb909ebc/common_modules/module_manager/src/txm_module_manager_absolute_load.c#L314 This causes the txm_module_instance_data_start to be defined as size of struct + size of code, which not make sense to me, as it not address (and this variable should be address, as it used for things like MPU and checking if things located in memory area).

Expected behavior txm_module_instance_data_start should contain the module data memory pointer

Impact In edge cases like usage of MPU or objects that located in this memory things may fail

amgross avatar May 14 '25 08:05 amgross

Thank you for the bug report @amgross. We will discuss it.

fdesbiens avatar May 20 '25 14:05 fdesbiens

I would just want to add about my MPU point, that probably (although not checked) the current MPU code won't work in current absolute load. This is because in different than the other loads here the main data is separated from the start stop+callback threads stack (main data is in absolute place and stacks allocated on byte pool in runtime). I would consider make it similar to all other loads and but the stacks in the beginning of the (absolute located) main data

amgross avatar May 21 '25 11:05 amgross

@eclipse-threadx/iot-threadx-committers and @eclipse-threadx/iot-threadx-contributors: Please provide your feedback.

fdesbiens avatar Jun 02 '25 19:06 fdesbiens

These both appear to be valid points; we will investigate them further.

billlamiework avatar Oct 07 '25 15:10 billlamiework