I was using assert in an app (testing on sim) and realized the sim exited upon
hitting the assert. From the code I see it calls into up_assert() (which would
also be a violation of OS/Userspace separation AFAIK).
What about writing a similar simple function that only sends the message to
syslog
Or maybe is sim's up_assert() wrong to exit simulation? Thinking about it,
doing up_assert() (which would just print the error) and exit() would indeed
exit the app only.
On Sat, Mar 27, 2021, at 16:30, Matias N. wrote:
> I was using assert in an app (testing on sim) and realized the sim exited
Isn't what you describe basically the same as Linux behavior. assert()
is like exit() and should cause the task to end, should it not?
Per OpenGroup:
https://pubs.opengroup.org/onlinepubs/009695399/functions/assert.html:
When it is executed, if /expression/ (which shall have a *scalar* type)
Or maybe is sim's up_assert() wrong to exit simulation? Thinking about it,
doing up_assert() (which would just print the error) and exit() would indeed
exit the app only.
What do you mean by exit the simulation. It should exit the task that
caused the assertion but the simulation should co
Yes, it seems that is the issue.
I will make a PR to remove those lines (I tried removing them and works as
expected).
Best,
Matias
On Sat, Mar 27, 2021, at 16:44, Gregory Nutt wrote:
>
> > Or maybe is sim's up_assert() wrong to exit simulation? Thinking about it,
> > doing up_assert() (which
Yes, it seems that is the issue.
I will make a PR to remove those lines (I tried removing them and works as
expected).
It still should return to __assert() under the conditions where an
application assertion occurs. __assert will exit. The normal normal
conditions are not in an interrupt