tmedicci opened a new issue, #8927: URL: https://github.com/apache/nuttx/issues/8927
## Summary While delivering a signal to a task that is currently running on the other core (SMP-enabled), the `<arch>_sig_deliver` needs to leave the critical section first (previously forced). This should use the interrupt state (PS register on Xtensa, for instance) of the previously set registers explicitly for the signal handler. In most cases, however, `leave_critical_section` is called with the saved interrupt state as the input argument. The saved state (saved registers prior to the task's interruption to treat the signal) should only be used when restoring the task's registers after signal handling. ## How to Reproduce This problem was first identified on ESP32: it crashes while trying to deliver a signal to a task running on the other CPU. This behavior can be verified by selecting `EXAMPLES_ALARM` app and - in order to force the task to be running - omitting the `usleep` on `alarm_main.c`. Prior to this [PR](https://github.com/apache/nuttx/pull/8926), the application crashed while delivering the signal to the app. ## Is it a "System Bug"? Potentially! `xtensa_sig_deliver` seems to have been inspired by other multi-core architectures. They are all very similar: `nuttx/arch/arm/src/armv7-m/arm_sigdeliver.c` is an example. ## What Have I Done? I fixed it to Xtensa devices. Please refer to https://github.com/apache/nuttx/pull/8926 I can't test on other architectures, so I hope the community can help with it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org