-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sim: do not exit simulator on up_assert (just let the task exit) #3205
Conversation
The is some brief overview here:
https://github.com/apache/incubator-nuttx/blob/master/boards/sim/sim/sim/README.txt#L152
The simulator blob, nuttx.rel, is created here:
https://github.com/apache/incubator-nuttx/blob/master/arch/sim/src/Makefile#L318
. It is created from the usual set of NuttX libraries, RELLIBS (plus
REQUIREDOBJS).
Here the symbols are renamed:
https://github.com/apache/incubator-nuttx/blob/master/arch/sim/src/Makefile#L319
The final executable with the host blob is created here:
https://github.com/apache/incubator-nuttx/blob/master/arch/sim/src/Makefile#L325
. This is based on the sources in HOSTSRCS.
…On 3/27/2021 3:46 PM, Matias N. wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In arch/sim/src/sim/up_head.c
<#3205 (comment)>:
> @@ -125,11 +125,6 @@ void up_assert(const char *filename, int line)
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(sim_getsp(), this_task(), filename, line);
#endif
-
- /* Exit the simulation */
-
- g_exitcode = EXIT_FAILURE;
- longjmp(g_simabort, 1);
}
I don't think I'm familiar with the sim enough to do those changes
correctly. I will take a look later.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3205 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFUG6XNQIJVD4VXBNIBRN3TFZG4ZANCNFSM4Z5HOXIQ>.
|
So, I think that up_assert needs to be moved from HOSTSRCS into a
libarch.a (and will a part of the sim blob). And a new host_abort()
needs to be created in up_head.S (in the host blob).
…On 3/27/2021 5:35 PM, Gregory Nutt wrote:
The is some brief overview here:
https://github.com/apache/incubator-nuttx/blob/master/boards/sim/sim/sim/README.txt#L152
The simulator blob, nuttx.rel, is created here:
https://github.com/apache/incubator-nuttx/blob/master/arch/sim/src/Makefile#L318
. It is created from the usual set of NuttX libraries, RELLIBS (plus
REQUIREDOBJS).
Here the symbols are renamed:
https://github.com/apache/incubator-nuttx/blob/master/arch/sim/src/Makefile#L319
The final executable with the host blob is created here:
https://github.com/apache/incubator-nuttx/blob/master/arch/sim/src/Makefile#L325
. This is based on the sources in HOSTSRCS.
On 3/27/2021 3:46 PM, Matias N. wrote:
>
> ***@***.**** commented on this pull request.
>
> ------------------------------------------------------------------------
>
> In arch/sim/src/sim/up_head.c
> <#3205 (comment)>:
>
> > @@ -125,11 +125,6 @@ void up_assert(const char *filename, int line)
> #ifdef CONFIG_BOARD_CRASHDUMP
> board_crashdump(sim_getsp(), this_task(), filename, line);
> #endif
> -
> - /* Exit the simulation */
> -
> - g_exitcode = EXIT_FAILURE;
> - longjmp(g_simabort, 1);
> }
>
> I don't think I'm familiar with the sim enough to do those changes
> correctly. I will take a look later.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#3205 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABFUG6XNQIJVD4VXBNIBRN3TFZG4ZANCNFSM4Z5HOXIQ>.
>
|
Thanks! That's definitely helpful. |
@patacongo can you review again? I simply used |
The only issue that I see is that board_power_off is only built if CONFIG_BOARDCTL_POWEROFF is enabled. I would expect CI to fail since CONFIG_BOARDCTL_POWEROFF is only enabled in about half of the sim configurations:
Perhaps you could prototype in up_internal.h and make it build unconditionally. |
Your prediction is correct. |
This fixes the problem that an assertion in sim build aborted NuttX even when the assertion was generated from userspace (in which case simpy the task needs to exit). This required moving the relevant code into the sim blob.
@patacongo do you think the patch is good now? |
Summary
up_assert
was exiting simulator which means that usingassert
from an application would never print the error and just exit the task (as it should).Impact
Fix assert() on sim
Testing
Custom config based on sim:nsh. I can see the assert message now and only the app exits