[PATCH] cpukit: Prevent error with disabled stack checker

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jan 27 07:20:19 UTC 2022


On 26/01/2022 23:07, Kinsey Moore wrote:
> diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
> index a2b63345d9..9119f8d940 100644
> --- a/cpukit/libmisc/stackchk/check.c
> +++ b/cpukit/libmisc/stackchk/check.c
> @@ -487,6 +487,12 @@ void rtems_stack_checker_report_usage_with_plugin(
>     uint32_t cpu_max;
>     uint32_t cpu_index;
>   
> +  /* Make sure that the stack checker is enabled */
> +  if ( Stack_check_Interrupt_stack[ 0 ].area == NULL ) {
> +    rtems_printf(printer, "RTEMS Stack Checker not enabled\n");
> +    return;
> +  }
> +
>     rtems_printf(
>        printer,
>        "                             STACK USAGE BY THREAD\n"

This check is insufficient in SMP configurations. It also prevents a 
stack report without the stack usage information.

I would move the check to Stack_check_Dump_stack_usage(). Simply report 
nothing if stack == NULL.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at 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/


More information about the devel mailing list