Assert seems to not work during configure #1919
-
In my code, I had the following assert failing:
It is caused because I changed the number of ports for the rate group but I didn't increase the context. But that's not the point of my question. The assert is verified by the executable continues to run. After a while I made another assert failing and in that case the code stop running with a segmentation fault as expected. Is it by design that the asserts in the configure will not make the executable stop or it is a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The design for the assert logic is that a project will decide how to respond the asserts in a way that makes sense for them. Some projects wish to do a seg fault, some wish to suspend the offending task so it can be examined, and some wish to do a hardware reset. For that reason, we designed assert to follow an assert hook registration pattern: https://nasa.github.io/fprime/UsersGuide/dev/assert.html A common pattern is to use The |
Beta Was this translation helpful? Give feedback.
-
You may be running into an issue that was fixed in this PR: #1865. Before this fix, assertion failures would not cause a halt if they occurred before the assertion ports were hooked up. |
Beta Was this translation helpful? Give feedback.
You may be running into an issue that was fixed in this PR: #1865. Before this fix, assertion failures would not cause a halt if they occurred before the assertion ports were hooked up.