You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "nuttxs (via GitHub)" <gi...@apache.org> on 2025/07/18 10:29:11 UTC

[PR] arch/xtensa: fix esp32(s3)_async_op() asynchronous operation race issue [nuttx]

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-unsubscribe@nuttx.apache.org

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


Re: [PR] arch/xtensa/esp32: fix esp32(s3)_async_op() asynchronous operation race issue [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #16744:
URL: https://github.com/apache/nuttx/pull/16744


-- 
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-unsubscribe@nuttx.apache.org

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


Re: [PR] arch/xtensa/esp32: fix esp32(s3)_async_op() asynchronous operation race issue [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #16744:
URL: https://github.com/apache/nuttx/pull/16744#issuecomment-3089692721

   let's ignore the known xtensa ci break.


-- 
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-unsubscribe@nuttx.apache.org

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