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

2021-07-21 Thread Chris Johns
On 22/7/21 8:45 am, Joel Sherrill wrote:
> On Wed, Jul 21, 2021 at 2:04 AM Chris Johns  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, chr...@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 (0x)
>> 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 (0x)
>> 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?

The end of test and the fatal message are no related so I am not sure how you
could do this. You only the values passed to the fatal error extension handler.

> 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

Yes it trips me up often as I search for the code to see if it is a real fatal
error and I also miss some real errors. How about:

RTEMS Shutdown
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 if `exit(1)` is called:

*** EXIT ERROR ***
exit code: 1 (0x0001)
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

?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


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

2021-07-21 Thread Joel Sherrill
On Wed, Jul 21, 2021 at 2:04 AM Chris Johns  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, chr...@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 (0x)
> 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 (0x)
> 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@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


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

2021-07-21 Thread Chris Johns
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, chr...@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 (0x)
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 (0x)
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.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

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

2021-07-20 Thread Sebastian Huber

Hello Chris,

thanks, this is a nice improvement.

On 21/07/2021 07:17, chr...@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 ***"?


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel