tmedicci opened a new pull request, #7657:
URL: https://github.com/apache/incubator-nuttx/pull/7657

   ## Summary
   
   This PR intends to make `longjmp` context-switch safe by disabling the 
interrupts before modifying windowbase and windowsstart to avoid register 
corruption. This PR is related to an issue first observed on ESP-IDF 
(https://github.com/espressif/esp-idf/issues/5229) and it was, then, checked on 
NuttX. 
   
   ## Impact
   
   Prevents `longjump` to load corrupted registers.
   
   ## Testing
   
   Internal CI build pass considering the `ostest` and `smp` `defconfigs` for 
ESP32, ESP32-S2 and ESP32-S3. These `defconfigs` enables the `ostest` which run 
the `setjmp/longjmp` test. Also, the issue was reproduced on NuttX by a test 
application that performs multiple `setjmp/longjmp` operations (reference: 
https://en.cppreference.com/w/c/program/longjmp). This test usually crashes 
and, after applying the patch, the problem is gone.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to