phoenix-rtos / phoenix-rtos-kernel

Phoenix-RTOS microkernel repository
http://phoenix-rtos.com
BSD 3-Clause "New" or "Revised" License
114 stars 33 forks source link

armv7m: Kill process on exception #547

Closed agkaminski closed 5 months ago

agkaminski commented 6 months ago

Description

Expected behaviour (hello causing exception with premeditation):

(psh)% sysexec hello
Hello World!!

Exception: 6 #UsageFault
 r0=0000000d  r1=00000003  r2=0805037f  r3=00000018
 r4=200241f4  r5=00000000  r6=00000001  r7=00000000
 r8=00000000  r9=20023648 r10=2000f750 r11=200235ac
r12=00000001 psr=60000000  lr=00000000  pc=00000000
psp=200241d0 msp=20023600 exr=fffffffd bfa=e000ed38
cfs=00020000

Exception: 6 #UsageFault
 r0=0000000d  r1=00000003  r2=0805037f  r3=00000018
 r4=200241f4  r5=00000000  r6=00000001  r7=00000000
 r8=00000000  r9=20023648 r10=2000f750 r11=200235ac
r12=00000001 psr=60000000  lr=00000000  pc=00000000
psp=200241d0 msp=20023600 exr=fffffffd bfa=e000ed38
cfs=00020000

in thread 33, process "hello" (PID: 21)
(psh)%

Never ending exception on other targets has been fixed too, now the process will be ended immediately

Motivation and Context

Types of changes

How Has This Been Tested?

Checklist:

Special treatment

agkaminski commented 6 months ago

@anglov this feature can be disabled by defining KERNEL_REBOOT_ON_EXCEPTION in the board_config.h

github-actions[bot] commented 6 months ago

Unit Test Results

7 460 tests  ±0   6 745 :white_check_mark: ±0   39m 9s :stopwatch: + 1m 58s   420 suites ±0     715 :zzz: ±0      1 files   ±0       0 :x: ±0 

Results for commit 7418097c. ± Comparison against base commit f29031f5.

:recycle: This comment has been updated with latest results.

gerard5 commented 6 months ago

btw. I am missing something like SIGSEGV or similar, if at all in NOMMU (some artificial SIGSEGV) it is possible to notify the process of a serious fault.