casaroli opened a new pull request, #4211: URL: https://github.com/apache/nuttx-apps/pull/4211
depends-on: apache/nuttx/pull/22585 ## Summary Add a case `test_nuttx_fs_shmlink01` to `cmocka_fs_test` (`testing/testsuites/kernel/fs`). A shm object with a hard link must keep its data until its last name goes, and its memory must go then. The case makes a 64 KiB shm object, maps it, links a second name to it, removes the first name, closes and unmaps it, reads the data through the second name, removes the second name, and checks with `mallinfo()` that the memory of the object is free again (4 KiB slack). The fix is apache/nuttx#22585. Without it the object is never freed and the case fails. Merge this PR after it. ## Impact Only `cmocka_fs_test` changes: one new case file, its prototype and its line in the test list. The case is built only with `CONFIG_FS_SHMFS`. It skips where `mallinfo()` does not see the memory of the object: in a kernel build (the pages come from the page pool) and in a flat build with a separate kernel heap or file system heap. rv-virt:citest and sim:citest enable `CM_FS_TEST` and `FS_SHMFS`, so the case runs there. ## Testing | Configuration | nuttx master 1af7ac541e4 | nuttx with apache/nuttx#22585 | |---|---|---| | rv-virt:citest (flat, riscv32, QEMU TCG) | shmlink01 FAIL | shmlink01 OK; whole `cmocka_fs_test`: 50 of 50 pass | | qemu-armv8a:nsh (flat, arm64, QEMU TCG) + `CM_FS_TEST`, `FS_SHMFS` | shmlink01 FAIL | shmlink01 OK; whole `cmocka_fs_test`: 48 of 48 pass | | rv-virt:nsh64 (flat, riscv64, QEMU TCG) + `CM_FS_TEST`, `FS_SHMFS` | shmlink01 FAIL | shmlink01 OK | sim:citest builds. `tools/checkpatch.sh -c -u -m -g`: pass. -- 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]
