Question about SMP tests after shutdown

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Nov 18 14:37:49 UTC 2022


Hello Alan,

On 16/11/2022 17:55, Alan Cudmore wrote:
> I  am running testsuite applications on a dual core RISC-V CPU. When I
> run samples such as ticker.exe, the test ends without error messages.
> On SMP tests, the tests seem to run correctly and end, but there is
> always a fatal error from thread(s) on the other CPU.
> (RTEMS_FATAL_SOURCE_SMP)
> My guess is that the threads are being scheduled after the primary
> test thread shut down the RTEMS executive, causing the error to be
> caught. Is this expected behavior on a SMP system?
> There are a couple of BSPs that implement a fatal error handler to
> catch this error, and I would expect that on a real application, it
> would be handled appropriately.

_Terminate() works like this:

void _Terminate(
   Internal_errors_Source the_source,
   Internal_errors_t      the_error
)
{
   _User_extensions_Fatal( the_source, the_error );
   _System_state_Set( SYSTEM_STATE_TERMINATED );
   _SMP_Request_shutdown();
   _CPU_Fatal_halt( the_source, the_error );
}

You get this behaviour, when there is no BSP fatal error extension which 
resets the system. The _User_extensions_Fatal() would not return in this 
case. If it returns, then _SMP_Request_shutdown() issues the shutdown 
request to the other processors.

-- 
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