- Specify Temporally Exclusive Tasks: You can artificially specify that all tasks accessing the global shared variable are temporally exclusive. This means treating them as if they do not run concurrently, even if they might during actual execution. This approach will:
- Change the variable's flag from orange to green, indicating no unprotected access.
- Eliminate the need to review these specific checks.
- Ensure that other runtime checks remain unaffected.
code prover result analysis request // Global Variable – Shared - Potentially unprotected variable
6 次查看(过去 30 天)
显示 更早的评论
polyspace result analysis request
check result: Potentially unprotected variable
color: orange
check result detail
Global Variable – Shared - Potentially unprotected variable
Variable 'Appl_Rand.ApplRand_RandNo' is shared among several tasks. Some operations on variable 'Appl_Rand.ApplRand_RandNo' have no common protection.
Read by task: Os_Task_OsTask100ms Os_Task_OsTask10ms Os_Task_OsTask20ms Os_Task_OsTask5ms
Written by task: Os_Task_OsTask100ms Os_Task_OsTask10ms Os_Task_OsTask20ms Os_Task_OsTask5ms
check result count: 160 ea
question
1) what polyspace setting related this output?
2) any usecase for solving this kind of issue(not using semaphore or similiar method)
3) I am using Vector AUTOSAR, do you have experience with other customer?
0 个评论
回答(1 个)
Akshat Dalal
2024-10-26,9:51
The issue of "Potentially unprotected variable" arises in Polyspace Code Prover when analyzing multitasking programs. By default, Polyspace does not analyze concurrent tasks unless you enable it. For more details, refer to the Polyspace documentation on https://www.mathworks.com/help/codeprover/ug/analyze-multitasking-programs-in-polyspace.html
If you prefer not to use semaphores or similar synchronization mechanisms to address the unprotected access warnings, consider the following workaround:
For further information on how to specify temporally exclusive tasks, use cases and corner cases is available at the documentation page linked here:
Alternatively, if the requirement is to filter out the results for this check from the report, this could be done by using the documentation page linked here:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Code Prover Analysis of AUTOSAR Code 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!