userspace assert?

2021-03-27 Thread Matias N.
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

Re: userspace assert?

2021-03-27 Thread Matias N.
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

Re: userspace assert?

2021-03-27 Thread Gregory Nutt
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)

Re: userspace assert?

2021-03-27 Thread Gregory Nutt
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

Re: userspace assert?

2021-03-27 Thread Matias N.
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

Re: userspace assert?

2021-03-27 Thread Gregory Nutt
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