nuttxs opened a new pull request, #16744:
URL: https://github.com/apache/nuttx/pull/16744

   ## Summary
   - The `esp32(s3)_async_op()` function uses `nxsem_wait()`, which may cause 
the thread to return early due to signal interruption (EINTR). This can lead 
the main thread to assume that the asynchronous operation has completed, while 
the background worker thread is still running. This may result in accessing 
freed memory or race conditions, causing crashes or undefined behavior.
   - Using `nxsem_wait_uninterruptible()` ensures that the main thread waits 
until the worker thread completes, avoiding the aforementioned issues.
   
   ## Impact
   New Feature/Change: Bugfix
   User Impact: ESP32/S3 SPI Flash Async Operation Fix - Aggressive Signal issue
   Build Impact:No new Kconfig options or build system changes.
   Hardware Impact: Compatible with esp32&S3
   Security: No
   Compatibility: Backward-compatible; no breaking changes.
   
   ## Testing
   defconfig: esp32-devkitc/psram_usrheap
   
   1. Created an "aggressive" signal - sending thread. During each operation 
flash. it sends signals (SIGINT) to the main thread at fixed intervals (10ms).
   2. The main thread performs multiple Flash operations (erase, write, read - 
verify), many times. Each time, it uses data of different sizes (512KB for 
large - block data and 1KB for small - block data) 
   
   


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to