[PATCH] bsp: Remove fatal from exit(0). Add extended heap error output

Joel Sherrill joel at rtems.org
Wed Jul 21 22:45:02 UTC 2021


On Wed, Jul 21, 2021 at 2:04 AM Chris Johns <chrisj at rtems.org> wrote:
>
> On 21/7/21 3:37 pm, Sebastian Huber wrote:
> > Hello Chris,
> >
> > thanks, this is a nice improvement.
>
> It helps find the corruption with a watch point.
>
> > On 21/07/2021 07:17, chrisj at rtems.org wrote:
> >> --- a/bsps/shared/start/bspfatal-default.c
> >> +++ b/bsps/shared/start/bspfatal-default.c
> >> @@ -22,15 +22,24 @@ void bsp_fatal_extension(
> >>   {
> >>     #if BSP_VERBOSE_FATAL_EXTENSION
> >>       Thread_Control *executing;
> >> +    const char* TYPE = "*** FATAL ***\n";
> >> +    const char* type = "fatal";
> >> +
> >> +    if ( source == RTEMS_FATAL_SOURCE_EXIT ) {
> >> +      TYPE = "";
> >
> > It would be good to still have a unique pattern which starts the fatal extension
> > message.  The "***" is also used for the test begin/end marker. What about "***
> > SYSTEM TERMINATED ***"?
>
> I considered this but I was concerned about the difference not being clear.
> Maybe I overstepped. The patch gives us:
>
> exit source: 5 (RTEMS_FATAL_SOURCE_EXIT)
> exit code: 0 (0x00000000)
> RTEMS version: 6.0.0.87609bacd323eef1f3f4d6620ce42e7e5309ad10
> RTEMS tools: 10.3.1 20210409 (RTEMS 6, RSB
> 4e6dc6431435821a534da6307e72ecbd7e42b82a, Newlib 0c0f3df)
> executing thread ID: 0x08a010001
> executing thread name: UI1
>
> and with the banner text:
>
> *** EXIT ***
> exit source: 5 (RTEMS_FATAL_SOURCE_EXIT)
> exit code: 0 (0x00000000)
> RTEMS version: 6.0.0.87609bacd323eef1f3f4d6620ce42e7e5309ad10
> RTEMS tools: 10.3.1 20210409 (RTEMS 6, RSB
> 4e6dc6431435821a534da6307e72ecbd7e42b82a, Newlib 0c0f3df)
> executing thread ID: 0x08a010001
> executing thread name: UI1
>
> It is easy to bend any direction here so maybe we wait for Joel to comment
> before I make a v2 patch.

This still looks scary when it is a normal exit(0) which is a big
issue with the current output. If exit source == 5 and exit code == 0,
can those two lines be a friendly, feel good message instead of something
you have to understand to know it was a normal exit.

When you run a test, will we end up with something like this for a normal
exit?

*** END OF TEST ...
*** EXIT ***

And just "*** EXIT ***" when there is no END OF TEST message?

How about something as simple as NORMAL or ABNORMAL EXIT in your
new line? And if normal, drop the exit source and code lines.

I still have flashbacks to the first time I saw this output every time I
show someone a test running. It took me a few minutes to realize
it was OK. And it still often takes a second glance to say "all ok."
If it can be easier to see "good," that would be a user facing improvement IMO

--joel
>
> Chris
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list