Skip to content

Conversation

@wangzhi16
Copy link
Contributor

Summary

This PR series improves test reliability and fixes critical bugs in the NuttX test suite:

  1. Mutex Test Fix: Corrects multi-thread synchronization test to use same lock
  2. Memory FD Enhancement: Adds comprehensive stability test cases
  3. FIFO Pipe Bug Fixes: Resolves double-close issue (Coverity CID 1667262) and improves error detection

Testing Impact

  • Improved mutex/synchronization testing
  • New file system stability tests
  • Fixed resource leaks in pipe tests
  • Better error detection in IPC operations

Files Modified

  • testing/testsuites/kernel/sched/cases/api_pthread_test_007.c
  • testing/fs/memfd/* (new)
  • examples/pipe/interlock_test.c

Signed-off-by: wangzhi16 wangzhi16@xiaomi.com

Multiple threads should use the same lock for resource protection.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
Supplement ostest test cases.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
There are three bug in fifo testcase.

1. line 211 and line 295 should be nbytes not ret.
2. coverity report error:
CID 1667262: (apache#4 of 11): Double close (USE_AFTER_FREE)
11. double_close: Calling close(int) will close the handle fd that has already been closed. [Note: The source code implementation of this function has been overwritten by the built-in model.]

Double close will ocurr when line 234 is true and goto line 341, close again!
Now, Using the previous code logic, Use a tid and an errout_with_null_thread to avoid uninitialized problems.

3. since line 295 is used ret not nbytes, error not expose before.

When the end of read and write are opened, end of write will write successfully even if end of read not read.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants